2 # Process this file with autoconf to produce a configure script.
4 #---------------------------------------------------------------------------
5 # Global initialisation
7 #----------------------------------------
12 [m4_esyscmd_s([./scripts/version.sh])],
14 AC_CONFIG_SRCDIR([frontends/conf/conf.c])
15 # Use a config.h to avoid brazilions -DHAVE_FOO on compile lines
16 AC_CONFIG_HEADERS([scripts/.autostuff/config.h])
17 AC_CONFIG_AUX_DIR([scripts/.autostuff/scritps])
18 AC_CONFIG_MACRO_DIR([scripts/.autostuff/m4])
20 #----------------------------------------
24 #----------------------------------------
27 LT_INIT([disable-static])
29 #---------------------------------------------------------------------------
31 # Although there is a default (="linux") in the code, we do provide
32 # a default here, to get a consistent autostuff behavior
36 [--enable-package-name],
37 [set the package name (default=kconfig-frontends)])],
40 [yes], [package_name=$PACKAGE_NAME],
41 [no], [package_name=],
42 [# Escape the $ signs, otherwise they would get munged by make
43 # Also, append a space at the end, to separate the package
44 # name from the literal 'Configuration'
45 package_name="$( echo "$enableval" \
46 |sed -r -e 's/\$/\\$$/g;' \
49 AC_SUBST([package_name], [${package_name=$PACKAGE_NAME}])
54 [--enable-config-prefix=PREFIX],
55 [the prefix to the config option (default=CONFIG_)])],
58 [*" "*],[AC_MSG_ERROR([config prefix can not contain spaces: '$enableval'])],
59 [yes], [config_prefix=CONFIG_],
60 [no], [config_prefix=],
61 [config_prefix=$enableval])])
62 AC_SUBST([config_prefix], [${config_prefix-CONFIG_}])
64 #----------------------------------------
65 # Options to selectively enable/disable frontends
66 # All are selected by default
71 [conf, the stdin-based frontend (default=auto)])])
72 AC_SUBST([enable_conf], [${enable_conf:-auto}])
77 [mconf, the traditional ncurses-based frontend (default=auto)])])
78 AC_SUBST([enable_mconf], [${enable_mconf:-auto}])
83 [nconf, the modern ncurses-based frontend (default=auto)])])
84 AC_SUBST([enable_nconf], [${enable_nconf:-auto}])
89 [gconf, the GTK-based frontend (default=auto)])])
90 AC_SUBST([enable_gconf], [${enable_gconf:-auto}])
95 [qconf, the QT-based frontend (default=auto)])])
96 AC_SUBST([enable_qconf], [${enable_qconf:-auto}])
101 [--enable-frontends=list],
102 [enables only the set of frontends in comma-separated 'list'
103 (default: auto selection), takes precedence over all
104 --enable-*conf, above])],
105 [for f in conf mconf nconf gconf qconf; do
108 [yes], [eval enable_$f=yes],
109 ["$f"], [eval enable_$f=yes],
110 ["$f",*], [eval enable_$f=yes],
111 [*,"$f"], [eval enable_$f=yes],
112 [*,"$f",*], [eval enable_$f=yes],
115 AC_SUBST([enable_frontends])
117 #----------------------------------------
118 # Dependencies that will be needed, depending on the frontends
120 ["$enable_mconf":"$enable_nconf"],
121 [*yes*], [need_curses=yes],
122 [*auto*], [need_curses=auto],
124 [need_panel_menu="$enable_nconf"]
126 ["$enable_gconf":"$enable_qconf"],
127 [*yes*], [need_pkgconfig=yes],
128 [*auto*], [need_pkgconfig=yes],
129 [need_pkgconfig=no ])
130 [need_gtk="$enable_gconf"]
131 [need_qt="$enable_qconf"]
133 #---------------------------------------------------------------------------
134 # Now check we have the required stuff
136 #----------------------------------------
137 # Some program checks
148 [AC_MSG_ERROR([can not find gperf])])
150 [test "$need_pkgconfig" = "yes"],
151 [PKG_PROG_PKG_CONFIG()])
153 AC_SUBST([AM_LFLAGS], ["-L -P zconf"])
155 AC_SUBST([AM_YFLAGS], ["-t -l -p zconf"])
157 #----------------------------------------
158 # Check for standard headers
161 AC_CHECK_HEADERS([ fcntl.h libintl.h limits.h locale.h ])
162 AC_CHECK_HEADERS([ stdlib.h string.h sys/time.h unistd.h ])
165 #----------------------------------------
166 # Checks for library functions.
170 AC_CHECK_FUNCS([ bzero memmove memset ])
171 AC_CHECK_FUNCS([ strcasecmp strchr strcspn strdup strncasecmp strpbrk strrchr strspn strtol ])
172 AC_CHECK_FUNCS([ gettimeofday mkdir regcomp setlocale uname ])
174 #----------------------------------------
175 # Check for gettext, for the kconfig frontends
179 [ac_ct_gettext_hdr=$ac_header; break],
180 [AC_MSG_WARN([libintl is missing, frontends will not be localised])])
182 [test -n "$ac_ct_gettext_hdr"],
185 [AC_MSG_WARN([gettext is missing, frontends will not be localised])
186 GETTEXT=-DKBUILD_NO_NLS],
187 [#include <$ac_ct_gettext_hdr>])])
189 #----------------------------------------
190 # Check for ncurses, for the mconf & nconf frontends
192 [test "$need_curses" = "yes" -o "$need_curses" = "auto"],
193 [AC_SUBST([CURSES_LOC])
194 AC_SUBST([ncurses_LIBS])
197 [ncurses/ncurses.h ncurses/curses.h ncursesw/curses.h ncurses.h curses.h],
198 [CURSES_LOC=$ac_header; break])
200 [test -z "$CURSES_LOC"],
202 [test "$need_curses" = "yes"],
203 [AC_MSG_ERROR([could not find curses headers (frontends: mconf/nconf)])],
207 [ncursesw ncurses curses],
208 [ac_ct_curses_lib_found=yes; break])
210 [test -z "$ac_ct_curses_lib_found"],
212 [test "$need_curses" = "yes"],
213 [AC_MSG_ERROR([could not find curses library (frontends: mconf/nconf)])],
219 [test "$has_curses" = "no" ],
220 [enable_mconf=no; enable_nconf=no])
222 #----------------------------------------
223 # Check for libpanel and libmenu, for the nconf frontend
225 [test "$need_panel_menu" = "yes" -o "$need_panel_menu" = "auto"],
226 [AC_SUBST([ncurses_extra_LIBS])
231 [ac_ct_panel_lib_found=yes; break])
233 [test -z "$ac_ct_panel_lib_found"],
235 [test "$need_panel_menu" = "yes"],
236 [AC_MSG_ERROR([could not find libpanel library (frontend: nconf)])],
237 [has_panel_menu=no])])
241 [ac_ct_menu_lib_found=yes; break])
243 [test -z "$ac_ct_panel_lib_found"],
245 [test "$need_panel_menu" = "yes"],
246 [AC_MSG_ERROR([could not find libmenu library (frontend: nconf)])],
247 [has_panel_menu=no])])
248 ncurses_extra_LIBS="$LIBS"
252 [test "$has_panel_menu" = "no" ],
255 #----------------------------------------
256 # Check headers and libs for gconf
258 [test "$need_gtk" = "yes" -o "$need_gtk" = "auto"],
261 [gtk+-2.0 gmodule-2.0 libglade-2.0],
264 [test "$need_gtk" = "yes"],
265 [AC_MSG_ERROR([could not find GTK+ headers and/or libraries (frontend: gconf)])],
269 [test "$has_gtk" = "no" ],
272 #----------------------------------------
273 # Check headers and libs for qconf
275 [test "$need_qt" = "yes" -o "$need_qt" = "auto"],
278 [QtCore QtGui Qt3Support],
281 [test "$need_qt" = "yes"],
282 [AC_MSG_ERROR([could not find QT4 headers and/or libraries (frontend: qconf)])],
286 [test "$has_qt" = "no" ],
289 #---------------------------------------------------------------------------
290 # Now, we know what frontends to enable
291 AS_IF([test "$enable_conf" = "auto"], [enable_conf=yes ])
292 AS_IF([test "$enable_gconf" = "auto"], [enable_gconf=yes])
293 AS_IF([test "$enable_mconf" = "auto"], [enable_mconf=yes])
294 AS_IF([test "$enable_nconf" = "auto"], [enable_nconf=yes])
295 AS_IF([test "$enable_qconf" = "auto"], [enable_qconf=yes])
297 #----------------------------------------
298 # Check if the lxdialog library should be built
300 [test "$enable_mconf" = "yes"],
304 #----------------------------------------
305 # Setup automake conditional build
308 [test "$enable_conf" = "yes"])
311 [test "$enable_mconf" = "yes"])
314 [test "$enable_nconf" = "yes"])
317 [test "$enable_gconf" = "yes"])
320 [test "$enable_qconf" = "yes"])
323 [test "$need_lxdialog" = "yes"])
325 #----------------------------------------
326 # Get the version to apply to the parser shared library
328 [KCONFIGPARSER_LIB_VERSION],
329 [m4_esyscmd_s([./scripts/version.sh --plain])])
331 #----------------------------------------
337 libs/lxdialog/Makefile
340 frontends/conf/Makefile
341 frontends/mconf/Makefile
342 frontends/nconf/Makefile
343 frontends/gconf/Makefile
344 frontends/qconf/Makefile
349 AC_MSG_NOTICE([Configured with:])
350 AC_MSG_NOTICE([- package name: '$package_name'])
351 AC_MSG_NOTICE([- config prefix: '$config_prefix'])
352 AC_MSG_NOTICE([- frontends:])
353 AS_IF([test "$enable_conf" = "yes"],
354 [AC_MSG_NOTICE([ - conf: yes])],
355 [AC_MSG_NOTICE([ - conf: no])])
356 AS_IF([test "$enable_gconf" = "yes"],
357 [AC_MSG_NOTICE([ - gconf: yes])],
358 [AC_MSG_NOTICE([ - gconf: no])])
359 AS_IF([test "$enable_mconf" = "yes"],
360 [AC_MSG_NOTICE([ - mconf: yes])],
361 [AC_MSG_NOTICE([ - mconf: no])])
362 AS_IF([test "$enable_nconf" = "yes"],
363 [AC_MSG_NOTICE([ - nconf: yes])],
364 [AC_MSG_NOTICE([ - nconf: no])])
365 AS_IF([test "$enable_qconf" = "yes"],
366 [AC_MSG_NOTICE([ - qconf: yes])],
367 [AC_MSG_NOTICE([ - qconf: no])])
368 AC_MSG_NOTICE([- parser library:])
369 AS_IF([test "$enable_shared" = "yes"],
370 [AC_MSG_NOTICE([ - shared: yes, versioned $KCONFIGPARSER_LIB_VERSION])],
371 [AC_MSG_NOTICE([ - shared: no])])
372 AC_MSG_NOTICE([ - static: $enable_static])