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])
33 # For releases, enable silent rules, unless the user explicitly
35 # For the devel tree, do build with verbose output, unless user
36 # explicitly enables silent rules
38 [test "$(${srcdir}/scripts/version.sh --internal)" = "git"],
40 [AM_SILENT_RULES([yes])])
43 [test $AM_DEFAULT_VERBOSITY -eq 0],
44 [SILENT_MAKEFLAGS="--no-print-directory -s"],
45 [SILENT_MAKEFLAGS=""])
46 AC_SUBST([SILENT_MAKEFLAGS])
48 #----------------------------------------
50 m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) dnl Automake, we have a problem...
52 LT_INIT([disable-static])
54 #---------------------------------------------------------------------------
57 # By default, do build with -Wall, unless the user asks not to
63 [build with -Wall (default=yes)])],
66 [yes], [wall_CFLAGS=-Wall],
67 [*], [wall_CFLAGS=""])])
68 AC_SUBST([wall_CFLAGS],[${wall_CFLAGS}])
70 # For releases, do not build with -Werror, unless the user explicitly
71 # requests to build with -Werror.
72 # For the devel tree, do build with -Werror by default, unless user
73 # explicitly disables -Werror
75 [test "$(${srcdir}/scripts/version.sh --internal)" = "git"],
76 [werror_CFLAGS=-Werror])
81 [build with -Werror (default=no)])],
84 [yes], [werror_CFLAGS=-Werror],
85 [*], [werror_CFLAGS=""])])
86 AC_SUBST([werror_CFLAGS],[${werror_CFLAGS}])
88 # Although there is a default (="linux") in the code, we do provide
89 # a default here, to get a consistent autostuff behavior
93 [--enable-root-menu-prompt=PROMPT],
94 [set the root-menu prompt (default=Configuration)])],
97 [yes], [root_menu=Configuration],
99 [# Escape the $ signs, otherwise they would get munged by make
100 root_menu="$( echo "$enableval" |sed -e 's/\$/\\$$/g;' )"])])
101 AC_SUBST([root_menu], [${root_menu=Configuration}])
106 [--enable-config-prefix=PREFIX],
107 [the prefix to the config option (default=CONFIG_)])],
110 [*" "*],[AC_MSG_ERROR([config prefix can not contain spaces: '$enableval'])],
111 [yes], [config_prefix=CONFIG_],
112 [no], [config_prefix=],
113 [config_prefix=$enableval])])
114 AC_SUBST([config_prefix], [${config_prefix-CONFIG_}])
120 [install utilities to manage .config files (default=yes)])])
121 AC_SUBST([enable_utils], [${enable_utils:-yes}])
127 [enable localisation (L10n) (default=auto)])])
128 AC_SUBST([enable_L10n], [${enable_L10n:-yes}])
130 #----------------------------------------
131 # Options to selectively enable/disable frontends
132 # All are selected by default
137 [conf, the stdin-based frontend (default=auto)])])
138 AC_SUBST([enable_conf], [${enable_conf:-auto}])
143 [mconf, the traditional ncurses-based frontend (default=auto)])])
144 AC_SUBST([enable_mconf], [${enable_mconf:-auto}])
149 [nconf, the modern ncurses-based frontend (default=auto)])])
150 AC_SUBST([enable_nconf], [${enable_nconf:-auto}])
155 [gconf, the GTK-based frontend (default=auto)])])
156 AC_SUBST([enable_gconf], [${enable_gconf:-auto}])
161 [qconf, the QT-based frontend (default=auto)])])
162 AC_SUBST([enable_qconf], [${enable_qconf:-auto}])
167 [--enable-frontends=list],
168 [enables only the set of frontends in comma-separated 'list'
169 (default: auto selection), takes precedence over all
170 --enable-*conf, above])],
171 [for f in conf mconf nconf gconf qconf; do
174 [yes], [eval enable_$f=yes],
175 ["$f"], [eval enable_$f=yes],
176 ["$f",*], [eval enable_$f=yes],
177 [*,"$f"], [eval enable_$f=yes],
178 [*,"$f",*], [eval enable_$f=yes],
181 AC_SUBST([enable_frontends])
183 #----------------------------------------
184 # What extra CFLAGS we will be using
185 AC_SUBST([kf_CFLAGS], ["$wall_CFLAGS $werror_CFLAGS"])
187 #----------------------------------------
188 # Dependencies that will be needed, depending on the frontends
190 ["$enable_mconf":"$enable_nconf"],
191 [*yes*], [need_curses=yes],
192 [*auto*], [need_curses=auto],
194 [need_panel_menu="$enable_nconf"]
196 ["$enable_gconf":"$enable_qconf"],
197 [*yes*], [need_pkgconfig=yes],
198 [*auto*], [need_pkgconfig=yes],
199 [need_pkgconfig=no ])
200 [need_gtk="$enable_gconf"]
201 [need_qt="$enable_qconf"]
203 #---------------------------------------------------------------------------
204 # Now check we have the required stuff
206 #----------------------------------------
207 # Some program checks
218 [AC_MSG_ERROR([can not find gperf])])
220 [test "$need_pkgconfig" = "yes"],
221 [PKG_PROG_PKG_CONFIG()])
222 # Look for `lex'. If it cannot be found, autoconf sets $LEX to ':'.
226 [AC_MSG_ERROR([can not find a lexer generator (such as lex or flex)])])
227 AC_SUBST([AM_LFLAGS], ["-L -P zconf"])
228 # Look for `yacc'. If it cannot be found, autoconf sets $YACC to 'yacc'.
231 [test "$YACC" = "yacc"],
236 [test -z "$YACC_IN_PATH"],
237 [AC_MSG_ERROR([can not find a parser generator (such as yacc or bison)])]))
238 AC_SUBST([AM_YFLAGS], ["-t -l -p zconf"])
240 #----------------------------------------
241 # Check for gettext, for the kconfig frontends
242 [has_gettext="$enable_L10n"]
244 [test "$has_gettext" = "yes"],
247 [ac_ct_gettext_hdr=$ac_header; break],
250 [test "$has_gettext" = "yes"],
254 [#include <$ac_ct_gettext_hdr>])])
256 [test "$has_gettext" = "yes"],
266 [test "$has_gettext" = "no"],
267 [intl_CPPFLAGS=-DKBUILD_NO_NLS])
268 AC_SUBST([intl_CPPFLAGS])
269 AC_SUBST([intl_LIBS])
271 #----------------------------------------
272 # Check for ncurses, for the mconf & nconf frontends
274 [test "$need_curses" = "yes" -o "$need_curses" = "auto"],
275 [AC_SUBST([ncurses_mconf_CPPFLAGS])
276 AC_SUBST([ncurses_LIBS])
280 [ncursesw/curses.h ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h],
281 [CURSES_LOC=$ac_header
282 ncurses_mconf_CPPFLAGS=-DCURSES_LOC=\\\"$ac_header\\\"
283 break # Stupid syntax-coloring in vim: "])
285 [test -z "$CURSES_LOC"],
287 [test "$need_curses" = "yes"],
288 [AC_MSG_ERROR([could not find curses headers (frontends: mconf/nconf)])],
292 [ncursesw/*],[ncurses_mconf_CPPFLAGS="$ncurses_mconf_CPPFLAGS -DNCURSES_WIDECHAR=1"])
299 [ncursesw ncurses curses],
300 [ac_ct_curses_lib_found=yes; break])
302 [test -z "$ac_ct_curses_lib_found"],
304 [test "$need_curses" = "yes"],
305 [AC_MSG_ERROR([could not find curses library (frontends: mconf/nconf)])],
311 [test "$has_curses" = "no" ],
312 [enable_mconf=no; enable_nconf=no])
314 #----------------------------------------
315 # Check for libpanel and libmenu, for the nconf frontend
317 [test "$need_panel_menu" = "yes" -o "$need_panel_menu" = "auto"],
318 [AC_SUBST([ncurses_nconf_CPPFLAGS])
319 AC_SUBST([ncurses_panel_menu_LIBS])
322 [ncursesw/*],[ncurses_nconf_CPPFLAGS="-I/usr/include/ncursesw"],
323 [ncurses/*],[ncurses_nconf_CPPFLAGS="-I/usr/include/ncurses"])
329 [ac_ct_panel_lib_found=yes; break],,
332 [test -z "$ac_ct_panel_lib_found"],
334 [test "$need_panel_menu" = "yes"],
335 [AC_MSG_ERROR([could not find libpanel library (frontend: nconf)])],
336 [has_panel_menu=no])])
340 [ac_ct_menu_lib_found=yes; break],,
343 [test -z "$ac_ct_panel_lib_found"],
345 [test "$need_panel_menu" = "yes"],
346 [AC_MSG_ERROR([could not find libmenu library (frontend: nconf)])],
347 [has_panel_menu=no])])
348 ncurses_panel_menu_LIBS="$LIBS"
352 [test "$has_panel_menu" = "no" ],
355 #----------------------------------------
356 # Check headers and libs for gconf
358 [test "$need_gtk" = "yes" -o "$need_gtk" = "auto"],
361 [gtk+-2.0 gmodule-2.0 libglade-2.0],
364 [test "$need_gtk" = "yes"],
365 [AC_MSG_ERROR([could not find GTK+ headers and/or libraries (frontend: gconf)])],
369 [test "$has_gtk" = "no" ],
372 #----------------------------------------
373 # Check headers and libs for qconf
375 [test "$need_qt" = "yes" -o "$need_qt" = "auto"],
378 [Qt5Core Qt5Gui Qt5Widgets],
379 [has_qt=yes; need_moc="$need_qt"],
381 [test "$need_qt" = "yes"],
382 [AC_MSG_ERROR([could not find Qt5 headers and/or libraries (frontend: qconf)])],
383 [has_qt=no; need_moc=no])])])
385 AC_ARG_VAR([MOC], [Qt5 meta object compiler (moc) command])
387 [test "$need_moc" = "yes" -o "$need_moc" = "auto"],
388 [QT5_BINDIR=`$PKG_CONFIG Qt5Core --variable host_bins`
397 [test "$need_moc" = "yes"],
398 [AC_MSG_ERROR([could not find moc (frontend: qconf)])],
402 [test "$has_qt" = "no" -o "$has_moc" = "no"],
405 #----------------------------------------
406 # Per-frontends extra libraries
407 AC_ARG_VAR([conf_EXTRA_LIBS], [Extra libraries to build the conf frontend] )
408 AC_ARG_VAR([gconf_EXTRA_LIBS], [Extra libraries to build the gconf frontend])
409 AC_ARG_VAR([mconf_EXTRA_LIBS], [Extra libraries to build the mconf frontend])
410 AC_ARG_VAR([nconf_EXTRA_LIBS], [Extra libraries to build the nconf frontend])
411 AC_ARG_VAR([qconf_EXTRA_LIBS], [Extra libraries to build the qconf frontend])
413 #---------------------------------------------------------------------------
414 # Now, we know what frontends to enable
415 AS_IF([test "$enable_conf" = "auto"], [enable_conf=yes ])
416 AS_IF([test "$enable_gconf" = "auto"], [enable_gconf=yes])
417 AS_IF([test "$enable_mconf" = "auto"], [enable_mconf=yes])
418 AS_IF([test "$enable_nconf" = "auto"], [enable_nconf=yes])
419 AS_IF([test "$enable_qconf" = "auto"], [enable_qconf=yes])
421 #----------------------------------------
422 # Check if the lxdialog library should be built
424 [test "$enable_mconf" = "yes"],
428 #----------------------------------------
429 # Check if the images library should be built
431 [test "$enable_gconf" = "yes" -o "$enable_qconf" = "yes"],
435 #----------------------------------------
436 # Setup automake conditional build
439 [test "$enable_conf" = "yes"])
442 [test "$enable_mconf" = "yes"])
445 [test "$enable_nconf" = "yes"])
448 [test "$enable_gconf" = "yes"])
451 [test "$enable_qconf" = "yes"])
454 [test "$need_lxdialog" = "yes"])
457 [test "$need_images" = "yes"])
460 [test "$enable_utils" = "yes"])
462 [COND_utils_gettext],
463 [test "$has_gettext" = "yes"])
465 #----------------------------------------
466 # Get the version to apply to the parser shared library
468 [KCONFIGPARSER_LIB_VERSION],
469 [m4_esyscmd_s([./scripts/version.sh --plain])])
471 #----------------------------------------
478 libs/lxdialog/Makefile
481 frontends/conf/Makefile
482 frontends/mconf/Makefile
483 frontends/nconf/Makefile
484 frontends/gconf/Makefile
485 frontends/qconf/Makefile
491 #----------------------------------------
492 # Pretty-print the configuration settings
494 AS_IF([test "$enable_conf" = "yes"], [fe_list="$fe_list conf" ])
495 AS_IF([test "$enable_gconf" = "yes"], [fe_list="$fe_list gconf"])
496 AS_IF([test "$enable_mconf" = "yes"], [fe_list="$fe_list mconf"])
497 AS_IF([test "$enable_nconf" = "yes"], [fe_list="$fe_list nconf"])
498 AS_IF([test "$enable_qconf" = "yes"], [fe_list="$fe_list qconf"])
502 [test "$enable_shared" = "yes"],
503 [lib_list="$lib_list shared (version: $KCONFIGPARSER_LIB_VERSION)"])
505 [test "$enable_static" = "yes"],
506 [lib_list="$lib_list${lib_list:+,} static"])
509 AC_MSG_NOTICE([Configured with:])
510 AC_MSG_NOTICE([- parser library :$lib_list])
511 AC_MSG_NOTICE([ - root-menu prompt : $root_menu])
512 AC_MSG_NOTICE([ - config prefix : $config_prefix])
513 AC_MSG_NOTICE([- frontends :$fe_list])
514 AC_MSG_NOTICE([ - transform name : $program_transform_name])
515 AC_MSG_NOTICE([ - localised : $has_gettext])
516 AC_MSG_NOTICE([- install utilities : $enable_utils])
517 AC_MSG_NOTICE([- CFLAGS CXXFLAGS : $wall_CFLAGS $werror_CFLAGS])