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