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([CURSES_LOC])
261 AC_SUBST([ncurses_LIBS])
265 [ncursesw/curses.h ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h],
266 [CURSES_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 curses],
276 [ac_ct_curses_lib_found=yes; break])
278 [test -z "$ac_ct_curses_lib_found"],
280 [test "$need_curses" = "yes"],
281 [AC_MSG_ERROR([could not find curses library (frontends: mconf/nconf)])],
287 [test "$has_curses" = "no" ],
288 [enable_mconf=no; enable_nconf=no])
290 #----------------------------------------
291 # Check for libpanel and libmenu, for the nconf frontend
293 [test "$need_panel_menu" = "yes" -o "$need_panel_menu" = "auto"],
294 [AC_SUBST([ncurses_extra_LIBS])
295 AC_SUBST([ncurses_extra_CPPFLAGS])
298 [ncursesw/*],[ncurses_extra_CPPFLAGS="-I/usr/include/ncursesw"],
299 [ncurses/*],[ncurses_extra_CPPFLAGS="-I/usr/include/ncurses"])
305 [ac_ct_panel_lib_found=yes; break],,
308 [test -z "$ac_ct_panel_lib_found"],
310 [test "$need_panel_menu" = "yes"],
311 [AC_MSG_ERROR([could not find libpanel library (frontend: nconf)])],
312 [has_panel_menu=no])])
316 [ac_ct_menu_lib_found=yes; break],,
319 [test -z "$ac_ct_panel_lib_found"],
321 [test "$need_panel_menu" = "yes"],
322 [AC_MSG_ERROR([could not find libmenu library (frontend: nconf)])],
323 [has_panel_menu=no])])
324 ncurses_extra_LIBS="$LIBS"
328 [test "$has_panel_menu" = "no" ],
331 #----------------------------------------
332 # Check headers and libs for gconf
334 [test "$need_gtk" = "yes" -o "$need_gtk" = "auto"],
337 [gtk+-2.0 gmodule-2.0 libglade-2.0],
340 [test "$need_gtk" = "yes"],
341 [AC_MSG_ERROR([could not find GTK+ headers and/or libraries (frontend: gconf)])],
345 [test "$has_gtk" = "no" ],
348 #----------------------------------------
349 # Check headers and libs for qconf
351 [test "$need_qt" = "yes" -o "$need_qt" = "auto"],
354 [QtCore QtGui Qt3Support],
355 [has_qt=yes; need_moc="$need_qt"],
357 [test "$need_qt" = "yes"],
358 [AC_MSG_ERROR([could not find QT4 headers and/or libraries (frontend: qconf)])],
359 [has_qt=no; need_moc=no])])])
361 AC_ARG_VAR([MOC], [Qt meta object compiler (moc) command])
363 [test "$need_moc" = "yes" -o "$need_moc" = "auto"],
364 [QT4_BINDIR=`$PKG_CONFIG Qt --variable bindir`
373 [test "$need_moc" = "yes"],
374 [AC_MSG_ERROR([could not find moc (frontend: qconf)])],
378 [test "$has_qt" = "no" -o "$has_moc" = "no"],
381 #----------------------------------------
382 # Per-frontends extra libraries
383 AC_ARG_VAR([conf_EXTRA_LIBS], [Extra libraries to build the conf frontend] )
384 AC_ARG_VAR([gconf_EXTRA_LIBS], [Extra libraries to build the gconf frontend])
385 AC_ARG_VAR([mconf_EXTRA_LIBS], [Extra libraries to build the mconf frontend])
386 AC_ARG_VAR([nconf_EXTRA_LIBS], [Extra libraries to build the nconf frontend])
387 AC_ARG_VAR([qconf_EXTRA_LIBS], [Extra libraries to build the qconf frontend])
389 #---------------------------------------------------------------------------
390 # Now, we know what frontends to enable
391 AS_IF([test "$enable_conf" = "auto"], [enable_conf=yes ])
392 AS_IF([test "$enable_gconf" = "auto"], [enable_gconf=yes])
393 AS_IF([test "$enable_mconf" = "auto"], [enable_mconf=yes])
394 AS_IF([test "$enable_nconf" = "auto"], [enable_nconf=yes])
395 AS_IF([test "$enable_qconf" = "auto"], [enable_qconf=yes])
397 #----------------------------------------
398 # Check if the lxdialog library should be built
400 [test "$enable_mconf" = "yes"],
404 #----------------------------------------
405 # Check if the images library should be built
407 [test "$enable_gconf" = "yes" -o "$enable_qconf" = "yes"],
411 #----------------------------------------
412 # Setup automake conditional build
415 [test "$enable_conf" = "yes"])
418 [test "$enable_mconf" = "yes"])
421 [test "$enable_nconf" = "yes"])
424 [test "$enable_gconf" = "yes"])
427 [test "$enable_qconf" = "yes"])
430 [test "$need_lxdialog" = "yes"])
433 [test "$need_images" = "yes"])
436 [test "$enable_utils" = "yes"])
438 [COND_utils_gettext],
439 [test "$has_gettext" = "yes"])
441 #----------------------------------------
442 # Get the version to apply to the parser shared library
444 [KCONFIGPARSER_LIB_VERSION],
445 [m4_esyscmd_s([./scripts/version.sh --plain])])
447 #----------------------------------------
454 libs/lxdialog/Makefile
457 frontends/conf/Makefile
458 frontends/mconf/Makefile
459 frontends/nconf/Makefile
460 frontends/gconf/Makefile
461 frontends/qconf/Makefile
467 #----------------------------------------
468 # Pretty-print the configuration settings
470 AS_IF([test "$enable_conf" = "yes"], [fe_list="$fe_list conf" ])
471 AS_IF([test "$enable_gconf" = "yes"], [fe_list="$fe_list gconf"])
472 AS_IF([test "$enable_mconf" = "yes"], [fe_list="$fe_list mconf"])
473 AS_IF([test "$enable_nconf" = "yes"], [fe_list="$fe_list nconf"])
474 AS_IF([test "$enable_qconf" = "yes"], [fe_list="$fe_list qconf"])
478 [test "$enable_shared" = "yes"],
479 [lib_list="$lib_list shared (version: $KCONFIGPARSER_LIB_VERSION)"])
481 [test "$enable_static" = "yes"],
482 [lib_list="$lib_list${lib_list:+,} static"])
485 AC_MSG_NOTICE([Configured with:])
486 AC_MSG_NOTICE([- parser library :$lib_list])
487 AC_MSG_NOTICE([ - root-menu prompt : $root_menu])
488 AC_MSG_NOTICE([ - config prefix : $config_prefix])
489 AC_MSG_NOTICE([- frontends :$fe_list])
490 AC_MSG_NOTICE([ - transform name : $program_transform_name])
491 AC_MSG_NOTICE([ - localised : $has_gettext])
492 AC_MSG_NOTICE([- install utilities : $enable_utils])
493 AC_MSG_NOTICE([- CFLAGS CXXFLAGS : $wall_CFLAGS $werror_CFLAGS])