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)])],
294 [test "$has_curses" = "no" ],
295 [enable_mconf=no; enable_nconf=no])
297 #----------------------------------------
298 # Check for libpanel and libmenu, for the nconf frontend
300 [test "$need_panel_menu" = "yes" -o "$need_panel_menu" = "auto"],
301 [AC_SUBST([ncurses_nconf_CPPFLAGS])
302 AC_SUBST([ncurses_panel_menu_LIBS])
305 [ncursesw/*],[ncurses_nconf_CPPFLAGS="-I/usr/include/ncursesw"],
306 [ncurses/*],[ncurses_nconf_CPPFLAGS="-I/usr/include/ncurses"])
312 [ac_ct_panel_lib_found=yes; break],,
315 [test -z "$ac_ct_panel_lib_found"],
317 [test "$need_panel_menu" = "yes"],
318 [AC_MSG_ERROR([could not find libpanel library (frontend: nconf)])],
319 [has_panel_menu=no])])
323 [ac_ct_menu_lib_found=yes; break],,
326 [test -z "$ac_ct_panel_lib_found"],
328 [test "$need_panel_menu" = "yes"],
329 [AC_MSG_ERROR([could not find libmenu library (frontend: nconf)])],
330 [has_panel_menu=no])])
331 ncurses_panel_menu_LIBS="$LIBS"
335 [test "$has_panel_menu" = "no" ],
338 #----------------------------------------
339 # Check headers and libs for gconf
341 [test "$need_gtk" = "yes" -o "$need_gtk" = "auto"],
344 [gtk+-2.0 gmodule-2.0 libglade-2.0],
347 [test "$need_gtk" = "yes"],
348 [AC_MSG_ERROR([could not find GTK+ headers and/or libraries (frontend: gconf)])],
352 [test "$has_gtk" = "no" ],
355 #----------------------------------------
356 # Check headers and libs for qconf
358 [test "$need_qt" = "yes" -o "$need_qt" = "auto"],
361 [QtCore QtGui Qt3Support],
362 [has_qt=yes; need_moc="$need_qt"],
364 [test "$need_qt" = "yes"],
365 [AC_MSG_ERROR([could not find QT4 headers and/or libraries (frontend: qconf)])],
366 [has_qt=no; need_moc=no])])])
368 AC_ARG_VAR([MOC], [Qt meta object compiler (moc) command])
370 [test "$need_moc" = "yes" -o "$need_moc" = "auto"],
371 [QT4_BINDIR=`$PKG_CONFIG Qt --variable bindir`
380 [test "$need_moc" = "yes"],
381 [AC_MSG_ERROR([could not find moc (frontend: qconf)])],
385 [test "$has_qt" = "no" -o "$has_moc" = "no"],
388 #----------------------------------------
389 # Per-frontends extra libraries
390 AC_ARG_VAR([conf_EXTRA_LIBS], [Extra libraries to build the conf frontend] )
391 AC_ARG_VAR([gconf_EXTRA_LIBS], [Extra libraries to build the gconf frontend])
392 AC_ARG_VAR([mconf_EXTRA_LIBS], [Extra libraries to build the mconf frontend])
393 AC_ARG_VAR([nconf_EXTRA_LIBS], [Extra libraries to build the nconf frontend])
394 AC_ARG_VAR([qconf_EXTRA_LIBS], [Extra libraries to build the qconf frontend])
396 #---------------------------------------------------------------------------
397 # Now, we know what frontends to enable
398 AS_IF([test "$enable_conf" = "auto"], [enable_conf=yes ])
399 AS_IF([test "$enable_gconf" = "auto"], [enable_gconf=yes])
400 AS_IF([test "$enable_mconf" = "auto"], [enable_mconf=yes])
401 AS_IF([test "$enable_nconf" = "auto"], [enable_nconf=yes])
402 AS_IF([test "$enable_qconf" = "auto"], [enable_qconf=yes])
404 #----------------------------------------
405 # Check if the lxdialog library should be built
407 [test "$enable_mconf" = "yes"],
411 #----------------------------------------
412 # Check if the images library should be built
414 [test "$enable_gconf" = "yes" -o "$enable_qconf" = "yes"],
418 #----------------------------------------
419 # Setup automake conditional build
422 [test "$enable_conf" = "yes"])
425 [test "$enable_mconf" = "yes"])
428 [test "$enable_nconf" = "yes"])
431 [test "$enable_gconf" = "yes"])
434 [test "$enable_qconf" = "yes"])
437 [test "$need_lxdialog" = "yes"])
440 [test "$need_images" = "yes"])
443 [test "$enable_utils" = "yes"])
445 [COND_utils_gettext],
446 [test "$has_gettext" = "yes"])
448 #----------------------------------------
449 # Get the version to apply to the parser shared library
451 [KCONFIGPARSER_LIB_VERSION],
452 [m4_esyscmd_s([./scripts/version.sh --plain])])
454 #----------------------------------------
461 libs/lxdialog/Makefile
464 frontends/conf/Makefile
465 frontends/mconf/Makefile
466 frontends/nconf/Makefile
467 frontends/gconf/Makefile
468 frontends/qconf/Makefile
474 #----------------------------------------
475 # Pretty-print the configuration settings
477 AS_IF([test "$enable_conf" = "yes"], [fe_list="$fe_list conf" ])
478 AS_IF([test "$enable_gconf" = "yes"], [fe_list="$fe_list gconf"])
479 AS_IF([test "$enable_mconf" = "yes"], [fe_list="$fe_list mconf"])
480 AS_IF([test "$enable_nconf" = "yes"], [fe_list="$fe_list nconf"])
481 AS_IF([test "$enable_qconf" = "yes"], [fe_list="$fe_list qconf"])
485 [test "$enable_shared" = "yes"],
486 [lib_list="$lib_list shared (version: $KCONFIGPARSER_LIB_VERSION)"])
488 [test "$enable_static" = "yes"],
489 [lib_list="$lib_list${lib_list:+,} static"])
492 AC_MSG_NOTICE([Configured with:])
493 AC_MSG_NOTICE([- parser library :$lib_list])
494 AC_MSG_NOTICE([ - root-menu prompt : $root_menu])
495 AC_MSG_NOTICE([ - config prefix : $config_prefix])
496 AC_MSG_NOTICE([- frontends :$fe_list])
497 AC_MSG_NOTICE([ - transform name : $program_transform_name])
498 AC_MSG_NOTICE([ - localised : $has_gettext])
499 AC_MSG_NOTICE([- install utilities : $enable_utils])
500 AC_MSG_NOTICE([- CFLAGS CXXFLAGS : $wall_CFLAGS $werror_CFLAGS])