Code

Replaced the debug macro with a function
[ncmpc.git] / configure.ac
1 dnl
2 dnl  $Id$
3 dnl
5 AC_INIT
6 AC_CONFIG_SRCDIR([src/main.c])
7 AM_INIT_AUTOMAKE(ncmpc, 0.11.0-svn)
8 AM_CONFIG_HEADER([config.h])
10 dnl Check for programs
11 AC_PROG_CC
12 AC_PROG_INSTALL
13 dnl AC_PROG_LIBTOOL
15 dnl =======================================================
16 dnl initialize variables
17 dnl =======================================================
19 dnl i18n
20 ALL_LINGUAS="sv"
22 set -- $CFLAGS
24 dnl
25 dnl Check for types
26 dnl
28 AC_SOCKLEN_T
31 dnl
32 dnl Check for headers
33 dnl
35 AC_CHECK_HEADER([libgen.h],
36                 AC_DEFINE([HAVE_LIBGEN_H], [1], [glibc - libgen.h]),
37                 ,)
39 AC_CHECK_HEADER([locale.h],
40                 AC_DEFINE([HAVE_LOCALE_H], [1], [locale.h]),
41                 ,)
44 dnl
45 dnl Check for functions
46 dnl
47 AC_CHECK_FUNCS([basename strcasestr])
50 dnl
51 dnl Check for libraries
52 dnl
54 dnl ncurses
55 AC_CHECK_LIB([ncurses], 
56              [initscr],
57              [LIBS="$LIBS -lncurses"], 
58              [AC_MSG_ERROR(ncurses library is required)])
59 AC_CHECK_LIB([ncurses], 
60              [getmouse],
61              [AC_DEFINE([HAVE_GETMOUSE], [1], [ncurses - getmouse()])],
62              [])
66 dnl Check for glib-2.4
67 PKG_CHECK_MODULES([GLIB], 
68                   [glib-2.0 >= 2.4],
69                   glib24=yes,
70                   AC_MSG_WARN([glib-2.4 is required for NLS support!]))
71 if test "x$glib24" != "xyes"; then
72    PKG_CHECK_MODULES([GLIB], 
73                      [glib-2.0 >= 2.2],
74                      nls=no,
75                      AC_MSG_ERROR([glib-2.2 is required]))
76 fi
79 dnl i18n
80 AM_NLS
81 if test "x$glib24" = "xyes"; then
82   nls=$USE_NLS
83 else
84   USE_NLS=no
85   AC_SUBST(USE_NLS)
86 fi
88 if test "x$nls" = "xyes"; then
89    AM_GLIB_GNU_GETTEXT
90    GETTEXT_PACKAGE=$PACKAGE
91    AC_SUBST(GETTEXT_PACKAGE)
92    AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], 
93                       ["${GETTEXT_PACKAGE}"], 
94                       [gettext domain])
95   nls=$gt_cv_have_gettext
96 else
97   AM_PO_SUBDIRS
98 fi
101 dnl Debugging 
102 AC_MSG_CHECKING([whether to build with debug support])
103 AC_ARG_ENABLE([debug], 
104               AC_HELP_STRING([--enable-debug],
105                              [Enable debugging @<:@default=no@:>@]),
106               [enable_debug="$enableval"], 
107               [enable_debug=no])
108 AC_MSG_RESULT([$enable_debug])
109 if test "x$enable_debug" = "xyes" ; then
110    CFLAGS="$CFLAGS -Wall -g -DDEBUG"
111 fi
113 dnl Optional screen - help screen
114 #AC_MSG_CHECKING([whether to include the help screen])
115 #AC_ARG_ENABLE([help-screen], 
116 #              AC_HELP_STRING([--enable-help-screen],
117 #                            [Enable the help screen @<:@default=yes@:>@]),
118 #             [help_screen="$enableval"],
119 #             [help_screen=yes])
120 #AC_MSG_RESULT([$help_screen])
121 #if test "x$help_screen" = "xyes" ; then
122 #   AC_DEFINE(ENABLE_HELP_SCREEN, 1, [Enable the help screen])
123 #fi
125 dnl Optional screen - browse screen
126 #AC_MSG_CHECKING([whether to include the browse screen])
127 #AC_ARG_ENABLE([browse-screen], 
128 #              AC_HELP_STRING([--enable-browse-screen],
129 #                            [Enable the browse screen @<:@default=yes@:>@]),
130 #             [browse_screen="$enableval"],
131 #             [browse_screen=yes])
132 #AC_MSG_RESULT([$browse_screen])
133 #if test "x$browse_screen" = "xyes" ; then
134 #   AC_DEFINE(ENABLE_BROWSE_SCREEN, 1, [Enable the browse screen])
135 #fi
137 dnl Optional screen - key editor
138 AC_MSG_CHECKING([whether to include the key editor screen])
139 AC_ARG_ENABLE([key-screen], 
140               AC_HELP_STRING([--enable-key-screen],
141                              [Enable key editor screen @<:@default=yes@:>@]),
142               [keydef_screen="$enableval"],
143               [keydef_screen=yes])
144 AC_MSG_RESULT([$keydef_screen])
145 if test "x$keydef_screen" = "xyes" ; then
146    AC_DEFINE(ENABLE_KEYDEF_SCREEN, 1, [Enable key editor screen])
147 fi
149 dnl Optional screen - clock
150 AC_MSG_CHECKING([whether to include the clock screen])
151 AC_ARG_ENABLE([clock-screen], 
152               AC_HELP_STRING([--enable-clock-screen],
153                              [Enable clock screen @<:@default=no@:>@]),
154               [clock_screen="$enableval"],
155               [clock_screen=no])
156 AC_MSG_RESULT([$clock_screen])
157 if test "x$clock_screen" = "xyes" ; then
158    AC_DEFINE(ENABLE_CLOCK_SCREEN, 1, [Enable clock screen])
159 fi
161 dnl Default host
162 AC_MSG_CHECKING([for default MPD host])
163 AC_ARG_WITH([default-host],
164             AC_HELP_STRING([--with-default-host=ARG],
165                            [Default MPD host @<:@localhost@:>@]),
166             [DEFAULT_HOST="$withval"],
167             [DEFAULT_HOST="localhost"])
168 AC_MSG_RESULT([$DEFAULT_HOST])
169 AC_DEFINE_UNQUOTED([DEFAULT_HOST], ["$DEFAULT_HOST"], [Default MPD host])
171 dnl Default port
172 AC_MSG_CHECKING([for default MPD port])
173 AC_ARG_WITH([default-port],
174             AC_HELP_STRING([--with-default-port=ARG],
175                            [Default port @<:@6600@:>@]),
176             [DEFAULT_PORT="$withval"],
177             [DEFAULT_PORT="6600"])
178 AC_MSG_RESULT([$DEFAULT_PORT])
179 AC_DEFINE_UNQUOTED([DEFAULT_PORT],     [$DEFAULT_PORT],   [Default MPD port])
180 AC_DEFINE_UNQUOTED([DEFAULT_PORT_STR], ["$DEFAULT_PORT"], [Default MPD port])
183 AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile po/Makefile.in])
184 AC_OUTPUT