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
23 dnl initialize variables
30 dnl Check for libraries
33 dnl Try to find the socket functions
34 AC_CHECK_FUNC([socket],
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],
43 [AC_CHECK_LIB([nsl],[gethostbyname],[LIBS="$LIBS -lnsl"],
44 [AC_MSG_ERROR(No UNIX gethostbyname API found)])]
53 AS_HELP_STRING([--enable-werror],
54 [Treat warnings as errors (default: disabled)]),
55 ENABLE_WERROR=$enableval,
58 if test "x$ENABLE_WERROR" = xyes; then
59 AM_CFLAGS="$AM_CFLAGS -Werror -pedantic-errors"
63 AS_HELP_STRING([--enable-debug],
64 [Enable debugging (default: disabled)]),
65 ENABLE_DEBUG=$enableval,
68 if test "x$ENABLE_DEBUG" = xno; then
69 AM_CFLAGS="$AM_CFLAGS -DNDEBUG"
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])
93 dnl Compile-time options
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])
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])
122 AC_OUTPUT([Makefile])