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])
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 [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()])
214 # Look for `lex'. If it cannot be found, autoconf sets $LEX to ':'.
218 [AC_MSG_ERROR([can not find a lexer generator (such as lex or flex)])])
219 AC_SUBST([AM_LFLAGS], ["-L -P zconf"])
220 # Look for `yacc'. If it cannot be found, autoconf sets $YACC to 'yacc'.
223 [test "$YACC" = "yacc"],
228 [test -z "$YACC_IN_PATH"],
229 [AC_MSG_ERROR([can not find a parser generator (such as yacc or bison)])]))
230 AC_SUBST([AM_YFLAGS], ["-t -l -p zconf"])
232 #----------------------------------------
233 # Check for gettext, for the kconfig frontends
234 [has_gettext="$enable_L10n"]
236 [test "$has_gettext" = "yes"],
239 [ac_ct_gettext_hdr=$ac_header; break],
242 [test "$has_gettext" = "yes"],
246 [#include <$ac_ct_gettext_hdr>])])
248 [test "$has_gettext" = "yes"],
258 [test "$has_gettext" = "no"],
259 [intl_CPPFLAGS=-DKBUILD_NO_NLS])
260 AC_SUBST([intl_CPPFLAGS])
261 AC_SUBST([intl_LIBS])
263 #----------------------------------------
264 # Check for ncurses, for the mconf & nconf frontends
266 [test "$need_curses" = "yes" -o "$need_curses" = "auto"],
267 [AC_SUBST([ncurses_mconf_CPPFLAGS])
268 AC_SUBST([ncurses_LIBS])
272 [ncursesw/curses.h ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h],
273 [CURSES_LOC=$ac_header
274 ncurses_mconf_CPPFLAGS=-DCURSES_LOC=\\\"$ac_header\\\"
275 break # Stupid syntax-coloring in vim: "])
277 [test -z "$CURSES_LOC"],
279 [test "$need_curses" = "yes"],
280 [AC_MSG_ERROR([could not find curses headers (frontends: mconf/nconf)])],
284 [ncursesw/*],[ncurses_mconf_CPPFLAGS="$ncurses_mconf_CPPFLAGS -DNCURSES_WIDECHAR=1"])
291 [ncursesw ncurses curses],
292 [ac_ct_curses_lib_found=yes; break])
294 [test -z "$ac_ct_curses_lib_found"],
296 [test "$need_curses" = "yes"],
297 [AC_MSG_ERROR([could not find curses library (frontends: mconf/nconf)])],
303 [test "$has_curses" = "no" ],
304 [enable_mconf=no; enable_nconf=no])
306 #----------------------------------------
307 # Check for libpanel and libmenu, for the nconf frontend
309 [test "$need_panel_menu" = "yes" -o "$need_panel_menu" = "auto"],
310 [AC_SUBST([ncurses_nconf_CPPFLAGS])
311 AC_SUBST([ncurses_panel_menu_LIBS])
314 [ncursesw/*],[ncurses_nconf_CPPFLAGS="-I/usr/include/ncursesw"],
315 [ncurses/*],[ncurses_nconf_CPPFLAGS="-I/usr/include/ncurses"])
321 [ac_ct_panel_lib_found=yes; break],,
324 [test -z "$ac_ct_panel_lib_found"],
326 [test "$need_panel_menu" = "yes"],
327 [AC_MSG_ERROR([could not find libpanel library (frontend: nconf)])],
328 [has_panel_menu=no])])
332 [ac_ct_menu_lib_found=yes; break],,
335 [test -z "$ac_ct_panel_lib_found"],
337 [test "$need_panel_menu" = "yes"],
338 [AC_MSG_ERROR([could not find libmenu library (frontend: nconf)])],
339 [has_panel_menu=no])])
340 ncurses_panel_menu_LIBS="$LIBS"
344 [test "$has_panel_menu" = "no" ],
347 #----------------------------------------
348 # Check headers and libs for gconf
350 [test "$need_gtk" = "yes" -o "$need_gtk" = "auto"],
353 [gtk+-2.0 gmodule-2.0 libglade-2.0],
356 [test "$need_gtk" = "yes"],
357 [AC_MSG_ERROR([could not find GTK+ headers and/or libraries (frontend: gconf)])],
361 [test "$has_gtk" = "no" ],
364 #----------------------------------------
365 # Check headers and libs for qconf
367 [test "$need_qt" = "yes" -o "$need_qt" = "auto"],
370 [Qt5Core Qt5Gui Qt5Widgets],
371 [has_qt=yes; need_moc="$need_qt"],
373 [test "$need_qt" = "yes"],
374 [AC_MSG_ERROR([could not find Qt5 headers and/or libraries (frontend: qconf)])],
375 [has_qt=no; need_moc=no])])])
377 AC_ARG_VAR([MOC], [Qt5 meta object compiler (moc) command])
379 [test "$need_moc" = "yes" -o "$need_moc" = "auto"],
380 [QT5_BINDIR=`$PKG_CONFIG Qt5Core --variable host_bins`
389 [test "$need_moc" = "yes"],
390 [AC_MSG_ERROR([could not find moc (frontend: qconf)])],
394 [test "$has_qt" = "no" -o "$has_moc" = "no"],
397 #----------------------------------------
398 # Per-frontends extra libraries
399 AC_ARG_VAR([conf_EXTRA_LIBS], [Extra libraries to build the conf frontend] )
400 AC_ARG_VAR([gconf_EXTRA_LIBS], [Extra libraries to build the gconf frontend])
401 AC_ARG_VAR([mconf_EXTRA_LIBS], [Extra libraries to build the mconf frontend])
402 AC_ARG_VAR([nconf_EXTRA_LIBS], [Extra libraries to build the nconf frontend])
403 AC_ARG_VAR([qconf_EXTRA_LIBS], [Extra libraries to build the qconf frontend])
405 #---------------------------------------------------------------------------
406 # Now, we know what frontends to enable
407 AS_IF([test "$enable_conf" = "auto"], [enable_conf=yes ])
408 AS_IF([test "$enable_gconf" = "auto"], [enable_gconf=yes])
409 AS_IF([test "$enable_mconf" = "auto"], [enable_mconf=yes])
410 AS_IF([test "$enable_nconf" = "auto"], [enable_nconf=yes])
411 AS_IF([test "$enable_qconf" = "auto"], [enable_qconf=yes])
413 #----------------------------------------
414 # Check if the lxdialog library should be built
416 [test "$enable_mconf" = "yes"],
420 #----------------------------------------
421 # Check if the images library should be built
423 [test "$enable_gconf" = "yes" -o "$enable_qconf" = "yes"],
427 #----------------------------------------
428 # Setup automake conditional build
431 [test "$enable_conf" = "yes"])
434 [test "$enable_mconf" = "yes"])
437 [test "$enable_nconf" = "yes"])
440 [test "$enable_gconf" = "yes"])
443 [test "$enable_qconf" = "yes"])
446 [test "$need_lxdialog" = "yes"])
449 [test "$need_images" = "yes"])
452 [test "$enable_utils" = "yes"])
454 [COND_utils_gettext],
455 [test "$has_gettext" = "yes"])
457 #----------------------------------------
458 # Get the version to apply to the parser shared library
460 [KCONFIGPARSER_LIB_VERSION],
461 [m4_esyscmd_s([./scripts/version.sh --plain])])
463 #----------------------------------------
470 libs/lxdialog/Makefile
473 frontends/conf/Makefile
474 frontends/mconf/Makefile
475 frontends/nconf/Makefile
476 frontends/gconf/Makefile
477 frontends/qconf/Makefile
483 #----------------------------------------
484 # Pretty-print the configuration settings
486 AS_IF([test "$enable_conf" = "yes"], [fe_list="$fe_list conf" ])
487 AS_IF([test "$enable_gconf" = "yes"], [fe_list="$fe_list gconf"])
488 AS_IF([test "$enable_mconf" = "yes"], [fe_list="$fe_list mconf"])
489 AS_IF([test "$enable_nconf" = "yes"], [fe_list="$fe_list nconf"])
490 AS_IF([test "$enable_qconf" = "yes"], [fe_list="$fe_list qconf"])
494 [test "$enable_shared" = "yes"],
495 [lib_list="$lib_list shared (version: $KCONFIGPARSER_LIB_VERSION)"])
497 [test "$enable_static" = "yes"],
498 [lib_list="$lib_list${lib_list:+,} static"])
501 AC_MSG_NOTICE([Configured with:])
502 AC_MSG_NOTICE([- parser library :$lib_list])
503 AC_MSG_NOTICE([ - root-menu prompt : $root_menu])
504 AC_MSG_NOTICE([ - config prefix : $config_prefix])
505 AC_MSG_NOTICE([- frontends :$fe_list])
506 AC_MSG_NOTICE([ - localised : $has_gettext])
507 AC_MSG_NOTICE([- install utilities : $enable_utils])
508 AC_MSG_NOTICE([- CFLAGS CXXFLAGS : $wall_CFLAGS $werror_CFLAGS])