Code

Added keydef screen
[ncmpc.git] / configure.ac
1 dnl
2 dnl  $Id: configure.ac,v 1.10 2004/03/18 09:33:43 kalle Exp $
3 dnl
5 AC_INIT(main.c)
6 AM_INIT_AUTOMAKE(ncmpc, 0.10.1)
8 dnl Check for programs
9 AC_PROG_CC
10 AC_PROG_INSTALL
11 dnl AC_PROG_LIBTOOL
13 dnl =======================================================
14 dnl initialize variables
15 dnl =======================================================
17 set -- $CFLAGS
18 CFLAGS="-Wall $CFLAGS"
20 keydef_screen=yes
22 dnl
23 dnl Check for types
24 dnl
25 dnl AC_CHECK_TYPE(socklen_t, 
26 dnl           AC_DEFINE(HAVE_SOCKLEN_T, 1, socklen_t defined in sys/socket.h),
27 dnl )
29 AC_SOCKLEN_T
32 dnl
33 dnl Check for headers
34 dnl
36 AC_CHECK_HEADER(libgen.h,
37                 AC_DEFINE(HAVE_LIBGEN_H, 1, glibc - libgen.h),
38                 ,)
40 AC_CHECK_HEADER(locale.h,
41                 AC_DEFINE(HAVE_LOCALE_H, 1, locale.h),
42                 ,)
45 dnl
46 dnl Check for functions
47 dnl
48 AC_CHECK_FUNCS(basename strcasestr)
51 dnl
52 dnl Check for libraries
53 dnl
55 dnl ncurses
56 AC_CHECK_LIB(ncurses, initscr,, [AC_MSG_ERROR(ncurses library is required)])
57 LIBS="$LIBS -lncurses"
59 dnl glib-2.0
60 AM_PATH_GLIB_2_0(, , [AC_MSG_ERROR(glib-2.x is required)], glib)
62 dnl popt
63 AC_CHECK_LIB(popt, 
64              poptGetArg,
65              LIBS="$LIBS -lpopt",
66              AC_MSG_ERROR(Missing popt command line parsing library))
71 dnl Debugging 
72 AC_ARG_ENABLE(debug, 
73               AS_HELP_STRING([--enable-debug],[Enable debugging]),
74               , 
75               enable_debug=no)
77 if test "$enable_debug" = yes; then
78    CFLAGS="$CFLAGS -g -DDEBUG"
79 fi
81 dnl Key editor
82 AC_ARG_ENABLE(key-editor, 
83               AS_HELP_STRING([--enable-key-editor],[Enable key editor]),
84               keydef_screen=no,
85               keydef_screen=yes)
86 if test "$keydef_screen" = yes; then
87        CFLAGS="$CFLAGS -DENABLE_KEYDEF_SCREEN"
88 fi
89 dnl   AC_DEFINE(ENABLE_KEYDEF_SCREEN, 1, [Enable builtin key editor]), 
92 dnl Default host
93 AC_ARG_WITH(default-host,
94             AS_HELP_STRING([--with-default-host=ARG],
95                            [Default MPD host (localhost)]),
96             DEFAULT_HOST="$withval",
97             DEFAULT_HOST="localhost")
99 dnl Default port
100 AC_ARG_WITH(default-port,
101             AS_HELP_STRING([--with-default-port=ARG],[Default port (2100)]),
102             DEFAULT_PORT="$withval",
103             DEFAULT_PORT="2100")
106 CFLAGS="$CFLAGS $GLIB_CFLAGS -DSYSCONFDIR=\\\"\$(sysconfdir)\\\""
107 LIBS="$LIBS $GLIB_LIBS"
110 dnl Autoheader
111 AC_DEFINE_UNQUOTED(DEFAULT_PORT,      $DEFAULT_PORT,     Default MPD port)
112 AC_DEFINE_UNQUOTED(DEFAULT_PORT_STR, "$DEFAULT_PORT",    Default MPD port)
113 AC_DEFINE_UNQUOTED(DEFAULT_HOST,     "$DEFAULT_HOST",    Default MPD host)
115 AM_CONFIG_HEADER(config.h)
117 AC_OUTPUT(doc/Makefile Makefile)
119 echo "
120 Configuration:  
121   prefix:                             ${prefix}
122   sysconfdir:                         ${sysconfdir}
123   Default MPD host:                   ${DEFAULT_HOST}
124   Default MPD port:                   ${DEFAULT_PORT}
125   Enable debugging:                   ${enable_debug}
126   Key edit screen:                    ${keydef_screen}
128 echo