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)" = "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 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)" = "hg"],
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 # Also, append a space at the end, to separate the package
97 # name from the literal 'Configuration'
98 root_menu="$( echo "$enableval" |sed -r -e 's/\$/\\$$/g;' )"])])
99 AC_SUBST([root_menu], [${root_menu=Configuration}])
104 [--enable-config-prefix=PREFIX],
105 [the prefix to the config option (default=CONFIG_)])],
108 [*" "*],[AC_MSG_ERROR([config prefix can not contain spaces: '$enableval'])],
109 [yes], [config_prefix=CONFIG_],
110 [no], [config_prefix=],
111 [config_prefix=$enableval])])
112 AC_SUBST([config_prefix], [${config_prefix-CONFIG_}])
118 [install utilities to manage .config files (default=yes)])])
119 AC_SUBST([enable_utils], [${enable_utils:-yes}])
125 [enable localisation (L10n) (default=auto)])])
126 AC_SUBST([enable_L10n], [${enable_L10n:-yes}])
128 #----------------------------------------
129 # Options to selectively enable/disable frontends
130 # All are selected by default
135 [conf, the stdin-based frontend (default=auto)])])
136 AC_SUBST([enable_conf], [${enable_conf:-auto}])
141 [mconf, the traditional ncurses-based frontend (default=auto)])])
142 AC_SUBST([enable_mconf], [${enable_mconf:-auto}])
147 [nconf, the modern ncurses-based frontend (default=auto)])])
148 AC_SUBST([enable_nconf], [${enable_nconf:-auto}])
153 [gconf, the GTK-based frontend (default=auto)])])
154 AC_SUBST([enable_gconf], [${enable_gconf:-auto}])
159 [qconf, the QT-based frontend (default=auto)])])
160 AC_SUBST([enable_qconf], [${enable_qconf:-auto}])
165 [--enable-frontends=list],
166 [enables only the set of frontends in comma-separated 'list'
167 (default: auto selection), takes precedence over all
168 --enable-*conf, above])],
169 [for f in conf mconf nconf gconf qconf; do
172 [yes], [eval enable_$f=yes],
173 ["$f"], [eval enable_$f=yes],
174 ["$f",*], [eval enable_$f=yes],
175 [*,"$f"], [eval enable_$f=yes],
176 [*,"$f",*], [eval enable_$f=yes],
179 AC_SUBST([enable_frontends])
181 #----------------------------------------
182 # What extra CFLAGS we will be using
183 AC_SUBST([kf_CFLAGS], ["$wall_CFLAGS $werror_CFLAGS"])
185 #----------------------------------------
186 # Dependencies that will be needed, depending on the frontends
188 ["$enable_mconf":"$enable_nconf"],
189 [*yes*], [need_curses=yes],
190 [*auto*], [need_curses=auto],
192 [need_panel_menu="$enable_nconf"]
194 ["$enable_gconf":"$enable_qconf"],
195 [*yes*], [need_pkgconfig=yes],
196 [*auto*], [need_pkgconfig=yes],
197 [need_pkgconfig=no ])
198 [need_gtk="$enable_gconf"]
199 [need_qt="$enable_qconf"]
201 #---------------------------------------------------------------------------
202 # Now check we have the required stuff
204 #----------------------------------------
205 # Some program checks
216 [AC_MSG_ERROR([can not find gperf])])
218 [test "$need_pkgconfig" = "yes"],
219 [PKG_PROG_PKG_CONFIG()])
221 AC_SUBST([AM_LFLAGS], ["-L -P zconf"])
223 AC_SUBST([AM_YFLAGS], ["-t -l -p zconf"])
225 #----------------------------------------
226 # Check for gettext, for the kconfig frontends
227 [has_gettext="$enable_L10n"]
229 [test "$has_gettext" = "yes"],
232 [ac_ct_gettext_hdr=$ac_header; break],
235 [test "$has_gettext" = "yes"],
239 [#include <$ac_ct_gettext_hdr>])])
241 [test "$has_gettext" = "yes"],
251 [test "$has_gettext" = "no"],
252 [intl_CPPFLAGS=-DKBUILD_NO_NLS])
253 AC_SUBST([intl_CPPFLAGS])
254 AC_SUBST([intl_LIBS])
256 #----------------------------------------
257 # Check for ncurses, for the mconf & nconf frontends
259 [test "$need_curses" = "yes" -o "$need_curses" = "auto"],
260 [AC_SUBST([ncurses_mconf_CPPFLAGS])
261 AC_SUBST([ncurses_LIBS])
265 [ncursesw/curses.h ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h],
266 [CURSES_LOC=$ac_header; ncurses_mconf_CPPFLAGS=-DCURSES_LOC=\\\"$ac_header\\\"; break])
268 [test -z "$CURSES_LOC"],
270 [test "$need_curses" = "yes"],
271 [AC_MSG_ERROR([could not find curses headers (frontends: mconf/nconf)])],
275 [ncursesw/*],[ncurses_mconf_CPPFLAGS="$ncurses_mconf_CPPFLAGS -DNCURSES_WIDECHAR=1"])
278 [ncursesw ncurses curses],
279 [ac_ct_curses_lib_found=yes; break])
281 [test -z "$ac_ct_curses_lib_found"],
283 [test "$need_curses" = "yes"],
284 [AC_MSG_ERROR([could not find curses library (frontends: mconf/nconf)])],
290 [test "$has_curses" = "no" ],
291 [enable_mconf=no; enable_nconf=no])
293 #----------------------------------------
294 # Check for libpanel and libmenu, for the nconf frontend
296 [test "$need_panel_menu" = "yes" -o "$need_panel_menu" = "auto"],
297 [AC_SUBST([ncurses_nconf_CPPFLAGS])
298 AC_SUBST([ncurses_panel_menu_LIBS])
301 [ncursesw/*],[ncurses_nconf_CPPFLAGS="-I/usr/include/ncursesw"],
302 [ncurses/*],[ncurses_nconf_CPPFLAGS="-I/usr/include/ncurses"])
308 [ac_ct_panel_lib_found=yes; break],,
311 [test -z "$ac_ct_panel_lib_found"],
313 [test "$need_panel_menu" = "yes"],
314 [AC_MSG_ERROR([could not find libpanel library (frontend: nconf)])],
315 [has_panel_menu=no])])
319 [ac_ct_menu_lib_found=yes; break],,
322 [test -z "$ac_ct_panel_lib_found"],
324 [test "$need_panel_menu" = "yes"],
325 [AC_MSG_ERROR([could not find libmenu library (frontend: nconf)])],
326 [has_panel_menu=no])])
327 ncurses_panel_menu_LIBS="$LIBS"
331 [test "$has_panel_menu" = "no" ],
334 #----------------------------------------
335 # Check headers and libs for gconf
337 [test "$need_gtk" = "yes" -o "$need_gtk" = "auto"],
340 [gtk+-2.0 gmodule-2.0 libglade-2.0],
343 [test "$need_gtk" = "yes"],
344 [AC_MSG_ERROR([could not find GTK+ headers and/or libraries (frontend: gconf)])],
348 [test "$has_gtk" = "no" ],
351 #----------------------------------------
352 # Check headers and libs for qconf
354 [test "$need_qt" = "yes" -o "$need_qt" = "auto"],
357 [QtCore QtGui Qt3Support],
358 [has_qt=yes; need_moc="$need_qt"],
360 [test "$need_qt" = "yes"],
361 [AC_MSG_ERROR([could not find QT4 headers and/or libraries (frontend: qconf)])],
362 [has_qt=no; need_moc=no])])])
364 AC_ARG_VAR([MOC], [Qt meta object compiler (moc) command])
366 [test "$need_moc" = "yes" -o "$need_moc" = "auto"],
367 [QT4_BINDIR=`$PKG_CONFIG Qt --variable bindir`
376 [test "$need_moc" = "yes"],
377 [AC_MSG_ERROR([could not find moc (frontend: qconf)])],
381 [test "$has_qt" = "no" -o "$has_moc" = "no"],
384 #----------------------------------------
385 # Per-frontends extra libraries
386 AC_ARG_VAR([conf_EXTRA_LIBS], [Extra libraries to build the conf frontend] )
387 AC_ARG_VAR([gconf_EXTRA_LIBS], [Extra libraries to build the gconf frontend])
388 AC_ARG_VAR([mconf_EXTRA_LIBS], [Extra libraries to build the mconf frontend])
389 AC_ARG_VAR([nconf_EXTRA_LIBS], [Extra libraries to build the nconf frontend])
390 AC_ARG_VAR([qconf_EXTRA_LIBS], [Extra libraries to build the qconf frontend])
392 #---------------------------------------------------------------------------
393 # Now, we know what frontends to enable
394 AS_IF([test "$enable_conf" = "auto"], [enable_conf=yes ])
395 AS_IF([test "$enable_gconf" = "auto"], [enable_gconf=yes])
396 AS_IF([test "$enable_mconf" = "auto"], [enable_mconf=yes])
397 AS_IF([test "$enable_nconf" = "auto"], [enable_nconf=yes])
398 AS_IF([test "$enable_qconf" = "auto"], [enable_qconf=yes])
400 #----------------------------------------
401 # Check if the lxdialog library should be built
403 [test "$enable_mconf" = "yes"],
407 #----------------------------------------
408 # Check if the images library should be built
410 [test "$enable_gconf" = "yes" -o "$enable_qconf" = "yes"],
414 #----------------------------------------
415 # Setup automake conditional build
418 [test "$enable_conf" = "yes"])
421 [test "$enable_mconf" = "yes"])
424 [test "$enable_nconf" = "yes"])
427 [test "$enable_gconf" = "yes"])
430 [test "$enable_qconf" = "yes"])
433 [test "$need_lxdialog" = "yes"])
436 [test "$need_images" = "yes"])
439 [test "$enable_utils" = "yes"])
441 [COND_utils_gettext],
442 [test "$has_gettext" = "yes"])
444 #----------------------------------------
445 # Get the version to apply to the parser shared library
447 [KCONFIGPARSER_LIB_VERSION],
448 [m4_esyscmd_s([./scripts/version.sh --plain])])
450 #----------------------------------------
457 libs/lxdialog/Makefile
460 frontends/conf/Makefile
461 frontends/mconf/Makefile
462 frontends/nconf/Makefile
463 frontends/gconf/Makefile
464 frontends/qconf/Makefile
470 #----------------------------------------
471 # Pretty-print the configuration settings
473 AS_IF([test "$enable_conf" = "yes"], [fe_list="$fe_list conf" ])
474 AS_IF([test "$enable_gconf" = "yes"], [fe_list="$fe_list gconf"])
475 AS_IF([test "$enable_mconf" = "yes"], [fe_list="$fe_list mconf"])
476 AS_IF([test "$enable_nconf" = "yes"], [fe_list="$fe_list nconf"])
477 AS_IF([test "$enable_qconf" = "yes"], [fe_list="$fe_list qconf"])
481 [test "$enable_shared" = "yes"],
482 [lib_list="$lib_list shared (version: $KCONFIGPARSER_LIB_VERSION)"])
484 [test "$enable_static" = "yes"],
485 [lib_list="$lib_list${lib_list:+,} static"])
488 AC_MSG_NOTICE([Configured with:])
489 AC_MSG_NOTICE([- parser library :$lib_list])
490 AC_MSG_NOTICE([ - root-menu prompt : $root_menu])
491 AC_MSG_NOTICE([ - config prefix : $config_prefix])
492 AC_MSG_NOTICE([- frontends :$fe_list])
493 AC_MSG_NOTICE([ - transform name : $program_transform_name])
494 AC_MSG_NOTICE([ - localised : $has_gettext])
495 AC_MSG_NOTICE([- install utilities : $enable_utils])
496 AC_MSG_NOTICE([- CFLAGS CXXFLAGS : $wall_CFLAGS $werror_CFLAGS])