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 # By default, do not build with -Werror, unless the user asks for it
71 [build with -Werror (default=no)])],
74 [yes], [werror_CFLAGS=-Werror],
75 [*], [werror_CFLAGS=""])])
76 AC_SUBST([werror_CFLAGS],[${werror_CFLAGS}])
78 # Although there is a default (="linux") in the code, we do provide
79 # a default here, to get a consistent autostuff behavior
83 [--enable-root-menu-prompt=PROMPT],
84 [set the root-menu prompt (default=Configuration)])],
87 [yes], [root_menu=Configuration],
89 [# Escape the $ signs, otherwise they would get munged by make
90 # Also, append a space at the end, to separate the package
91 # name from the literal 'Configuration'
92 root_menu="$( echo "$enableval" |sed -r -e 's/\$/\\$$/g;' )"])])
93 AC_SUBST([root_menu], [${root_menu=Configuration}])
98 [--enable-config-prefix=PREFIX],
99 [the prefix to the config option (default=CONFIG_)])],
102 [*" "*],[AC_MSG_ERROR([config prefix can not contain spaces: '$enableval'])],
103 [yes], [config_prefix=CONFIG_],
104 [no], [config_prefix=],
105 [config_prefix=$enableval])])
106 AC_SUBST([config_prefix], [${config_prefix-CONFIG_}])
112 [install utilities to manage .config files (default=yes)])])
113 AC_SUBST([enable_utils], [${enable_utils:-yes}])
119 [enable localisation (L10n) (default=auto)])])
120 AC_SUBST([enable_L10n], [${enable_L10n:-yes}])
122 #----------------------------------------
123 # Options to selectively enable/disable frontends
124 # All are selected by default
129 [conf, the stdin-based frontend (default=auto)])])
130 AC_SUBST([enable_conf], [${enable_conf:-auto}])
135 [mconf, the traditional ncurses-based frontend (default=auto)])])
136 AC_SUBST([enable_mconf], [${enable_mconf:-auto}])
141 [nconf, the modern ncurses-based frontend (default=auto)])])
142 AC_SUBST([enable_nconf], [${enable_nconf:-auto}])
147 [gconf, the GTK-based frontend (default=auto)])])
148 AC_SUBST([enable_gconf], [${enable_gconf:-auto}])
153 [qconf, the QT-based frontend (default=auto)])])
154 AC_SUBST([enable_qconf], [${enable_qconf:-auto}])
159 [--enable-frontends=list],
160 [enables only the set of frontends in comma-separated 'list'
161 (default: auto selection), takes precedence over all
162 --enable-*conf, above])],
163 [for f in conf mconf nconf gconf qconf; do
166 [yes], [eval enable_$f=yes],
167 ["$f"], [eval enable_$f=yes],
168 ["$f",*], [eval enable_$f=yes],
169 [*,"$f"], [eval enable_$f=yes],
170 [*,"$f",*], [eval enable_$f=yes],
173 AC_SUBST([enable_frontends])
175 #----------------------------------------
176 # What extra CFLAGS we will be using
177 AC_SUBST([kf_CFLAGS], ["$wall_CFLAGS $werror_CFLAGS"])
179 #----------------------------------------
180 # Dependencies that will be needed, depending on the frontends
182 ["$enable_mconf":"$enable_nconf"],
183 [*yes*], [need_curses=yes],
184 [*auto*], [need_curses=auto],
186 [need_panel_menu="$enable_nconf"]
188 ["$enable_gconf":"$enable_qconf"],
189 [*yes*], [need_pkgconfig=yes],
190 [*auto*], [need_pkgconfig=yes],
191 [need_pkgconfig=no ])
192 [need_gtk="$enable_gconf"]
193 [need_qt="$enable_qconf"]
195 #---------------------------------------------------------------------------
196 # Now check we have the required stuff
198 #----------------------------------------
199 # Some program checks
210 [AC_MSG_ERROR([can not find gperf])])
212 [test "$need_pkgconfig" = "yes"],
213 [PKG_PROG_PKG_CONFIG()])
215 AC_SUBST([AM_LFLAGS], ["-L -P zconf"])
217 AC_SUBST([AM_YFLAGS], ["-t -l -p zconf"])
219 #----------------------------------------
220 # Check for gettext, for the kconfig frontends
221 [has_gettext="$enable_L10n"]
223 [test "$has_gettext" = "yes"],
226 [ac_ct_gettext_hdr=$ac_header; break],
229 [test "$has_gettext" = "yes"],
233 [#include <$ac_ct_gettext_hdr>])])
235 [test "$has_gettext" = "yes"],
245 [test "$has_gettext" = "no"],
246 [intl_CPPFLAGS=-DKBUILD_NO_NLS])
247 AC_SUBST([intl_CPPFLAGS])
248 AC_SUBST([intl_LIBS])
250 #----------------------------------------
251 # Check for ncurses, for the mconf & nconf frontends
253 [test "$need_curses" = "yes" -o "$need_curses" = "auto"],
254 [AC_SUBST([CURSES_LOC])
255 AC_SUBST([ncurses_LIBS])
259 [ncursesw/curses.h ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h],
260 [CURSES_LOC=$ac_header; break])
262 [test -z "$CURSES_LOC"],
264 [test "$need_curses" = "yes"],
265 [AC_MSG_ERROR([could not find curses headers (frontends: mconf/nconf)])],
269 [ncursesw ncurses curses],
270 [ac_ct_curses_lib_found=yes; break])
272 [test -z "$ac_ct_curses_lib_found"],
274 [test "$need_curses" = "yes"],
275 [AC_MSG_ERROR([could not find curses library (frontends: mconf/nconf)])],
281 [test "$has_curses" = "no" ],
282 [enable_mconf=no; enable_nconf=no])
284 #----------------------------------------
285 # Check for libpanel and libmenu, for the nconf frontend
287 [test "$need_panel_menu" = "yes" -o "$need_panel_menu" = "auto"],
288 [AC_SUBST([ncurses_extra_LIBS])
289 AC_SUBST([ncurses_extra_CPPFLAGS])
292 [ncursesw/*],[ncurses_extra_CPPFLAGS="-I/usr/include/ncursesw"],
293 [ncurses/*],[ncurses_extra_CPPFLAGS="-I/usr/include/ncurses"])
299 [ac_ct_panel_lib_found=yes; break],,
302 [test -z "$ac_ct_panel_lib_found"],
304 [test "$need_panel_menu" = "yes"],
305 [AC_MSG_ERROR([could not find libpanel library (frontend: nconf)])],
306 [has_panel_menu=no])])
310 [ac_ct_menu_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 libmenu library (frontend: nconf)])],
317 [has_panel_menu=no])])
318 ncurses_extra_LIBS="$LIBS"
322 [test "$has_panel_menu" = "no" ],
325 #----------------------------------------
326 # Check headers and libs for gconf
328 [test "$need_gtk" = "yes" -o "$need_gtk" = "auto"],
331 [gtk+-2.0 gmodule-2.0 libglade-2.0],
334 [test "$need_gtk" = "yes"],
335 [AC_MSG_ERROR([could not find GTK+ headers and/or libraries (frontend: gconf)])],
339 [test "$has_gtk" = "no" ],
342 #----------------------------------------
343 # Check headers and libs for qconf
345 [test "$need_qt" = "yes" -o "$need_qt" = "auto"],
348 [QtCore QtGui Qt3Support],
349 [has_qt=yes; need_moc="$need_qt"],
351 [test "$need_qt" = "yes"],
352 [AC_MSG_ERROR([could not find QT4 headers and/or libraries (frontend: qconf)])],
353 [has_qt=no; need_moc=no])])])
355 AC_ARG_VAR([MOC], [Qt meta object compiler (moc) command])
357 [test "$need_moc" = "yes" -o "$need_moc" = "auto"],
358 [QT4_BINDIR=`$PKG_CONFIG Qt --variable bindir`
367 [test "$need_moc" = "yes"],
368 [AC_MSG_ERROR([could not find moc (frontend: qconf)])],
372 [test "$has_qt" = "no" -o "$has_moc" = "no"],
375 #----------------------------------------
376 # Per-frontends extra libraries
377 AC_ARG_VAR([conf_EXTRA_LIBS], [Extra libraries to build the conf frontend] )
378 AC_ARG_VAR([gconf_EXTRA_LIBS], [Extra libraries to build the gconf frontend])
379 AC_ARG_VAR([mconf_EXTRA_LIBS], [Extra libraries to build the mconf frontend])
380 AC_ARG_VAR([nconf_EXTRA_LIBS], [Extra libraries to build the nconf frontend])
381 AC_ARG_VAR([qconf_EXTRA_LIBS], [Extra libraries to build the qconf frontend])
383 #---------------------------------------------------------------------------
384 # Now, we know what frontends to enable
385 AS_IF([test "$enable_conf" = "auto"], [enable_conf=yes ])
386 AS_IF([test "$enable_gconf" = "auto"], [enable_gconf=yes])
387 AS_IF([test "$enable_mconf" = "auto"], [enable_mconf=yes])
388 AS_IF([test "$enable_nconf" = "auto"], [enable_nconf=yes])
389 AS_IF([test "$enable_qconf" = "auto"], [enable_qconf=yes])
391 #----------------------------------------
392 # Check if the lxdialog library should be built
394 [test "$enable_mconf" = "yes"],
398 #----------------------------------------
399 # Check if the images library should be built
401 [test "$enable_gconf" = "yes" -o "$enable_qconf" = "yes"],
405 #----------------------------------------
406 # Setup automake conditional build
409 [test "$enable_conf" = "yes"])
412 [test "$enable_mconf" = "yes"])
415 [test "$enable_nconf" = "yes"])
418 [test "$enable_gconf" = "yes"])
421 [test "$enable_qconf" = "yes"])
424 [test "$need_lxdialog" = "yes"])
427 [test "$need_images" = "yes"])
430 [test "$enable_utils" = "yes"])
432 [COND_utils_gettext],
433 [test "$has_gettext" = "yes"])
435 #----------------------------------------
436 # Get the version to apply to the parser shared library
438 [KCONFIGPARSER_LIB_VERSION],
439 [m4_esyscmd_s([./scripts/version.sh --plain])])
441 #----------------------------------------
448 libs/lxdialog/Makefile
451 frontends/conf/Makefile
452 frontends/mconf/Makefile
453 frontends/nconf/Makefile
454 frontends/gconf/Makefile
455 frontends/qconf/Makefile
461 #----------------------------------------
462 # Pretty-print the configuration settings
464 AS_IF([test "$enable_conf" = "yes"], [fe_list="$fe_list conf" ])
465 AS_IF([test "$enable_gconf" = "yes"], [fe_list="$fe_list gconf"])
466 AS_IF([test "$enable_mconf" = "yes"], [fe_list="$fe_list mconf"])
467 AS_IF([test "$enable_nconf" = "yes"], [fe_list="$fe_list nconf"])
468 AS_IF([test "$enable_qconf" = "yes"], [fe_list="$fe_list qconf"])
472 [test "$enable_shared" = "yes"],
473 [lib_list="$lib_list shared (version: $KCONFIGPARSER_LIB_VERSION)"])
475 [test "$enable_static" = "yes"],
476 [lib_list="$lib_list${lib_list:+,} static"])
479 AC_MSG_NOTICE([Configured with:])
480 AC_MSG_NOTICE([- parser library :$lib_list])
481 AC_MSG_NOTICE([ - root-menu prompt : $root_menu])
482 AC_MSG_NOTICE([ - config prefix : $config_prefix])
483 AC_MSG_NOTICE([- frontends :$fe_list])
484 AC_MSG_NOTICE([ - transform name : $program_transform_name])
485 AC_MSG_NOTICE([ - localised : $has_gettext])
486 AC_MSG_NOTICE([- install utilities : $enable_utils])
487 AC_MSG_NOTICE([- CFLAGS CXXFLAGS : $wall_CFLAGS $werror_CFLAGS])