Remove some CamelCase
[libmpdclient/marc.git] / configure.ac
blob57ef69d9409f535d83c966bcb0efae321a2d62cb
1 AC_PREREQ(2.60)
2 AC_INIT(MPD client library for C, 2.0~git, max@duempel.org, libmpdclient)
3 AC_CONFIG_SRCDIR([src/libmpdclient.c])
4 AC_CONFIG_AUX_DIR(build)
5 AM_INIT_AUTOMAKE([foreign 1.9 dist-bzip2])
6 AM_CONFIG_HEADER([config.h])
7 AC_CONFIG_MACRO_DIR([m4])
9 LIBMPDCLIENT_LIBTOOL_VERSION=2:0:0
10 AC_SUBST(LIBMPDCLIENT_LIBTOOL_VERSION)
12 # Remove the check for c++ and fortran compiler
13 m4_defun([_LT_AC_LANG_CXX_CONFIG], [:])
14 m4_defun([_LT_AC_LANG_F77_CONFIG], [:])
16 dnl Check for programs
17 AC_PROG_CC_C99
18 AC_PROG_INSTALL
19 AC_PROG_LIBTOOL
22 dnl
23 dnl initialize variables
24 dnl
26 set -- $CFLAGS
29 dnl
30 dnl Check for libraries
31 dnl
33 dnl Try to find the socket functions
34 AC_CHECK_FUNC([socket],
35         [],
36         [AC_CHECK_LIB([socket], [socket], [LIBS="$LIBS -lsocket"],
37                 [AC_MSG_ERROR(No UNIX socket API found)])]
40 dnl Try to find the gethostbyname functions
41 AC_CHECK_FUNC([gethostbyname],
42         [],
43         [AC_CHECK_LIB([nsl],[gethostbyname],[LIBS="$LIBS -lnsl"],
44                 [AC_MSG_ERROR(No UNIX gethostbyname API found)])]
48 dnl
49 dnl build options
50 dnl
52 AC_ARG_ENABLE(werror,
53         AS_HELP_STRING([--enable-werror],
54                 [Treat warnings as errors (default: disabled)]),
55         ENABLE_WERROR=$enableval,
56         ENABLE_WERROR=no)
58 if test "x$ENABLE_WERROR" = xyes; then
59         AM_CFLAGS="$AM_CFLAGS -Werror -pedantic-errors"
62 AC_ARG_ENABLE(debug,
63         AS_HELP_STRING([--enable-debug],
64                 [Enable debugging (default: disabled)]),
65         ENABLE_DEBUG=$enableval,
66         ENABLE_DEBUG=no)
68 if test "x$ENABLE_DEBUG" = xno; then
69         AM_CFLAGS="$AM_CFLAGS -DNDEBUG"
73 dnl
74 dnl CFLAGS
75 dnl
77 AC_SUBST(AM_CFLAGS)
78 AC_SUBST(AM_CPPFLAGS)
80 CHECK_CFLAG([-Wall])
81 CHECK_CFLAG([-Wextra])
82 CHECK_CFLAG([-Wno-deprecated-declarations])
83 CHECK_CFLAG([-Wmissing-prototypes])
84 CHECK_CFLAG([-Wdeclaration-after-statement])
85 CHECK_CFLAG([-Wshadow])
86 CHECK_CFLAG([-Wpointer-arith])
87 CHECK_CFLAG([-Wstrict-prototypes])
88 CHECK_CFLAG([-Wcast-qual])
89 CHECK_CFLAG([-Wwrite-strings])
92 dnl
93 dnl Compile-time options
94 dnl
96 dnl Default host
97 AC_MSG_CHECKING([for default MPD host])
98 AC_ARG_WITH([default-host],
99         AC_HELP_STRING([--with-default-host=ARG],
100                 [Default MPD host @<:@localhost@:>@]),
101         [DEFAULT_HOST="$withval"],
102         [DEFAULT_HOST="localhost"])
103 AC_MSG_RESULT([$DEFAULT_HOST])
104 AC_DEFINE_UNQUOTED([DEFAULT_HOST], ["$DEFAULT_HOST"], [Default MPD host])
106 dnl Default port
107 AC_MSG_CHECKING([for default MPD port])
108 AC_ARG_WITH([default-port],
109         AC_HELP_STRING([--with-default-port=ARG],
110                 [Default port @<:@6600@:>@]),
111         [DEFAULT_PORT="$withval"],
112         [DEFAULT_PORT="6600"])
113 AC_MSG_RESULT([$DEFAULT_PORT])
114 AC_DEFINE_UNQUOTED([DEFAULT_PORT], [$DEFAULT_PORT], [Default MPD port])
115 AC_DEFINE_UNQUOTED([DEFAULT_PORT_STR], ["$DEFAULT_PORT"], [Default MPD port])
119 dnl Done
122 AC_OUTPUT([Makefile])