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-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="de 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 if test "x$nls" != "xyes"; then
97 AC_MSG_WARN([NLS support disabled!])
98 fi
99 else
100 AM_PO_SUBDIRS
101 fi
104 dnl disbale raw mode
105 AC_MSG_CHECKING([Place the terminal into raw mode])
106 AC_ARG_ENABLE([raw-mode],
107 AC_HELP_STRING([--disable-raw-mode],
108 [Disable raw terminal mode]),
109 [use_raw=$enableval],
110 [use_raw=yes])
111 AC_MSG_RESULT([$use_raw])
112 if test "x$use_raw" = "xyes" ; then
113 AC_DEFINE([ENABLE_RAW_MODE], [1], [Place the terminal into raw mode])
114 fi
116 dnl Debugging
117 AC_MSG_CHECKING([whether to build with debug support])
118 AC_ARG_ENABLE([debug],
119 AC_HELP_STRING([--enable-debug],
120 [Enable debugging @<:@default=no@:>@]),
121 [enable_debug="$enableval"],
122 [enable_debug=no])
123 AC_MSG_RESULT([$enable_debug])
124 if test "x$enable_debug" = "xyes" ; then
125 CFLAGS="$CFLAGS -Wall -g -DDEBUG"
126 fi
128 dnl Optional screen - help screen
129 #AC_MSG_CHECKING([whether to include the help screen])
130 #AC_ARG_ENABLE([help-screen],
131 # AC_HELP_STRING([--enable-help-screen],
132 # [Enable the help screen @<:@default=yes@:>@]),
133 # [help_screen="$enableval"],
134 # [help_screen=yes])
135 #AC_MSG_RESULT([$help_screen])
136 #if test "x$help_screen" = "xyes" ; then
137 # AC_DEFINE(ENABLE_HELP_SCREEN, 1, [Enable the help screen])
138 #fi
140 dnl Optional screen - browse screen
141 #AC_MSG_CHECKING([whether to include the browse screen])
142 #AC_ARG_ENABLE([browse-screen],
143 # AC_HELP_STRING([--enable-browse-screen],
144 # [Enable the browse screen @<:@default=yes@:>@]),
145 # [browse_screen="$enableval"],
146 # [browse_screen=yes])
147 #AC_MSG_RESULT([$browse_screen])
148 #if test "x$browse_screen" = "xyes" ; then
149 # AC_DEFINE(ENABLE_BROWSE_SCREEN, 1, [Enable the browse screen])
150 #fi
152 dnl Optional screen - key editor
153 AC_MSG_CHECKING([whether to include the key editor screen])
154 AC_ARG_ENABLE([key-screen],
155 AC_HELP_STRING([--enable-key-screen],
156 [Enable key editor screen @<:@default=yes@:>@]),
157 [keydef_screen="$enableval"],
158 [keydef_screen=yes])
159 AC_MSG_RESULT([$keydef_screen])
160 if test "x$keydef_screen" = "xyes" ; then
161 AC_DEFINE(ENABLE_KEYDEF_SCREEN, 1, [Enable key editor screen])
162 fi
164 dnl Optional screen - clock
165 AC_MSG_CHECKING([whether to include the clock screen])
166 AC_ARG_ENABLE([clock-screen],
167 AC_HELP_STRING([--enable-clock-screen],
168 [Enable clock screen @<:@default=no@:>@]),
169 [clock_screen="$enableval"],
170 [clock_screen=no])
171 AC_MSG_RESULT([$clock_screen])
172 if test "x$clock_screen" = "xyes" ; then
173 AC_DEFINE(ENABLE_CLOCK_SCREEN, 1, [Enable clock screen])
174 fi
176 dnl Default host
177 AC_MSG_CHECKING([for default MPD host])
178 AC_ARG_WITH([default-host],
179 AC_HELP_STRING([--with-default-host=ARG],
180 [Default MPD host @<:@localhost@:>@]),
181 [DEFAULT_HOST="$withval"],
182 [DEFAULT_HOST="localhost"])
183 AC_MSG_RESULT([$DEFAULT_HOST])
184 AC_DEFINE_UNQUOTED([DEFAULT_HOST], ["$DEFAULT_HOST"], [Default MPD host])
186 dnl Default port
187 AC_MSG_CHECKING([for default MPD port])
188 AC_ARG_WITH([default-port],
189 AC_HELP_STRING([--with-default-port=ARG],
190 [Default port @<:@6600@:>@]),
191 [DEFAULT_PORT="$withval"],
192 [DEFAULT_PORT="6600"])
193 AC_MSG_RESULT([$DEFAULT_PORT])
194 AC_DEFINE_UNQUOTED([DEFAULT_PORT], [$DEFAULT_PORT], [Default MPD port])
195 AC_DEFINE_UNQUOTED([DEFAULT_PORT_STR], ["$DEFAULT_PORT"], [Default MPD port])
198 AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile po/Makefile.in])
199 AC_OUTPUT