d0f2bb77a5ed0cdbc8fc66a6005489ce34f86f02
1 dnl
2 dnl $Id$
3 dnl
5 AC_INIT
6 AC_CONFIG_SRCDIR([src/main.c])
7 AM_INIT_AUTOMAKE([ncmpc], [0.11.1])
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="es de fr ru 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)])
61 dnl Check for glib-2.4
62 PKG_CHECK_MODULES([GLIB],
63 [glib-2.0 >= 2.4],
64 [glib24=yes],
65 [AC_MSG_WARN([glib-2.4 is required for NLS support!])])
66 if test "x$glib24" != "xyes"; then
67 PKG_CHECK_MODULES([GLIB],
68 [glib-2.0 >= 2.2],
69 [nls=no],
70 [AC_MSG_ERROR([glib-2.2 is required])])
71 fi
74 dnl i18n
75 AM_NLS
76 if test "x$glib24" = "xyes"; then
77 nls=$USE_NLS
78 else
79 USE_NLS=no
80 AC_SUBST(USE_NLS)
81 fi
83 if test "x$nls" = "xyes"; then
84 AM_GLIB_GNU_GETTEXT
85 GETTEXT_PACKAGE=$PACKAGE
86 AC_SUBST(GETTEXT_PACKAGE)
87 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],
88 ["${GETTEXT_PACKAGE}"],
89 [gettext domain])
90 nls=$gt_cv_have_gettext
91 if test "x$nls" != "xyes"; then
92 AC_MSG_WARN([NLS support disabled!])
93 fi
94 else
95 AM_PO_SUBDIRS
96 fi
99 dnl disbale raw mode
100 AC_MSG_CHECKING([Place the terminal into raw mode])
101 AC_ARG_ENABLE([raw-mode],
102 AC_HELP_STRING([--disable-raw-mode],
103 [Disable raw terminal mode]),
104 [use_raw=$enableval],
105 [use_raw=yes])
106 AC_MSG_RESULT([$use_raw])
107 if test "x$use_raw" = "xyes" ; then
108 AC_DEFINE([ENABLE_RAW_MODE], [1], [Place the terminal into raw mode])
109 fi
111 dnl Debugging
112 AC_MSG_CHECKING([whether to build with debug support])
113 AC_ARG_ENABLE([debug],
114 AC_HELP_STRING([--enable-debug],
115 [Enable debugging @<:@default=no@:>@]),
116 [enable_debug="$enableval"],
117 [enable_debug=no])
118 AC_MSG_RESULT([$enable_debug])
119 if test "x$enable_debug" = "xyes" ; then
120 CFLAGS="$CFLAGS -Wall -g -DDEBUG"
121 fi
123 dnl Optional screen - help screen
124 #AC_MSG_CHECKING([whether to include the help screen])
125 #AC_ARG_ENABLE([help-screen],
126 # AC_HELP_STRING([--enable-help-screen],
127 # [Enable the help screen @<:@default=yes@:>@]),
128 # [help_screen="$enableval"],
129 # [help_screen=yes])
130 #AC_MSG_RESULT([$help_screen])
131 #if test "x$help_screen" = "xyes" ; then
132 # AC_DEFINE(ENABLE_HELP_SCREEN, 1, [Enable the help screen])
133 #fi
135 dnl Optional screen - browse screen
136 #AC_MSG_CHECKING([whether to include the browse screen])
137 #AC_ARG_ENABLE([browse-screen],
138 # AC_HELP_STRING([--enable-browse-screen],
139 # [Enable the browse screen @<:@default=yes@:>@]),
140 # [browse_screen="$enableval"],
141 # [browse_screen=yes])
142 #AC_MSG_RESULT([$browse_screen])
143 #if test "x$browse_screen" = "xyes" ; then
144 # AC_DEFINE(ENABLE_BROWSE_SCREEN, 1, [Enable the browse screen])
145 #fi
147 dnl Optional - curses getmouse support
148 AC_MSG_CHECKING([whether to include mouse support])
149 AC_ARG_ENABLE([mouse],
150 AC_HELP_STRING([--enable-mouse],
151 [Enable curses getmouse support @<:@default=yes@:>@]),
152 [getmouse="$enableval"],
153 [getmouse=yes])
154 AC_MSG_RESULT([$getmouse])
155 if test "x$getmouse" = "xyes" ; then
156 AC_CHECK_LIB([ncurses],
157 [getmouse],
158 [AC_DEFINE([HAVE_GETMOUSE], [1], [ncurses - getmouse()])],
159 [])
160 fi
162 dnl search screen
163 AC_MSG_CHECKING([whether to include the search screen])
164 AC_ARG_ENABLE([search-screen],
165 AC_HELP_STRING([--enable-search-screen],
166 [Enable search screen (EXPERIMENTAL) @<:@default=no@:>@]),
167 [search_screen="$enableval"],
168 [search_screen=no])
169 AC_MSG_RESULT([$search_screen])
170 if test "x$search_screen" != "xyes" ; then
171 AC_DEFINE(DISABLE_SEARCH_SCREEN, 1, [Disable search screen])
172 fi
174 dnl Optional screen - key editor
175 AC_MSG_CHECKING([whether to include the key editor screen])
176 AC_ARG_ENABLE([key-screen],
177 AC_HELP_STRING([--enable-key-screen],
178 [Enable key editor screen @<:@default=yes@:>@]),
179 [keydef_screen="$enableval"],
180 [keydef_screen=yes])
181 AC_MSG_RESULT([$keydef_screen])
182 if test "x$keydef_screen" != "xyes" ; then
183 AC_DEFINE(DISABLE_KEYDEF_SCREEN, 1, [Disable key editor screen])
184 fi
186 dnl Optional screen - clock
187 AC_MSG_CHECKING([whether to include the clock screen])
188 AC_ARG_ENABLE([clock-screen],
189 AC_HELP_STRING([--enable-clock-screen],
190 [Enable clock screen @<:@default=no@:>@]),
191 [clock_screen="$enableval"],
192 [clock_screen=no])
193 AC_MSG_RESULT([$clock_screen])
194 if test "x$clock_screen" != "xyes" ; then
195 AC_DEFINE(DISABLE_CLOCK_SCREEN, 1, [Disable clock screen])
196 fi
198 dnl Default host
199 AC_MSG_CHECKING([for default MPD host])
200 AC_ARG_WITH([default-host],
201 AC_HELP_STRING([--with-default-host=ARG],
202 [Default MPD host @<:@localhost@:>@]),
203 [DEFAULT_HOST="$withval"],
204 [DEFAULT_HOST="localhost"])
205 AC_MSG_RESULT([$DEFAULT_HOST])
206 AC_DEFINE_UNQUOTED([DEFAULT_HOST], ["$DEFAULT_HOST"], [Default MPD host])
208 dnl Default port
209 AC_MSG_CHECKING([for default MPD port])
210 AC_ARG_WITH([default-port],
211 AC_HELP_STRING([--with-default-port=ARG],
212 [Default port @<:@6600@:>@]),
213 [DEFAULT_PORT="$withval"],
214 [DEFAULT_PORT="6600"])
215 AC_MSG_RESULT([$DEFAULT_PORT])
216 AC_DEFINE_UNQUOTED([DEFAULT_PORT], [$DEFAULT_PORT], [Default MPD port])
217 AC_DEFINE_UNQUOTED([DEFAULT_PORT_STR], ["$DEFAULT_PORT"], [Default MPD port])
220 AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile po/Makefile.in])
221 AC_OUTPUT