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-])
31 AM_INIT_AUTOMAKE([foreign])
34 [test "$(${srcdir}/scripts/version.sh --internal)" = "git"],
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 build with -Wall, unless the user asks not to
59 [build with -Wall (default=yes)])],
62 [yes], [wall_CFLAGS=-Wall],
63 [*], [wall_CFLAGS=""])])
64 AC_SUBST([wall_CFLAGS],[${wall_CFLAGS}])
66 # For releases, do not build with -Werror, unless the user explcitly
67 # requests to build with -Werror.
68 # For the devel tree, do build with -Werror by default, unless user
69 # explicitly disables -Werror
71 [test "$(${srcdir}/scripts/version.sh --internal)" = "git"],
72 [werror_CFLAGS=-Werror])
77 [build with -Werror (default=no)])],
80 [yes], [werror_CFLAGS=-Werror],
81 [*], [werror_CFLAGS=""])])
82 AC_SUBST([werror_CFLAGS],[${werror_CFLAGS}])
84 # Although there is a default (="linux") in the code, we do provide
85 # a default here, to get a consistent autostuff behavior
89 [--enable-root-menu-prompt=PROMPT],
90 [set the root-menu prompt (default=Configuration)])],
93 [yes], [root_menu=Configuration],
95 [# Escape the $ signs, otherwise they would get munged by make
96 root_menu="$( echo "$enableval" |sed -e 's/\$/\\$$/g;' )"])])
97 AC_SUBST([root_menu], [${root_menu=Configuration}])
102 [--enable-config-prefix=PREFIX],
103 [the prefix to the config option (default=CONFIG_)])],
106 [*" "*],[AC_MSG_ERROR([config prefix can not contain spaces: '$enableval'])],
107 [yes], [config_prefix=CONFIG_],
108 [no], [config_prefix=],
109 [config_prefix=$enableval])])
110 AC_SUBST([config_prefix], [${config_prefix-CONFIG_}])
116 [install utilities to manage .config files (default=yes)])])
117 AC_SUBST([enable_utils], [${enable_utils:-yes}])
123 [enable localisation (L10n) (default=auto)])])
124 AC_SUBST([enable_L10n], [${enable_L10n:-yes}])
126 #----------------------------------------
127 # Options to selectively enable/disable frontends
128 # All are selected by default
133 [conf, the stdin-based frontend (default=auto)])])
134 AC_SUBST([enable_conf], [${enable_conf:-auto}])
139 [mconf, the traditional ncurses-based frontend (default=auto)])])
140 AC_SUBST([enable_mconf], [${enable_mconf:-auto}])
145 [nconf, the modern ncurses-based frontend (default=auto)])])
146 AC_SUBST([enable_nconf], [${enable_nconf:-auto}])
151 [gconf, the GTK-based frontend (default=auto)])])
152 AC_SUBST([enable_gconf], [${enable_gconf:-auto}])
157 [qconf, the QT-based frontend (default=auto)])])
158 AC_SUBST([enable_qconf], [${enable_qconf:-auto}])
163 [--enable-frontends=list],
164 [enables only the set of frontends in comma-separated 'list'
165 (default: auto selection), takes precedence over all
166 --enable-*conf, above])],
167 [for f in conf mconf nconf gconf qconf; do
170 [yes], [eval enable_$f=yes],
171 ["$f"], [eval enable_$f=yes],
172 ["$f",*], [eval enable_$f=yes],
173 [*,"$f"], [eval enable_$f=yes],
174 [*,"$f",*], [eval enable_$f=yes],
177 AC_SUBST([enable_frontends])
179 #----------------------------------------
180 # What extra CFLAGS we will be using
181 AC_SUBST([kf_CFLAGS], ["$wall_CFLAGS $werror_CFLAGS"])
183 #----------------------------------------
184 # Dependencies that will be needed, depending on the frontends
186 ["$enable_mconf":"$enable_nconf"],
187 [*yes*], [need_curses=yes],
188 [*auto*], [need_curses=auto],
190 [need_panel_menu="$enable_nconf"]
192 ["$enable_gconf":"$enable_qconf"],
193 [*yes*], [need_pkgconfig=yes],
194 [*auto*], [need_pkgconfig=yes],
195 [need_pkgconfig=no ])
196 [need_gtk="$enable_gconf"]
197 [need_qt="$enable_qconf"]
199 #---------------------------------------------------------------------------
200 # Now check we have the required stuff
202 #----------------------------------------
203 # Some program checks
214 [AC_MSG_ERROR([can not find gperf])])
216 [test "$need_pkgconfig" = "yes"],
217 [PKG_PROG_PKG_CONFIG()])
219 AC_SUBST([AM_LFLAGS], ["-L -P zconf"])
221 AC_SUBST([AM_YFLAGS], ["-t -l -p zconf"])
223 #----------------------------------------
224 # Check for gettext, for the kconfig frontends
225 [has_gettext="$enable_L10n"]
227 [test "$has_gettext" = "yes"],
230 [ac_ct_gettext_hdr=$ac_header; break],
233 [test "$has_gettext" = "yes"],
237 [#include <$ac_ct_gettext_hdr>])])
239 [test "$has_gettext" = "yes"],
249 [test "$has_gettext" = "no"],
250 [intl_CPPFLAGS=-DKBUILD_NO_NLS])
251 AC_SUBST([intl_CPPFLAGS])
252 AC_SUBST([intl_LIBS])
254 #----------------------------------------
255 # Check for ncurses, for the mconf & nconf frontends
257 [test "$need_curses" = "yes" -o "$need_curses" = "auto"],
258 [AC_SUBST([ncurses_mconf_CPPFLAGS])
259 AC_SUBST([ncurses_LIBS])
263 [ncursesw/curses.h ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h],
264 [CURSES_LOC=$ac_header; ncurses_mconf_CPPFLAGS=-DCURSES_LOC=\\\"$ac_header\\\"; break])
266 [test -z "$CURSES_LOC"],
268 [test "$need_curses" = "yes"],
269 [AC_MSG_ERROR([could not find curses headers (frontends: mconf/nconf)])],
273 [ncursesw/*],[ncurses_mconf_CPPFLAGS="$ncurses_mconf_CPPFLAGS -DNCURSES_WIDECHAR=1"])
276 [ncursesw ncurses curses],
277 [ac_ct_curses_lib_found=yes; break])
279 [test -z "$ac_ct_curses_lib_found"],
281 [test "$need_curses" = "yes"],
282 [AC_MSG_ERROR([could not find curses library (frontends: mconf/nconf)])],
292 [test "$has_curses" = "no" ],
293 [enable_mconf=no; enable_nconf=no])
295 #----------------------------------------
296 # Check for libpanel and libmenu, for the nconf frontend
298 [test "$need_panel_menu" = "yes" -o "$need_panel_menu" = "auto"],
299 [AC_SUBST([ncurses_nconf_CPPFLAGS])
300 AC_SUBST([ncurses_panel_menu_LIBS])
303 [ncursesw/*],[ncurses_nconf_CPPFLAGS="-I/usr/include/ncursesw"],
304 [ncurses/*],[ncurses_nconf_CPPFLAGS="-I/usr/include/ncurses"])
310 [ac_ct_panel_lib_found=yes; break],,
313 [test -z "$ac_ct_panel_lib_found"],
315 [test "$need_panel_menu" = "yes"],
316 [AC_MSG_ERROR([could not find libpanel library (frontend: nconf)])],
317 [has_panel_menu=no])])
321 [ac_ct_menu_lib_found=yes; break],,
324 [test -z "$ac_ct_panel_lib_found"],
326 [test "$need_panel_menu" = "yes"],
327 [AC_MSG_ERROR([could not find libmenu library (frontend: nconf)])],
328 [has_panel_menu=no])])
329 ncurses_panel_menu_LIBS="$LIBS"
333 [test "$has_panel_menu" = "no" ],
336 #----------------------------------------
337 # Check headers and libs for gconf
339 [test "$need_gtk" = "yes" -o "$need_gtk" = "auto"],
342 [gtk+-2.0 gmodule-2.0 libglade-2.0],
345 [test "$need_gtk" = "yes"],
346 [AC_MSG_ERROR([could not find GTK+ headers and/or libraries (frontend: gconf)])],
350 [test "$has_gtk" = "no" ],
353 #----------------------------------------
354 # Check headers and libs for qconf
356 [test "$need_qt" = "yes" -o "$need_qt" = "auto"],
359 [QtCore QtGui Qt3Support],
360 [has_qt=yes; need_moc="$need_qt"],
362 [test "$need_qt" = "yes"],
363 [AC_MSG_ERROR([could not find QT4 headers and/or libraries (frontend: qconf)])],
364 [has_qt=no; need_moc=no])])])
366 AC_ARG_VAR([MOC], [Qt meta object compiler (moc) command])
368 [test "$need_moc" = "yes" -o "$need_moc" = "auto"],
369 [QT4_BINDIR=`$PKG_CONFIG Qt --variable bindir`
378 [test "$need_moc" = "yes"],
379 [AC_MSG_ERROR([could not find moc (frontend: qconf)])],
383 [test "$has_qt" = "no" -o "$has_moc" = "no"],
386 #----------------------------------------
387 # Per-frontends extra libraries
388 AC_ARG_VAR([conf_EXTRA_LIBS], [Extra libraries to build the conf frontend] )
389 AC_ARG_VAR([gconf_EXTRA_LIBS], [Extra libraries to build the gconf frontend])
390 AC_ARG_VAR([mconf_EXTRA_LIBS], [Extra libraries to build the mconf frontend])
391 AC_ARG_VAR([nconf_EXTRA_LIBS], [Extra libraries to build the nconf frontend])
392 AC_ARG_VAR([qconf_EXTRA_LIBS], [Extra libraries to build the qconf frontend])
394 #---------------------------------------------------------------------------
395 # Now, we know what frontends to enable
396 AS_IF([test "$enable_conf" = "auto"], [enable_conf=yes ])
397 AS_IF([test "$enable_gconf" = "auto"], [enable_gconf=yes])
398 AS_IF([test "$enable_mconf" = "auto"], [enable_mconf=yes])
399 AS_IF([test "$enable_nconf" = "auto"], [enable_nconf=yes])
400 AS_IF([test "$enable_qconf" = "auto"], [enable_qconf=yes])
402 #----------------------------------------
403 # Check if the lxdialog library should be built
405 [test "$enable_mconf" = "yes"],
409 #----------------------------------------
410 # Check if the images library should be built
412 [test "$enable_gconf" = "yes" -o "$enable_qconf" = "yes"],
416 #----------------------------------------
417 # Setup automake conditional build
420 [test "$enable_conf" = "yes"])
423 [test "$enable_mconf" = "yes"])
426 [test "$enable_nconf" = "yes"])
429 [test "$enable_gconf" = "yes"])
432 [test "$enable_qconf" = "yes"])
435 [test "$need_lxdialog" = "yes"])
438 [test "$need_images" = "yes"])
441 [test "$enable_utils" = "yes"])
443 [COND_utils_gettext],
444 [test "$has_gettext" = "yes"])
446 #----------------------------------------
447 # Get the version to apply to the parser shared library
449 [KCONFIGPARSER_LIB_VERSION],
450 [m4_esyscmd_s([./scripts/version.sh --plain])])
452 #----------------------------------------
459 libs/lxdialog/Makefile
462 frontends/conf/Makefile
463 frontends/mconf/Makefile
464 frontends/nconf/Makefile
465 frontends/gconf/Makefile
466 frontends/qconf/Makefile
472 #----------------------------------------
473 # Pretty-print the configuration settings
475 AS_IF([test "$enable_conf" = "yes"], [fe_list="$fe_list conf" ])
476 AS_IF([test "$enable_gconf" = "yes"], [fe_list="$fe_list gconf"])
477 AS_IF([test "$enable_mconf" = "yes"], [fe_list="$fe_list mconf"])
478 AS_IF([test "$enable_nconf" = "yes"], [fe_list="$fe_list nconf"])
479 AS_IF([test "$enable_qconf" = "yes"], [fe_list="$fe_list qconf"])
483 [test "$enable_shared" = "yes"],
484 [lib_list="$lib_list shared (version: $KCONFIGPARSER_LIB_VERSION)"])
486 [test "$enable_static" = "yes"],
487 [lib_list="$lib_list${lib_list:+,} static"])
490 AC_MSG_NOTICE([Configured with:])
491 AC_MSG_NOTICE([- parser library :$lib_list])
492 AC_MSG_NOTICE([ - root-menu prompt : $root_menu])
493 AC_MSG_NOTICE([ - config prefix : $config_prefix])
494 AC_MSG_NOTICE([- frontends :$fe_list])
495 AC_MSG_NOTICE([ - transform name : $program_transform_name])
496 AC_MSG_NOTICE([ - localised : $has_gettext])
497 AC_MSG_NOTICE([- install utilities : $enable_utils])
498 AC_MSG_NOTICE([- CFLAGS CXXFLAGS : $wall_CFLAGS $werror_CFLAGS])