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 #----------------------------------------
47 LT_INIT([disable-static])
49 #---------------------------------------------------------------------------
52 # By default, do not build with -Wall, unless the user asks for it
57 [build with -Wall (default=no)])],
60 [yes], [wall_CFLAGS=-Wall],
61 [*], [wall_CFLAGS=""])])
62 AC_SUBST([wall_CFLAGS],[${wall_CFLAGS}])
64 # By default, do not build with -Werror, unless the user asks for it
69 [build with -Werror (default=no)])],
72 [yes], [werror_CFLAGS=-Werror],
73 [*], [werror_CFLAGS=""])])
74 AC_SUBST([werror_CFLAGS],[${werror_CFLAGS}])
76 # Although there is a default (="linux") in the code, we do provide
77 # a default here, to get a consistent autostuff behavior
81 [--enable-root-menu-prompt=PROMPT],
82 [set the root-menu prompt (default=Configuration)])],
85 [yes], [root_menu=Configuration],
87 [# Escape the $ signs, otherwise they would get munged by make
88 # Also, append a space at the end, to separate the package
89 # name from the literal 'Configuration'
90 root_menu="$( echo "$enableval" |sed -r -e 's/\$/\\$$/g;' )"])])
91 AC_SUBST([root_menu], [${root_menu=Configuration}])
96 [--enable-config-prefix=PREFIX],
97 [the prefix to the config option (default=CONFIG_)])],
100 [*" "*],[AC_MSG_ERROR([config prefix can not contain spaces: '$enableval'])],
101 [yes], [config_prefix=CONFIG_],
102 [no], [config_prefix=],
103 [config_prefix=$enableval])])
104 AC_SUBST([config_prefix], [${config_prefix-CONFIG_}])
110 [install utilities to manage .config files (default=no)])])
111 AC_SUBST([enable_utils], [${enable_utils:-yes}])
117 [enable localisation (L10n) (default=auto)])])
118 AC_SUBST([enable_L10n], [${enable_L10n:-yes}])
120 #----------------------------------------
121 # Options to selectively enable/disable frontends
122 # All are selected by default
127 [conf, the stdin-based frontend (default=auto)])])
128 AC_SUBST([enable_conf], [${enable_conf:-auto}])
133 [mconf, the traditional ncurses-based frontend (default=auto)])])
134 AC_SUBST([enable_mconf], [${enable_mconf:-auto}])
139 [nconf, the modern ncurses-based frontend (default=auto)])])
140 AC_SUBST([enable_nconf], [${enable_nconf:-auto}])
145 [gconf, the GTK-based frontend (default=auto)])])
146 AC_SUBST([enable_gconf], [${enable_gconf:-auto}])
151 [qconf, the QT-based frontend (default=auto)])])
152 AC_SUBST([enable_qconf], [${enable_qconf:-auto}])
157 [--enable-frontends=list],
158 [enables only the set of frontends in comma-separated 'list'
159 (default: auto selection), takes precedence over all
160 --enable-*conf, above])],
161 [for f in conf mconf nconf gconf qconf; do
164 [yes], [eval enable_$f=yes],
165 ["$f"], [eval enable_$f=yes],
166 ["$f",*], [eval enable_$f=yes],
167 [*,"$f"], [eval enable_$f=yes],
168 [*,"$f",*], [eval enable_$f=yes],
171 AC_SUBST([enable_frontends])
173 #----------------------------------------
174 # What extra CFLAGS we will be using
175 AC_SUBST([kf_CFLAGS], ["$wall_CFLAGS $werror_CFLAGS"])
177 #----------------------------------------
178 # Dependencies that will be needed, depending on the frontends
180 ["$enable_mconf":"$enable_nconf"],
181 [*yes*], [need_curses=yes],
182 [*auto*], [need_curses=auto],
184 [need_panel_menu="$enable_nconf"]
186 ["$enable_gconf":"$enable_qconf"],
187 [*yes*], [need_pkgconfig=yes],
188 [*auto*], [need_pkgconfig=yes],
189 [need_pkgconfig=no ])
190 [need_gtk="$enable_gconf"]
191 [need_qt="$enable_qconf"]
193 #---------------------------------------------------------------------------
194 # Now check we have the required stuff
196 #----------------------------------------
197 # Some program checks
208 [AC_MSG_ERROR([can not find gperf])])
210 [test "$need_pkgconfig" = "yes"],
211 [PKG_PROG_PKG_CONFIG()])
213 AC_SUBST([AM_LFLAGS], ["-L -P zconf"])
215 AC_SUBST([AM_YFLAGS], ["-t -l -p zconf"])
217 #----------------------------------------
218 # Check for standard headers
221 AC_CHECK_HEADERS([ fcntl.h limits.h locale.h ])
222 AC_CHECK_HEADERS([ stdlib.h string.h sys/time.h unistd.h ])
225 #----------------------------------------
226 # Checks for library functions.
230 AC_CHECK_FUNCS([ bzero memmove memset ])
231 AC_CHECK_FUNCS([ strcasecmp strchr strcspn strdup strncasecmp strpbrk strrchr strspn strtol ])
232 AC_CHECK_FUNCS([ gettimeofday mkdir regcomp setlocale uname ])
234 #----------------------------------------
235 # Check for gettext, for the kconfig frontends
236 [has_gettext="$enable_L10n"]
238 [test "$has_gettext" = "yes"],
241 [ac_ct_gettext_hdr=$ac_header; break],
244 [test "$has_gettext" = "yes"],
248 [#include <$ac_ct_gettext_hdr>])])
250 [test "$has_gettext" = "yes"],
260 [test "$has_gettext" = "no"],
261 [intl_CPPFLAGS=-DKBUILD_NO_NLS])
262 AC_SUBST([intl_CPPFLAGS])
263 AC_SUBST([intl_LIBS])
265 #----------------------------------------
266 # Check for ncurses, for the mconf & nconf frontends
268 [test "$need_curses" = "yes" -o "$need_curses" = "auto"],
269 [AC_SUBST([CURSES_LOC])
270 AC_SUBST([ncurses_LIBS])
274 [ncursesw/curses.h ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h],
275 [CURSES_LOC=$ac_header; break])
277 [test -z "$CURSES_LOC"],
279 [test "$need_curses" = "yes"],
280 [AC_MSG_ERROR([could not find curses headers (frontends: mconf/nconf)])],
284 [ncursesw ncurses curses],
285 [ac_ct_curses_lib_found=yes; break])
287 [test -z "$ac_ct_curses_lib_found"],
289 [test "$need_curses" = "yes"],
290 [AC_MSG_ERROR([could not find curses library (frontends: mconf/nconf)])],
296 [test "$has_curses" = "no" ],
297 [enable_mconf=no; enable_nconf=no])
299 #----------------------------------------
300 # Check for libpanel and libmenu, for the nconf frontend
302 [test "$need_panel_menu" = "yes" -o "$need_panel_menu" = "auto"],
303 [AC_SUBST([ncurses_extra_LIBS])
304 AC_SUBST([ncurses_extra_CPPFLAGS])
307 [ncursesw/*],[ncurses_extra_CPPFLAGS="-I/usr/include/ncursesw"],
308 [ncurses/*],[ncurses_extra_CPPFLAGS="-I/usr/include/ncurses"])
314 [ac_ct_panel_lib_found=yes; break],,
317 [test -z "$ac_ct_panel_lib_found"],
319 [test "$need_panel_menu" = "yes"],
320 [AC_MSG_ERROR([could not find libpanel library (frontend: nconf)])],
321 [has_panel_menu=no])])
325 [ac_ct_menu_lib_found=yes; break],,
328 [test -z "$ac_ct_panel_lib_found"],
330 [test "$need_panel_menu" = "yes"],
331 [AC_MSG_ERROR([could not find libmenu library (frontend: nconf)])],
332 [has_panel_menu=no])])
333 ncurses_extra_LIBS="$LIBS"
337 [test "$has_panel_menu" = "no" ],
340 #----------------------------------------
341 # Check headers and libs for gconf
343 [test "$need_gtk" = "yes" -o "$need_gtk" = "auto"],
346 [gtk+-2.0 gmodule-2.0 libglade-2.0],
349 [test "$need_gtk" = "yes"],
350 [AC_MSG_ERROR([could not find GTK+ headers and/or libraries (frontend: gconf)])],
354 [test "$has_gtk" = "no" ],
357 #----------------------------------------
358 # Check headers and libs for qconf
360 [test "$need_qt" = "yes" -o "$need_qt" = "auto"],
363 [QtCore QtGui Qt3Support],
364 [has_qt=yes; need_moc="$need_qt"],
366 [test "$need_qt" = "yes"],
367 [AC_MSG_ERROR([could not find QT4 headers and/or libraries (frontend: qconf)])],
368 [has_qt=no; need_moc=no])])])
370 AC_ARG_VAR([MOC], [Qt meta object compiler (moc) command])
372 [test "$need_moc" = "yes" -o "$need_moc" = "auto"],
373 [QT4_BINDIR=`$PKG_CONFIG Qt --variable bindir`
382 [test "$need_moc" = "yes"],
383 [AC_MSG_ERROR([could not find moc (frontend: qconf)])],
387 [test "$has_qt" = "no" -o "$has_moc" = "no"],
390 #----------------------------------------
391 # Per-frontends extra libraries
392 AC_ARG_VAR([conf_EXTRA_LIBS], [Extra libraries to build the conf frontend] )
393 AC_ARG_VAR([gconf_EXTRA_LIBS], [Extra libraries to build the gconf frontend])
394 AC_ARG_VAR([mconf_EXTRA_LIBS], [Extra libraries to build the mconf frontend])
395 AC_ARG_VAR([nconf_EXTRA_LIBS], [Extra libraries to build the nconf frontend])
396 AC_ARG_VAR([qconf_EXTRA_LIBS], [Extra libraries to build the qconf frontend])
398 #---------------------------------------------------------------------------
399 # Now, we know what frontends to enable
400 AS_IF([test "$enable_conf" = "auto"], [enable_conf=yes ])
401 AS_IF([test "$enable_gconf" = "auto"], [enable_gconf=yes])
402 AS_IF([test "$enable_mconf" = "auto"], [enable_mconf=yes])
403 AS_IF([test "$enable_nconf" = "auto"], [enable_nconf=yes])
404 AS_IF([test "$enable_qconf" = "auto"], [enable_qconf=yes])
406 #----------------------------------------
407 # Check if the lxdialog library should be built
409 [test "$enable_mconf" = "yes"],
413 #----------------------------------------
414 # Check if the images library should be built
416 [test "$enable_gconf" = "yes" -o "$enable_qconf" = "yes"],
420 #----------------------------------------
421 # Setup automake conditional build
424 [test "$enable_conf" = "yes"])
427 [test "$enable_mconf" = "yes"])
430 [test "$enable_nconf" = "yes"])
433 [test "$enable_gconf" = "yes"])
436 [test "$enable_qconf" = "yes"])
439 [test "$need_lxdialog" = "yes"])
442 [test "$need_images" = "yes"])
445 [test "$enable_utils" = "yes"])
447 [COND_utils_gettext],
448 [test "$has_gettext" = "yes"])
450 #----------------------------------------
451 # Get the version to apply to the parser shared library
453 [KCONFIGPARSER_LIB_VERSION],
454 [m4_esyscmd_s([./scripts/version.sh --plain])])
456 #----------------------------------------
463 libs/lxdialog/Makefile
466 frontends/conf/Makefile
467 frontends/mconf/Makefile
468 frontends/nconf/Makefile
469 frontends/gconf/Makefile
470 frontends/qconf/Makefile
476 #----------------------------------------
477 # Pretty-print the configuration settings
479 AS_IF([test "$enable_conf" = "yes"], [fe_list="$fe_list conf" ])
480 AS_IF([test "$enable_gconf" = "yes"], [fe_list="$fe_list gconf"])
481 AS_IF([test "$enable_mconf" = "yes"], [fe_list="$fe_list mconf"])
482 AS_IF([test "$enable_nconf" = "yes"], [fe_list="$fe_list nconf"])
483 AS_IF([test "$enable_qconf" = "yes"], [fe_list="$fe_list qconf"])
487 [test "$enable_shared" = "yes"],
488 [lib_list="$lib_list shared (version: $KCONFIGPARSER_LIB_VERSION)"])
490 [test "$enable_static" = "yes"],
491 [lib_list="$lib_list${lib_list:+,} static"])
494 AC_MSG_NOTICE([Configured with:])
495 AC_MSG_NOTICE([- parser library :$lib_list])
496 AC_MSG_NOTICE([ - root-menu prompt : $root_menu])
497 AC_MSG_NOTICE([ - config prefix : $config_prefix])
498 AC_MSG_NOTICE([- frontends :$fe_list])
499 AC_MSG_NOTICE([ - transform name : $program_transform_name])
500 AC_MSG_NOTICE([ - localised : $has_gettext])
501 AC_MSG_NOTICE([- install utilities : $enable_utils])
502 AC_MSG_NOTICE([- CFLAGS CXXFLAGS : $wall_CFLAGS $werror_CFLAGS])