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-])
33 #----------------------------------------
36 LT_INIT([disable-static])
38 #---------------------------------------------------------------------------
41 # By default, do not build with -Wall, unless the user asks for it
46 [build with -Wall (default=no)])],
49 [yes], [wall_CFLAGS=-Wall],
50 [*], [wall_CFLAGS=""])])
51 AC_SUBST([wall_CFLAGS],[${wall_CFLAGS}])
53 # By default, do not build with -Werror, unless the user asks for it
58 [build with -Werror (default=no)])],
61 [yes], [werror_CFLAGS=-Werror],
62 [*], [werror_CFLAGS=""])])
63 AC_SUBST([werror_CFLAGS],[${werror_CFLAGS}])
65 # Although there is a default (="linux") in the code, we do provide
66 # a default here, to get a consistent autostuff behavior
70 [--enable-root-menu-prompt=PROMPT],
71 [set the root-menu prompt (default=Configuration)])],
74 [yes], [root_menu=Configuration],
76 [# Escape the $ signs, otherwise they would get munged by make
77 # Also, append a space at the end, to separate the package
78 # name from the literal 'Configuration'
79 root_menu="$( echo "$enableval" |sed -r -e 's/\$/\\$$/g;' )"])])
80 AC_SUBST([root_menu], [${root_menu=Configuration}])
85 [--enable-config-prefix=PREFIX],
86 [the prefix to the config option (default=CONFIG_)])],
89 [*" "*],[AC_MSG_ERROR([config prefix can not contain spaces: '$enableval'])],
90 [yes], [config_prefix=CONFIG_],
91 [no], [config_prefix=],
92 [config_prefix=$enableval])])
93 AC_SUBST([config_prefix], [${config_prefix-CONFIG_}])
99 [install utilities to manage .config files (default=no)])])
100 AC_SUBST([enable_utils], [${enable_utils:-yes}])
102 #----------------------------------------
103 # Options to selectively enable/disable frontends
104 # All are selected by default
109 [conf, the stdin-based frontend (default=auto)])])
110 AC_SUBST([enable_conf], [${enable_conf:-auto}])
115 [mconf, the traditional ncurses-based frontend (default=auto)])])
116 AC_SUBST([enable_mconf], [${enable_mconf:-auto}])
121 [nconf, the modern ncurses-based frontend (default=auto)])])
122 AC_SUBST([enable_nconf], [${enable_nconf:-auto}])
127 [gconf, the GTK-based frontend (default=auto)])])
128 AC_SUBST([enable_gconf], [${enable_gconf:-auto}])
133 [qconf, the QT-based frontend (default=auto)])])
134 AC_SUBST([enable_qconf], [${enable_qconf:-auto}])
139 [--enable-frontends=list],
140 [enables only the set of frontends in comma-separated 'list'
141 (default: auto selection), takes precedence over all
142 --enable-*conf, above])],
143 [for f in conf mconf nconf gconf qconf; do
146 [yes], [eval enable_$f=yes],
147 ["$f"], [eval enable_$f=yes],
148 ["$f",*], [eval enable_$f=yes],
149 [*,"$f"], [eval enable_$f=yes],
150 [*,"$f",*], [eval enable_$f=yes],
153 AC_SUBST([enable_frontends])
155 #----------------------------------------
156 # What extra CFLAGS we will be using
157 AC_SUBST([kf_CFLAGS], ["$wall_CFLAGS $werror_CFLAGS"])
159 #----------------------------------------
160 # Dependencies that will be needed, depending on the frontends
162 ["$enable_mconf":"$enable_nconf"],
163 [*yes*], [need_curses=yes],
164 [*auto*], [need_curses=auto],
166 [need_panel_menu="$enable_nconf"]
168 ["$enable_gconf":"$enable_qconf"],
169 [*yes*], [need_pkgconfig=yes],
170 [*auto*], [need_pkgconfig=yes],
171 [need_pkgconfig=no ])
172 [need_gtk="$enable_gconf"]
173 [need_qt="$enable_qconf"]
175 #---------------------------------------------------------------------------
176 # Now check we have the required stuff
178 #----------------------------------------
179 # Some program checks
190 [AC_MSG_ERROR([can not find gperf])])
192 [test "$need_pkgconfig" = "yes"],
193 [PKG_PROG_PKG_CONFIG()])
195 AC_SUBST([AM_LFLAGS], ["-L -P zconf"])
197 AC_SUBST([AM_YFLAGS], ["-t -l -p zconf"])
199 #----------------------------------------
200 # Check for standard headers
203 AC_CHECK_HEADERS([ fcntl.h limits.h locale.h ])
204 AC_CHECK_HEADERS([ stdlib.h string.h sys/time.h unistd.h ])
207 #----------------------------------------
208 # Checks for library functions.
212 AC_CHECK_FUNCS([ bzero memmove memset ])
213 AC_CHECK_FUNCS([ strcasecmp strchr strcspn strdup strncasecmp strpbrk strrchr strspn strtol ])
214 AC_CHECK_FUNCS([ gettimeofday mkdir regcomp setlocale uname ])
216 #----------------------------------------
217 # Check for gettext, for the kconfig frontends
221 [ac_ct_gettext_hdr=$ac_header; break],
224 [test "$has_gettext" = "yes"],
228 [#include <$ac_ct_gettext_hdr>])])
230 [test "$has_gettext" = "yes"],
240 [test "$has_gettext" = "no"],
241 [intl_CPPFLAGS=-DKBUILD_NO_NLS])
242 AC_SUBST([intl_CPPFLAGS])
243 AC_SUBST([intl_LIBS])
245 #----------------------------------------
246 # Check for ncurses, for the mconf & nconf frontends
248 [test "$need_curses" = "yes" -o "$need_curses" = "auto"],
249 [AC_SUBST([CURSES_LOC])
250 AC_SUBST([ncurses_LIBS])
254 [ncurses/ncurses.h ncurses/curses.h ncursesw/curses.h ncurses.h curses.h],
255 [CURSES_LOC=$ac_header; break])
257 [test -z "$CURSES_LOC"],
259 [test "$need_curses" = "yes"],
260 [AC_MSG_ERROR([could not find curses headers (frontends: mconf/nconf)])],
264 [ncursesw ncurses curses],
265 [ac_ct_curses_lib_found=yes; break])
267 [test -z "$ac_ct_curses_lib_found"],
269 [test "$need_curses" = "yes"],
270 [AC_MSG_ERROR([could not find curses library (frontends: mconf/nconf)])],
276 [test "$has_curses" = "no" ],
277 [enable_mconf=no; enable_nconf=no])
279 #----------------------------------------
280 # Check for libpanel and libmenu, for the nconf frontend
282 [test "$need_panel_menu" = "yes" -o "$need_panel_menu" = "auto"],
283 [AC_SUBST([ncurses_extra_LIBS])
289 [ac_ct_panel_lib_found=yes; break],,
292 [test -z "$ac_ct_panel_lib_found"],
294 [test "$need_panel_menu" = "yes"],
295 [AC_MSG_ERROR([could not find libpanel library (frontend: nconf)])],
296 [has_panel_menu=no])])
300 [ac_ct_menu_lib_found=yes; break],,
303 [test -z "$ac_ct_panel_lib_found"],
305 [test "$need_panel_menu" = "yes"],
306 [AC_MSG_ERROR([could not find libmenu library (frontend: nconf)])],
307 [has_panel_menu=no])])
308 ncurses_extra_LIBS="$LIBS"
312 [test "$has_panel_menu" = "no" ],
315 #----------------------------------------
316 # Check headers and libs for gconf
318 [test "$need_gtk" = "yes" -o "$need_gtk" = "auto"],
321 [gtk+-2.0 gmodule-2.0 libglade-2.0],
324 [test "$need_gtk" = "yes"],
325 [AC_MSG_ERROR([could not find GTK+ headers and/or libraries (frontend: gconf)])],
329 [test "$has_gtk" = "no" ],
332 #----------------------------------------
333 # Check headers and libs for qconf
335 [test "$need_qt" = "yes" -o "$need_qt" = "auto"],
338 [QtCore QtGui Qt3Support],
339 [has_qt=yes; need_moc="$need_qt"],
341 [test "$need_qt" = "yes"],
342 [AC_MSG_ERROR([could not find QT4 headers and/or libraries (frontend: qconf)])],
343 [has_qt=no; need_moc=no])])])
345 AC_ARG_VAR([MOC], [Qt meta object compiler (moc) command])
347 [test "$need_moc" = "yes" -o "$need_moc" = "auto"],
348 [QT4_BINDIR=`$PKG_CONFIG Qt --variable bindir`
357 [test "$need_moc" = "yes"],
358 [AC_MSG_ERROR([could not find moc (frontend: qconf)])],
362 [test "$has_qt" = "no" -o "$has_moc" = "no"],
365 #----------------------------------------
366 # Per-frontends extra libraries
367 AC_ARG_VAR([conf_EXTRA_LIBS], [Extra libraries to build the conf frontend] )
368 AC_ARG_VAR([gconf_EXTRA_LIBS], [Extra libraries to build the gconf frontend])
369 AC_ARG_VAR([mconf_EXTRA_LIBS], [Extra libraries to build the mconf frontend])
370 AC_ARG_VAR([nconf_EXTRA_LIBS], [Extra libraries to build the nconf frontend])
371 AC_ARG_VAR([qconf_EXTRA_LIBS], [Extra libraries to build the qconf frontend])
373 #---------------------------------------------------------------------------
374 # Now, we know what frontends to enable
375 AS_IF([test "$enable_conf" = "auto"], [enable_conf=yes ])
376 AS_IF([test "$enable_gconf" = "auto"], [enable_gconf=yes])
377 AS_IF([test "$enable_mconf" = "auto"], [enable_mconf=yes])
378 AS_IF([test "$enable_nconf" = "auto"], [enable_nconf=yes])
379 AS_IF([test "$enable_qconf" = "auto"], [enable_qconf=yes])
381 #----------------------------------------
382 # Check if the lxdialog library should be built
384 [test "$enable_mconf" = "yes"],
388 #----------------------------------------
389 # Check if the images library should be built
391 [test "$enable_gconf" = "yes" -o "$enable_qconf" = "yes"],
395 #----------------------------------------
396 # Setup automake conditional build
399 [test "$enable_conf" = "yes"])
402 [test "$enable_mconf" = "yes"])
405 [test "$enable_nconf" = "yes"])
408 [test "$enable_gconf" = "yes"])
411 [test "$enable_qconf" = "yes"])
414 [test "$need_lxdialog" = "yes"])
417 [test "$need_images" = "yes"])
420 [test "$enable_utils" = "yes"])
422 #----------------------------------------
423 # Get the version to apply to the parser shared library
425 [KCONFIGPARSER_LIB_VERSION],
426 [m4_esyscmd_s([./scripts/version.sh --plain])])
428 #----------------------------------------
435 libs/lxdialog/Makefile
438 frontends/conf/Makefile
439 frontends/mconf/Makefile
440 frontends/nconf/Makefile
441 frontends/gconf/Makefile
442 frontends/qconf/Makefile
448 #----------------------------------------
449 # Pretty-print the configuration settings
451 AS_IF([test "$enable_conf" = "yes"], [fe_list="$fe_list conf" ])
452 AS_IF([test "$enable_gconf" = "yes"], [fe_list="$fe_list gconf"])
453 AS_IF([test "$enable_mconf" = "yes"], [fe_list="$fe_list mconf"])
454 AS_IF([test "$enable_nconf" = "yes"], [fe_list="$fe_list nconf"])
455 AS_IF([test "$enable_qconf" = "yes"], [fe_list="$fe_list qconf"])
459 [test "$enable_shared" = "yes"],
460 [lib_list="$lib_list shared (version: $KCONFIGPARSER_LIB_VERSION)"])
462 [test "$enable_static" = "yes"],
463 [lib_list="$lib_list${lib_list:+,} static"])
466 AC_MSG_NOTICE([Configured with:])
467 AC_MSG_NOTICE([- parser library :$lib_list])
468 AC_MSG_NOTICE([ - root-menu prompt : $root_menu])
469 AC_MSG_NOTICE([ - config prefix : $config_prefix])
470 AC_MSG_NOTICE([- frontends :$fe_list])
471 AC_MSG_NOTICE([ - transform name : $program_transform_name])
472 AC_MSG_NOTICE([ - localised : $has_gettext])
473 AC_MSG_NOTICE([- install utilities : $enable_utils])
474 AC_MSG_NOTICE([- CFLAGS CXXFLAGS : $wall_CFLAGS $werror_CFLAGS])