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 AM_INIT_AUTOMAKE([foreign subdir-objects])
25 # For releases, enable silent rules, unless the user explicitly
27 # For the devel tree, do build with verbose output, unless user
28 # explicitly enables silent rules
30 [test "$(${srcdir}/scripts/version.sh --internal)" = "git"],
32 [AM_SILENT_RULES([yes])])
35 [test $AM_DEFAULT_VERBOSITY -eq 0],
36 [SILENT_MAKEFLAGS="--no-print-directory -s"],
37 [SILENT_MAKEFLAGS=""])
38 AC_SUBST([SILENT_MAKEFLAGS])
40 #----------------------------------------
42 m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) dnl Automake, we have a problem...
44 LT_INIT([disable-static])
46 #---------------------------------------------------------------------------
49 # By default, do build with -Wall, unless the user asks not to
55 [build with -Wall (default=yes)])],
58 [yes], [wall_CFLAGS=-Wall],
59 [*], [wall_CFLAGS=""])])
60 AC_SUBST([wall_CFLAGS],[${wall_CFLAGS}])
62 # For releases, do not build with -Werror, unless the user explicitly
63 # requests to build with -Werror.
64 # For the devel tree, do build with -Werror by default, unless user
65 # explicitly disables -Werror
67 [test "$(${srcdir}/scripts/version.sh --internal)" = "git"],
68 [werror_CFLAGS=-Werror])
73 [build with -Werror (default=no)])],
76 [yes], [werror_CFLAGS=-Werror],
77 [*], [werror_CFLAGS=""])])
78 AC_SUBST([werror_CFLAGS],[${werror_CFLAGS}])
80 # Although there is a default (="linux") in the code, we do provide
81 # a default here, to get a consistent autostuff behavior
85 [--enable-root-menu-prompt=PROMPT],
86 [set the root-menu prompt (default=Configuration)])],
89 [yes], [root_menu=Configuration],
91 [# Escape the $ signs, otherwise they would get munged by make
92 root_menu="$( echo "$enableval" |sed -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 [kconfig, the meta-frontend to all kconfig tools (default=yes)])])
130 AC_SUBST([enable_kconfig], [${enable_kconfig:-yes}])
136 [conf, the stdin-based frontend (default=auto)])])
137 AC_SUBST([enable_conf], [${enable_conf:-auto}])
142 [mconf, the traditional ncurses-based frontend (default=auto)])])
143 AC_SUBST([enable_mconf], [${enable_mconf:-auto}])
148 [nconf, the modern ncurses-based frontend (default=auto)])])
149 AC_SUBST([enable_nconf], [${enable_nconf:-auto}])
154 [gconf, the GTK-based frontend (default=auto)])])
155 AC_SUBST([enable_gconf], [${enable_gconf:-auto}])
160 [qconf, the QT-based frontend (default=auto)])])
161 AC_SUBST([enable_qconf], [${enable_qconf:-auto}])
166 [--enable-frontends=list],
167 [enables only the set of frontends in comma-separated 'list'
168 (default: auto selection), takes precedence over all
169 --enable-*conf, above])],
170 [for f in conf mconf nconf gconf qconf; do
173 [yes], [eval enable_$f=yes],
174 ["$f"], [eval enable_$f=yes],
175 ["$f",*], [eval enable_$f=yes],
176 [*,"$f"], [eval enable_$f=yes],
177 [*,"$f",*], [eval enable_$f=yes],
180 AC_SUBST([enable_frontends])
182 #----------------------------------------
183 # What extra CFLAGS we will be using
184 AC_SUBST([kf_CFLAGS], ["$wall_CFLAGS $werror_CFLAGS"])
186 #----------------------------------------
187 # Dependencies that will be needed, depending on the frontends
189 ["$enable_mconf":"$enable_nconf"],
190 [*yes*], [need_curses=yes],
191 [*auto*], [need_curses=auto],
193 [need_panel_menu="$enable_nconf"]
195 ["$enable_gconf":"$enable_qconf"],
196 [*yes*], [need_pkgconfig=yes],
197 [*auto*], [need_pkgconfig=yes],
198 [need_pkgconfig=no ])
199 [need_gtk="$enable_gconf"]
200 [need_qt="$enable_qconf"]
202 #---------------------------------------------------------------------------
203 # Now check we have the required stuff
205 #----------------------------------------
206 # Some program checks
217 [AC_MSG_ERROR([can not find gperf])])
219 [test "$need_pkgconfig" = "yes"],
220 [PKG_PROG_PKG_CONFIG()])
221 # Look for `lex'. If it cannot be found, autoconf sets $LEX to ':'.
225 [AC_MSG_ERROR([can not find a lexer generator (such as lex or flex)])])
226 AC_SUBST([AM_LFLAGS], ["-L -P zconf"])
227 # Look for `yacc'. If it cannot be found, autoconf sets $YACC to 'yacc'.
230 [test "$YACC" = "yacc"],
235 [test -z "$YACC_IN_PATH"],
236 [AC_MSG_ERROR([can not find a parser generator (such as yacc or bison)])]))
237 AC_SUBST([AM_YFLAGS], ["-t -l -p zconf"])
239 #----------------------------------------
240 # Check for gettext, for the kconfig frontends
241 [has_gettext="$enable_L10n"]
243 [test "$has_gettext" = "yes"],
246 [ac_ct_gettext_hdr=$ac_header; break],
249 [test "$has_gettext" = "yes"],
253 [#include <$ac_ct_gettext_hdr>])])
255 [test "$has_gettext" = "yes"],
265 [test "$has_gettext" = "no"],
266 [intl_CPPFLAGS=-DKBUILD_NO_NLS])
267 AC_SUBST([intl_CPPFLAGS])
268 AC_SUBST([intl_LIBS])
270 #----------------------------------------
271 # Check for ncurses, for the mconf & nconf frontends
273 [test "$need_curses" = "yes" -o "$need_curses" = "auto"],
274 [AC_SUBST([ncurses_mconf_CPPFLAGS])
275 AC_SUBST([ncurses_LIBS])
279 [ncursesw/curses.h ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h],
280 [CURSES_LOC=$ac_header
281 ncurses_mconf_CPPFLAGS=-DCURSES_LOC=\\\"$ac_header\\\"
282 break # Stupid syntax-coloring in vim: "])
284 [test -z "$CURSES_LOC"],
286 [test "$need_curses" = "yes"],
287 [AC_MSG_ERROR([could not find curses headers (frontends: mconf/nconf)])],
291 [ncursesw/*],[ncurses_mconf_CPPFLAGS="$ncurses_mconf_CPPFLAGS -DNCURSES_WIDECHAR=1"])
298 [ncursesw ncurses curses],
299 [ac_ct_curses_lib_found=yes; break])
301 [test -z "$ac_ct_curses_lib_found"],
303 [test "$need_curses" = "yes"],
304 [AC_MSG_ERROR([could not find curses library (frontends: mconf/nconf)])],
310 [test "$has_curses" = "no" ],
311 [enable_mconf=no; enable_nconf=no])
313 #----------------------------------------
314 # Check for libpanel and libmenu, for the nconf frontend
316 [test "$need_panel_menu" = "yes" -o "$need_panel_menu" = "auto"],
317 [AC_SUBST([ncurses_nconf_CPPFLAGS])
318 AC_SUBST([ncurses_panel_menu_LIBS])
321 [ncursesw/*],[ncurses_nconf_CPPFLAGS="-I/usr/include/ncursesw"],
322 [ncurses/*],[ncurses_nconf_CPPFLAGS="-I/usr/include/ncurses"])
328 [ac_ct_panel_lib_found=yes; break],,
331 [test -z "$ac_ct_panel_lib_found"],
333 [test "$need_panel_menu" = "yes"],
334 [AC_MSG_ERROR([could not find libpanel library (frontend: nconf)])],
335 [has_panel_menu=no])])
339 [ac_ct_menu_lib_found=yes; break],,
342 [test -z "$ac_ct_panel_lib_found"],
344 [test "$need_panel_menu" = "yes"],
345 [AC_MSG_ERROR([could not find libmenu library (frontend: nconf)])],
346 [has_panel_menu=no])])
347 ncurses_panel_menu_LIBS="$LIBS"
351 [test "$has_panel_menu" = "no" ],
354 #----------------------------------------
355 # Check headers and libs for gconf
357 [test "$need_gtk" = "yes" -o "$need_gtk" = "auto"],
360 [gtk+-2.0 gmodule-2.0 libglade-2.0],
363 [test "$need_gtk" = "yes"],
364 [AC_MSG_ERROR([could not find GTK+ headers and/or libraries (frontend: gconf)])],
368 [test "$has_gtk" = "no" ],
371 #----------------------------------------
372 # Check headers and libs for qconf
374 [test "$need_qt" = "yes" -o "$need_qt" = "auto"],
377 [Qt5Core Qt5Gui Qt5Widgets],
378 [has_qt=yes; need_moc="$need_qt"],
380 [test "$need_qt" = "yes"],
381 [AC_MSG_ERROR([could not find Qt5 headers and/or libraries (frontend: qconf)])],
382 [has_qt=no; need_moc=no])])])
384 AC_ARG_VAR([MOC], [Qt5 meta object compiler (moc) command])
386 [test "$need_moc" = "yes" -o "$need_moc" = "auto"],
387 [QT5_BINDIR=`$PKG_CONFIG Qt5Core --variable host_bins`
396 [test "$need_moc" = "yes"],
397 [AC_MSG_ERROR([could not find moc (frontend: qconf)])],
401 [test "$has_qt" = "no" -o "$has_moc" = "no"],
404 #----------------------------------------
405 # Per-frontends extra libraries
406 AC_ARG_VAR([conf_EXTRA_LIBS], [Extra libraries to build the conf frontend] )
407 AC_ARG_VAR([gconf_EXTRA_LIBS], [Extra libraries to build the gconf frontend])
408 AC_ARG_VAR([mconf_EXTRA_LIBS], [Extra libraries to build the mconf frontend])
409 AC_ARG_VAR([nconf_EXTRA_LIBS], [Extra libraries to build the nconf frontend])
410 AC_ARG_VAR([qconf_EXTRA_LIBS], [Extra libraries to build the qconf frontend])
412 #---------------------------------------------------------------------------
413 # Now, we know what frontends to enable
414 AS_IF([test "$enable_conf" = "auto"], [enable_conf=yes ])
415 AS_IF([test "$enable_gconf" = "auto"], [enable_gconf=yes])
416 AS_IF([test "$enable_mconf" = "auto"], [enable_mconf=yes])
417 AS_IF([test "$enable_nconf" = "auto"], [enable_nconf=yes])
418 AS_IF([test "$enable_qconf" = "auto"], [enable_qconf=yes])
420 #----------------------------------------
421 # Check if the lxdialog library should be built
423 [test "$enable_mconf" = "yes"],
427 #----------------------------------------
428 # Check if the images library should be built
430 [test "$enable_gconf" = "yes" -o "$enable_qconf" = "yes"],
434 #----------------------------------------
435 # Setup automake conditional build
438 [test "$enable_kconfig" = "yes"])
441 [test "$enable_conf" = "yes"])
444 [test "$enable_mconf" = "yes"])
447 [test "$enable_nconf" = "yes"])
450 [test "$enable_gconf" = "yes"])
453 [test "$enable_qconf" = "yes"])
456 [test "$need_lxdialog" = "yes"])
459 [test "$need_images" = "yes"])
462 [test "$enable_utils" = "yes"])
464 [COND_utils_gettext],
465 [test "$has_gettext" = "yes"])
467 #----------------------------------------
468 # Get the version to apply to the parser shared library
470 [KCONFIGPARSER_LIB_VERSION],
471 [m4_esyscmd_s([./scripts/version.sh --plain])])
473 #----------------------------------------
474 # Pretty-print the configuration settings
476 AS_IF([test "$enable_conf" = "yes"], [fe_list="$fe_list conf" ])
477 AS_IF([test "$enable_gconf" = "yes"], [fe_list="$fe_list gconf"])
478 AS_IF([test "$enable_mconf" = "yes"], [fe_list="$fe_list mconf"])
479 AS_IF([test "$enable_nconf" = "yes"], [fe_list="$fe_list nconf"])
480 AS_IF([test "$enable_qconf" = "yes"], [fe_list="$fe_list qconf"])
481 # The meta frontend is handled separatly, below, because we do not
482 # want it in the list of tools, kcfg_list.
484 [kcfg_list="$fe_list"]
485 AS_IF([test "$enable_utils" = "yes"], [kcfg_list="$kcfg_list diff merge tweak"])
486 AS_IF([test "$has_gettext" = "yes"], [kcfg_list="$kcfg_list gettext"])
487 AC_SUBST([kcfg_list], [${kcfg_list}])
489 AS_IF([test "$enable_kconfig" = "yes"], [fe_list=" kconfig$fe_list"])
493 [test "$enable_shared" = "yes"],
494 [lib_list="$lib_list shared (version: $KCONFIGPARSER_LIB_VERSION)"])
496 [test "$enable_static" = "yes"],
497 [lib_list="$lib_list${lib_list:+,} static"])
499 #----------------------------------------
505 libs/lxdialog/Makefile
511 AC_MSG_NOTICE([Configured with:])
512 AC_MSG_NOTICE([- parser library :$lib_list])
513 AC_MSG_NOTICE([ - root-menu prompt : $root_menu])
514 AC_MSG_NOTICE([ - config prefix : $config_prefix])
515 AC_MSG_NOTICE([- frontends :$fe_list])
516 AC_MSG_NOTICE([ - localised : $has_gettext])
517 AC_MSG_NOTICE([- install utilities : $enable_utils])
518 AC_MSG_NOTICE([- CFLAGS CXXFLAGS : $wall_CFLAGS $werror_CFLAGS])