Code

Changed the old CVS Id tag to a SVN Id tag, version updated to 0.10.2-svn
[ncmpc.git] / configure.ac
1 dnl
2 dnl  $Id$
3 dnl
5 AC_INIT
6 AC_CONFIG_SRCDIR([main.c])
7 AM_INIT_AUTOMAKE(ncmpc, 0.10.2-svn)
9 dnl Check for programs
10 AC_PROG_CC
11 AC_PROG_INSTALL
12 dnl AC_PROG_LIBTOOL
14 dnl =======================================================
15 dnl initialize variables
16 dnl =======================================================
18 set -- $CFLAGS
19 CFLAGS="-Wall $CFLAGS"
21 keydef_screen=yes
23 dnl
24 dnl Check for types
25 dnl
27 AC_SOCKLEN_T
30 dnl
31 dnl Check for headers
32 dnl
34 AC_CHECK_HEADER(libgen.h,
35                 AC_DEFINE(HAVE_LIBGEN_H, 1, glibc - libgen.h),
36                 ,)
38 AC_CHECK_HEADER(locale.h,
39                 AC_DEFINE(HAVE_LOCALE_H, 1, locale.h),
40                 ,)
43 dnl
44 dnl Check for functions
45 dnl
46 AC_CHECK_FUNCS(basename strcasestr)
49 dnl
50 dnl Check for libraries
51 dnl
53 dnl ncurses
54 AC_CHECK_LIB(ncurses, initscr,, [AC_MSG_ERROR(ncurses library is required)])
55 LIBS="$LIBS -lncurses"
57 dnl glib-2.0
58 AM_PATH_GLIB_2_0(, , [AC_MSG_ERROR(glib-2.x is required)], glib)
60 dnl popt
61 AC_CHECK_LIB(popt, 
62              poptGetArg,
63              LIBS="$LIBS -lpopt",
64              AC_MSG_ERROR(Missing popt command line parsing library))
69 dnl Debugging 
70 AC_ARG_ENABLE(debug, 
71               AC_HELP_STRING(--enable-debug,Enable debugging (default=no)),
72               , 
73               enable_debug=no)
75 if test "$enable_debug" = yes; then
76    CFLAGS="$CFLAGS -g -DDEBUG"
77 fi
79 dnl Key editor
80 AC_ARG_ENABLE(key-editor, 
81               AC_HELP_STRING(--enable-key-editor,
82                              Enable key editor (default=yes)),
83               keydef_screen=no,
84               keydef_screen=yes)
85 if test "$keydef_screen" = yes; then
86        CFLAGS="$CFLAGS -DENABLE_KEYDEF_SCREEN"
87 fi
88 dnl   AC_DEFINE(ENABLE_KEYDEF_SCREEN, 1, [Enable builtin key editor]), 
91 dnl Default host
92 AC_ARG_WITH(default-host,
93             AC_HELP_STRING(--with-default-host=ARG,Default MPD host (localhost)),
94             DEFAULT_HOST="$withval",
95             DEFAULT_HOST="localhost")
97 dnl Default port
98 AC_ARG_WITH(default-port,
99             AC_HELP_STRING(--with-default-port=ARG,Default port (2100)),
100             DEFAULT_PORT="$withval",
101             DEFAULT_PORT="2100")
104 CFLAGS="$CFLAGS $GLIB_CFLAGS -DSYSCONFDIR=\\\"\$(sysconfdir)\\\""
105 LIBS="$LIBS $GLIB_LIBS"
108 dnl Autoheader
109 AC_DEFINE_UNQUOTED(DEFAULT_PORT,      $DEFAULT_PORT,     Default MPD port)
110 AC_DEFINE_UNQUOTED(DEFAULT_PORT_STR, "$DEFAULT_PORT",    Default MPD port)
111 AC_DEFINE_UNQUOTED(DEFAULT_HOST,     "$DEFAULT_HOST",    Default MPD host)
113 AM_CONFIG_HEADER(config.h)
115 AC_CONFIG_FILES([doc/Makefile Makefile])
116 AC_OUTPUT
118 echo "
119 Configuration:  
120   prefix:                             ${prefix}
121   sysconfdir:                         ${sysconfdir}
122   Default MPD host:                   ${DEFAULT_HOST}
123   Default MPD port:                   ${DEFAULT_PORT}
124   Enable debugging:                   ${enable_debug}
125   Key edit screen:                    ${keydef_screen}
127 echo