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 headers and macros for circle queues
239 [AC_MSG_CHECKING([for CIRCLEQ_XXX macros in sys/queue.h])
242 [[#include <sys/queue.h>
247 [AC_MSG_RESULT([yes])],
249 AC_MSG_ERROR([CIRCLEQ_XXX macros not defined in sys/queue.h (parser)])])],
250 [AC_MSG_ERROR([could not find sys/queue.h header (parser)])])
252 #----------------------------------------
253 # Check for gettext, for the kconfig frontends
254 [has_gettext="$enable_L10n"]
256 [test "$has_gettext" = "yes"],
259 [ac_ct_gettext_hdr=$ac_header; break],
262 [test "$has_gettext" = "yes"],
266 [#include <$ac_ct_gettext_hdr>])])
268 [test "$has_gettext" = "yes"],
278 [test "$has_gettext" = "no"],
279 [intl_CPPFLAGS=-DKBUILD_NO_NLS])
280 AC_SUBST([intl_CPPFLAGS])
281 AC_SUBST([intl_LIBS])
283 #----------------------------------------
284 # Check for ncurses, for the mconf & nconf frontends
286 [test "$need_curses" = "yes" -o "$need_curses" = "auto"],
287 [AC_SUBST([CURSES_LOC])
288 AC_SUBST([ncurses_LIBS])
292 [ncursesw/curses.h ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h],
293 [CURSES_LOC=$ac_header; break])
295 [test -z "$CURSES_LOC"],
297 [test "$need_curses" = "yes"],
298 [AC_MSG_ERROR([could not find curses headers (frontends: mconf/nconf)])],
302 [ncursesw ncurses curses],
303 [ac_ct_curses_lib_found=yes; break])
305 [test -z "$ac_ct_curses_lib_found"],
307 [test "$need_curses" = "yes"],
308 [AC_MSG_ERROR([could not find curses library (frontends: mconf/nconf)])],
314 [test "$has_curses" = "no" ],
315 [enable_mconf=no; enable_nconf=no])
317 #----------------------------------------
318 # Check for libpanel and libmenu, for the nconf frontend
320 [test "$need_panel_menu" = "yes" -o "$need_panel_menu" = "auto"],
321 [AC_SUBST([ncurses_extra_LIBS])
322 AC_SUBST([ncurses_extra_CPPFLAGS])
325 [ncursesw/*],[ncurses_extra_CPPFLAGS="-I/usr/include/ncursesw"],
326 [ncurses/*],[ncurses_extra_CPPFLAGS="-I/usr/include/ncurses"])
332 [ac_ct_panel_lib_found=yes; break],,
335 [test -z "$ac_ct_panel_lib_found"],
337 [test "$need_panel_menu" = "yes"],
338 [AC_MSG_ERROR([could not find libpanel library (frontend: nconf)])],
339 [has_panel_menu=no])])
343 [ac_ct_menu_lib_found=yes; break],,
346 [test -z "$ac_ct_panel_lib_found"],
348 [test "$need_panel_menu" = "yes"],
349 [AC_MSG_ERROR([could not find libmenu library (frontend: nconf)])],
350 [has_panel_menu=no])])
351 ncurses_extra_LIBS="$LIBS"
355 [test "$has_panel_menu" = "no" ],
358 #----------------------------------------
359 # Check headers and libs for gconf
361 [test "$need_gtk" = "yes" -o "$need_gtk" = "auto"],
364 [gtk+-2.0 gmodule-2.0 libglade-2.0],
367 [test "$need_gtk" = "yes"],
368 [AC_MSG_ERROR([could not find GTK+ headers and/or libraries (frontend: gconf)])],
372 [test "$has_gtk" = "no" ],
375 #----------------------------------------
376 # Check headers and libs for qconf
378 [test "$need_qt" = "yes" -o "$need_qt" = "auto"],
381 [QtCore QtGui Qt3Support],
382 [has_qt=yes; need_moc="$need_qt"],
384 [test "$need_qt" = "yes"],
385 [AC_MSG_ERROR([could not find QT4 headers and/or libraries (frontend: qconf)])],
386 [has_qt=no; need_moc=no])])])
388 AC_ARG_VAR([MOC], [Qt meta object compiler (moc) command])
390 [test "$need_moc" = "yes" -o "$need_moc" = "auto"],
391 [QT4_BINDIR=`$PKG_CONFIG Qt --variable bindir`
400 [test "$need_moc" = "yes"],
401 [AC_MSG_ERROR([could not find moc (frontend: qconf)])],
405 [test "$has_qt" = "no" -o "$has_moc" = "no"],
408 #----------------------------------------
409 # Per-frontends extra libraries
410 AC_ARG_VAR([conf_EXTRA_LIBS], [Extra libraries to build the conf frontend] )
411 AC_ARG_VAR([gconf_EXTRA_LIBS], [Extra libraries to build the gconf frontend])
412 AC_ARG_VAR([mconf_EXTRA_LIBS], [Extra libraries to build the mconf frontend])
413 AC_ARG_VAR([nconf_EXTRA_LIBS], [Extra libraries to build the nconf frontend])
414 AC_ARG_VAR([qconf_EXTRA_LIBS], [Extra libraries to build the qconf frontend])
416 #---------------------------------------------------------------------------
417 # Now, we know what frontends to enable
418 AS_IF([test "$enable_conf" = "auto"], [enable_conf=yes ])
419 AS_IF([test "$enable_gconf" = "auto"], [enable_gconf=yes])
420 AS_IF([test "$enable_mconf" = "auto"], [enable_mconf=yes])
421 AS_IF([test "$enable_nconf" = "auto"], [enable_nconf=yes])
422 AS_IF([test "$enable_qconf" = "auto"], [enable_qconf=yes])
424 #----------------------------------------
425 # Check if the lxdialog library should be built
427 [test "$enable_mconf" = "yes"],
431 #----------------------------------------
432 # Check if the images library should be built
434 [test "$enable_gconf" = "yes" -o "$enable_qconf" = "yes"],
438 #----------------------------------------
439 # Setup automake conditional build
442 [test "$enable_conf" = "yes"])
445 [test "$enable_mconf" = "yes"])
448 [test "$enable_nconf" = "yes"])
451 [test "$enable_gconf" = "yes"])
454 [test "$enable_qconf" = "yes"])
457 [test "$need_lxdialog" = "yes"])
460 [test "$need_images" = "yes"])
463 [test "$enable_utils" = "yes"])
465 [COND_utils_gettext],
466 [test "$has_gettext" = "yes"])
468 #----------------------------------------
469 # Get the version to apply to the parser shared library
471 [KCONFIGPARSER_LIB_VERSION],
472 [m4_esyscmd_s([./scripts/version.sh --plain])])
474 #----------------------------------------
481 libs/lxdialog/Makefile
484 frontends/conf/Makefile
485 frontends/mconf/Makefile
486 frontends/nconf/Makefile
487 frontends/gconf/Makefile
488 frontends/qconf/Makefile
494 #----------------------------------------
495 # Pretty-print the configuration settings
497 AS_IF([test "$enable_conf" = "yes"], [fe_list="$fe_list conf" ])
498 AS_IF([test "$enable_gconf" = "yes"], [fe_list="$fe_list gconf"])
499 AS_IF([test "$enable_mconf" = "yes"], [fe_list="$fe_list mconf"])
500 AS_IF([test "$enable_nconf" = "yes"], [fe_list="$fe_list nconf"])
501 AS_IF([test "$enable_qconf" = "yes"], [fe_list="$fe_list qconf"])
505 [test "$enable_shared" = "yes"],
506 [lib_list="$lib_list shared (version: $KCONFIGPARSER_LIB_VERSION)"])
508 [test "$enable_static" = "yes"],
509 [lib_list="$lib_list${lib_list:+,} static"])
512 AC_MSG_NOTICE([Configured with:])
513 AC_MSG_NOTICE([- parser library :$lib_list])
514 AC_MSG_NOTICE([ - root-menu prompt : $root_menu])
515 AC_MSG_NOTICE([ - config prefix : $config_prefix])
516 AC_MSG_NOTICE([- frontends :$fe_list])
517 AC_MSG_NOTICE([ - transform name : $program_transform_name])
518 AC_MSG_NOTICE([ - localised : $has_gettext])
519 AC_MSG_NOTICE([- install utilities : $enable_utils])
520 AC_MSG_NOTICE([- CFLAGS CXXFLAGS : $wall_CFLAGS $werror_CFLAGS])