2 # Process this file with autoconf to produce a configure script.
4 #---------------------------------------------------------------------------
5 # Global initialisation
7 #----------------------------------------
12 [m4_esyscmd_s([./scripts/version.sh])],
13 [yann.morin.1998@free.fr])
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/scripts])
18 AC_CONFIG_MACRO_DIR([scripts/.autostuff/m4])
20 #----------------------------------------
23 # We want to allow the user to override our default program-prefix,
24 # so we must set-it now, before automake has a chance to interpret
25 # it, but after the options are parsed, so as not to overwrite the
26 # value (if any) set by the user
28 [test "$program_prefix" = NONE],
29 [program_prefix=kconfig-])
34 [test "$(${srcdir}/scripts/version.sh --internal)" = "hg"],
36 [AM_SILENT_RULES([yes])])
39 [test $AM_DEFAULT_VERBOSITY -eq 0],
40 [SILENT_MAKEFLAGS="--no-print-directory -s"],
41 [SILENT_MAKEFLAGS=""])
42 AC_SUBST([SILENT_MAKEFLAGS])
44 #----------------------------------------
46 m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) dnl Automake, we have a problem...
48 LT_INIT([disable-static])
50 #---------------------------------------------------------------------------
53 # By default, do not build with -Wall, unless the user asks for it
58 [build with -Wall (default=no)])],
61 [yes], [wall_CFLAGS=-Wall],
62 [*], [wall_CFLAGS=""])])
63 AC_SUBST([wall_CFLAGS],[${wall_CFLAGS}])
65 # By default, do not build with -Werror, unless the user asks for it
70 [build with -Werror (default=no)])],
73 [yes], [werror_CFLAGS=-Werror],
74 [*], [werror_CFLAGS=""])])
75 AC_SUBST([werror_CFLAGS],[${werror_CFLAGS}])
77 # Although there is a default (="linux") in the code, we do provide
78 # a default here, to get a consistent autostuff behavior
82 [--enable-root-menu-prompt=PROMPT],
83 [set the root-menu prompt (default=Configuration)])],
86 [yes], [root_menu=Configuration],
88 [# Escape the $ signs, otherwise they would get munged by make
89 # Also, append a space at the end, to separate the package
90 # name from the literal 'Configuration'
91 root_menu="$( echo "$enableval" |sed -r -e 's/\$/\\$$/g;' )"])])
92 AC_SUBST([root_menu], [${root_menu=Configuration}])
97 [--enable-config-prefix=PREFIX],
98 [the prefix to the config option (default=CONFIG_)])],
101 [*" "*],[AC_MSG_ERROR([config prefix can not contain spaces: '$enableval'])],
102 [yes], [config_prefix=CONFIG_],
103 [no], [config_prefix=],
104 [config_prefix=$enableval])])
105 AC_SUBST([config_prefix], [${config_prefix-CONFIG_}])
111 [install utilities to manage .config files (default=no)])])
112 AC_SUBST([enable_utils], [${enable_utils:-yes}])
118 [enable localisation (L10n) (default=auto)])])
119 AC_SUBST([enable_L10n], [${enable_L10n:-yes}])
121 #----------------------------------------
122 # Options to selectively enable/disable frontends
123 # All are selected by default
128 [conf, the stdin-based frontend (default=auto)])])
129 AC_SUBST([enable_conf], [${enable_conf:-auto}])
134 [mconf, the traditional ncurses-based frontend (default=auto)])])
135 AC_SUBST([enable_mconf], [${enable_mconf:-auto}])
140 [nconf, the modern ncurses-based frontend (default=auto)])])
141 AC_SUBST([enable_nconf], [${enable_nconf:-auto}])
146 [gconf, the GTK-based frontend (default=auto)])])
147 AC_SUBST([enable_gconf], [${enable_gconf:-auto}])
152 [qconf, the QT-based frontend (default=auto)])])
153 AC_SUBST([enable_qconf], [${enable_qconf:-auto}])
158 [--enable-frontends=list],
159 [enables only the set of frontends in comma-separated 'list'
160 (default: auto selection), takes precedence over all
161 --enable-*conf, above])],
162 [for f in conf mconf nconf gconf qconf; do
165 [yes], [eval enable_$f=yes],
166 ["$f"], [eval enable_$f=yes],
167 ["$f",*], [eval enable_$f=yes],
168 [*,"$f"], [eval enable_$f=yes],
169 [*,"$f",*], [eval enable_$f=yes],
172 AC_SUBST([enable_frontends])
174 #----------------------------------------
175 # What extra CFLAGS we will be using
176 AC_SUBST([kf_CFLAGS], ["$wall_CFLAGS $werror_CFLAGS"])
178 #----------------------------------------
179 # Dependencies that will be needed, depending on the frontends
181 ["$enable_mconf":"$enable_nconf"],
182 [*yes*], [need_curses=yes],
183 [*auto*], [need_curses=auto],
185 [need_panel_menu="$enable_nconf"]
187 ["$enable_gconf":"$enable_qconf"],
188 [*yes*], [need_pkgconfig=yes],
189 [*auto*], [need_pkgconfig=yes],
190 [need_pkgconfig=no ])
191 [need_gtk="$enable_gconf"]
192 [need_qt="$enable_qconf"]
194 #---------------------------------------------------------------------------
195 # Now check we have the required stuff
197 #----------------------------------------
198 # Some program checks
209 [AC_MSG_ERROR([can not find gperf])])
211 [test "$need_pkgconfig" = "yes"],
212 [PKG_PROG_PKG_CONFIG()])
214 AC_SUBST([AM_LFLAGS], ["-L -P zconf"])
216 AC_SUBST([AM_YFLAGS], ["-t -l -p zconf"])
218 #----------------------------------------
219 # Check for standard headers
222 AC_CHECK_HEADERS([ fcntl.h limits.h locale.h ])
223 AC_CHECK_HEADERS([ stdlib.h string.h sys/time.h unistd.h ])
226 #----------------------------------------
227 # Checks for library functions.
231 AC_CHECK_FUNCS([ bzero memmove memset ])
232 AC_CHECK_FUNCS([ strcasecmp strchr strcspn strdup strncasecmp strpbrk strrchr strspn strtol ])
233 AC_CHECK_FUNCS([ gettimeofday mkdir regcomp setlocale uname ])
235 #----------------------------------------
236 # Check for gettext, for the kconfig frontends
237 [has_gettext="$enable_L10n"]
239 [test "$has_gettext" = "yes"],
242 [ac_ct_gettext_hdr=$ac_header; break],
245 [test "$has_gettext" = "yes"],
249 [#include <$ac_ct_gettext_hdr>])])
251 [test "$has_gettext" = "yes"],
261 [test "$has_gettext" = "no"],
262 [intl_CPPFLAGS=-DKBUILD_NO_NLS])
263 AC_SUBST([intl_CPPFLAGS])
264 AC_SUBST([intl_LIBS])
266 #----------------------------------------
267 # Check for ncurses, for the mconf & nconf frontends
269 [test "$need_curses" = "yes" -o "$need_curses" = "auto"],
270 [AC_SUBST([CURSES_LOC])
271 AC_SUBST([ncurses_LIBS])
275 [ncursesw/curses.h ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h],
276 [CURSES_LOC=$ac_header; break])
278 [test -z "$CURSES_LOC"],
280 [test "$need_curses" = "yes"],
281 [AC_MSG_ERROR([could not find curses headers (frontends: mconf/nconf)])],
285 [ncursesw ncurses curses],
286 [ac_ct_curses_lib_found=yes; break])
288 [test -z "$ac_ct_curses_lib_found"],
290 [test "$need_curses" = "yes"],
291 [AC_MSG_ERROR([could not find curses library (frontends: mconf/nconf)])],
297 [test "$has_curses" = "no" ],
298 [enable_mconf=no; enable_nconf=no])
300 #----------------------------------------
301 # Check for libpanel and libmenu, for the nconf frontend
303 [test "$need_panel_menu" = "yes" -o "$need_panel_menu" = "auto"],
304 [AC_SUBST([ncurses_extra_LIBS])
305 AC_SUBST([ncurses_extra_CPPFLAGS])
308 [ncursesw/*],[ncurses_extra_CPPFLAGS="-I/usr/include/ncursesw"],
309 [ncurses/*],[ncurses_extra_CPPFLAGS="-I/usr/include/ncurses"])
315 [ac_ct_panel_lib_found=yes; break],,
318 [test -z "$ac_ct_panel_lib_found"],
320 [test "$need_panel_menu" = "yes"],
321 [AC_MSG_ERROR([could not find libpanel library (frontend: nconf)])],
322 [has_panel_menu=no])])
326 [ac_ct_menu_lib_found=yes; break],,
329 [test -z "$ac_ct_panel_lib_found"],
331 [test "$need_panel_menu" = "yes"],
332 [AC_MSG_ERROR([could not find libmenu library (frontend: nconf)])],
333 [has_panel_menu=no])])
334 ncurses_extra_LIBS="$LIBS"
338 [test "$has_panel_menu" = "no" ],
341 #----------------------------------------
342 # Check headers and libs for gconf
344 [test "$need_gtk" = "yes" -o "$need_gtk" = "auto"],
347 [gtk+-2.0 gmodule-2.0 libglade-2.0],
350 [test "$need_gtk" = "yes"],
351 [AC_MSG_ERROR([could not find GTK+ headers and/or libraries (frontend: gconf)])],
355 [test "$has_gtk" = "no" ],
358 #----------------------------------------
359 # Check headers and libs for qconf
361 [test "$need_qt" = "yes" -o "$need_qt" = "auto"],
364 [QtCore QtGui Qt3Support],
365 [has_qt=yes; need_moc="$need_qt"],
367 [test "$need_qt" = "yes"],
368 [AC_MSG_ERROR([could not find QT4 headers and/or libraries (frontend: qconf)])],
369 [has_qt=no; need_moc=no])])])
371 AC_ARG_VAR([MOC], [Qt meta object compiler (moc) command])
373 [test "$need_moc" = "yes" -o "$need_moc" = "auto"],
374 [QT4_BINDIR=`$PKG_CONFIG Qt --variable bindir`
383 [test "$need_moc" = "yes"],
384 [AC_MSG_ERROR([could not find moc (frontend: qconf)])],
388 [test "$has_qt" = "no" -o "$has_moc" = "no"],
391 #----------------------------------------
392 # Per-frontends extra libraries
393 AC_ARG_VAR([conf_EXTRA_LIBS], [Extra libraries to build the conf frontend] )
394 AC_ARG_VAR([gconf_EXTRA_LIBS], [Extra libraries to build the gconf frontend])
395 AC_ARG_VAR([mconf_EXTRA_LIBS], [Extra libraries to build the mconf frontend])
396 AC_ARG_VAR([nconf_EXTRA_LIBS], [Extra libraries to build the nconf frontend])
397 AC_ARG_VAR([qconf_EXTRA_LIBS], [Extra libraries to build the qconf frontend])
399 #---------------------------------------------------------------------------
400 # Now, we know what frontends to enable
401 AS_IF([test "$enable_conf" = "auto"], [enable_conf=yes ])
402 AS_IF([test "$enable_gconf" = "auto"], [enable_gconf=yes])
403 AS_IF([test "$enable_mconf" = "auto"], [enable_mconf=yes])
404 AS_IF([test "$enable_nconf" = "auto"], [enable_nconf=yes])
405 AS_IF([test "$enable_qconf" = "auto"], [enable_qconf=yes])
407 #----------------------------------------
408 # Check if the lxdialog library should be built
410 [test "$enable_mconf" = "yes"],
414 #----------------------------------------
415 # Check if the images library should be built
417 [test "$enable_gconf" = "yes" -o "$enable_qconf" = "yes"],
421 #----------------------------------------
422 # Setup automake conditional build
425 [test "$enable_conf" = "yes"])
428 [test "$enable_mconf" = "yes"])
431 [test "$enable_nconf" = "yes"])
434 [test "$enable_gconf" = "yes"])
437 [test "$enable_qconf" = "yes"])
440 [test "$need_lxdialog" = "yes"])
443 [test "$need_images" = "yes"])
446 [test "$enable_utils" = "yes"])
448 [COND_utils_gettext],
449 [test "$has_gettext" = "yes"])
451 #----------------------------------------
452 # Get the version to apply to the parser shared library
454 [KCONFIGPARSER_LIB_VERSION],
455 [m4_esyscmd_s([./scripts/version.sh --plain])])
457 #----------------------------------------
464 libs/lxdialog/Makefile
467 frontends/conf/Makefile
468 frontends/mconf/Makefile
469 frontends/nconf/Makefile
470 frontends/gconf/Makefile
471 frontends/qconf/Makefile
477 #----------------------------------------
478 # Pretty-print the configuration settings
480 AS_IF([test "$enable_conf" = "yes"], [fe_list="$fe_list conf" ])
481 AS_IF([test "$enable_gconf" = "yes"], [fe_list="$fe_list gconf"])
482 AS_IF([test "$enable_mconf" = "yes"], [fe_list="$fe_list mconf"])
483 AS_IF([test "$enable_nconf" = "yes"], [fe_list="$fe_list nconf"])
484 AS_IF([test "$enable_qconf" = "yes"], [fe_list="$fe_list qconf"])
488 [test "$enable_shared" = "yes"],
489 [lib_list="$lib_list shared (version: $KCONFIGPARSER_LIB_VERSION)"])
491 [test "$enable_static" = "yes"],
492 [lib_list="$lib_list${lib_list:+,} static"])
495 AC_MSG_NOTICE([Configured with:])
496 AC_MSG_NOTICE([- parser library :$lib_list])
497 AC_MSG_NOTICE([ - root-menu prompt : $root_menu])
498 AC_MSG_NOTICE([ - config prefix : $config_prefix])
499 AC_MSG_NOTICE([- frontends :$fe_list])
500 AC_MSG_NOTICE([ - transform name : $program_transform_name])
501 AC_MSG_NOTICE([ - localised : $has_gettext])
502 AC_MSG_NOTICE([- install utilities : $enable_utils])
503 AC_MSG_NOTICE([- CFLAGS CXXFLAGS : $wall_CFLAGS $werror_CFLAGS])