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 #----------------------------------------
24 #----------------------------------------
27 LT_INIT([disable-static])
29 #---------------------------------------------------------------------------
32 # By default, do not build with -Wall, unless the user asks for it
37 [build with -Wall (default=no)])],
40 [yes], [wall_CFLAGS=-Wall],
41 [*], [wall_CFLAGS=""])])
42 AC_SUBST([wall_CFLAGS],[${wall_CFLAGS}])
44 # By default, do not build with -Werror, unless the user asks for it
49 [build with -Werror (default=no)])],
52 [yes], [werror_CFLAGS=-Werror],
53 [*], [werror_CFLAGS=""])])
54 AC_SUBST([werror_CFLAGS],[${werror_CFLAGS}])
56 # Although there is a default (="linux") in the code, we do provide
57 # a default here, to get a consistent autostuff behavior
61 [--enable-root-menu-prompt=PROMPT],
62 [set the root-menu prompt (default=Configuration)])],
65 [yes], [root_menu=Configuration],
67 [# Escape the $ signs, otherwise they would get munged by make
68 # Also, append a space at the end, to separate the package
69 # name from the literal 'Configuration'
70 root_menu="$( echo "$enableval" |sed -r -e 's/\$/\\$$/g;' )"])])
71 AC_SUBST([root_menu], [${root_menu=Configuration}])
76 [--enable-config-prefix=PREFIX],
77 [the prefix to the config option (default=CONFIG_)])],
80 [*" "*],[AC_MSG_ERROR([config prefix can not contain spaces: '$enableval'])],
81 [yes], [config_prefix=CONFIG_],
82 [no], [config_prefix=],
83 [config_prefix=$enableval])])
84 AC_SUBST([config_prefix], [${config_prefix-CONFIG_}])
90 [install utilities to manage .config files (default=no)])])
91 AC_SUBST([enable_utils], [${enable_utils:-no}])
93 #----------------------------------------
94 # Options to selectively enable/disable frontends
95 # All are selected by default
100 [conf, the stdin-based frontend (default=auto)])])
101 AC_SUBST([enable_conf], [${enable_conf:-auto}])
106 [mconf, the traditional ncurses-based frontend (default=auto)])])
107 AC_SUBST([enable_mconf], [${enable_mconf:-auto}])
112 [nconf, the modern ncurses-based frontend (default=auto)])])
113 AC_SUBST([enable_nconf], [${enable_nconf:-auto}])
118 [gconf, the GTK-based frontend (default=auto)])])
119 AC_SUBST([enable_gconf], [${enable_gconf:-auto}])
124 [qconf, the QT-based frontend (default=auto)])])
125 AC_SUBST([enable_qconf], [${enable_qconf:-auto}])
130 [--enable-frontends=list],
131 [enables only the set of frontends in comma-separated 'list'
132 (default: auto selection), takes precedence over all
133 --enable-*conf, above])],
134 [for f in conf mconf nconf gconf qconf; do
137 [yes], [eval enable_$f=yes],
138 ["$f"], [eval enable_$f=yes],
139 ["$f",*], [eval enable_$f=yes],
140 [*,"$f"], [eval enable_$f=yes],
141 [*,"$f",*], [eval enable_$f=yes],
144 AC_SUBST([enable_frontends])
146 #----------------------------------------
147 # What extra CFLAGS we will be using
148 AC_SUBST([kf_CFLAGS], ["$wall_CFLAGS $werror_CFLAGS"])
150 #----------------------------------------
151 # Dependencies that will be needed, depending on the frontends
153 ["$enable_mconf":"$enable_nconf"],
154 [*yes*], [need_curses=yes],
155 [*auto*], [need_curses=auto],
157 [need_panel_menu="$enable_nconf"]
159 ["$enable_gconf":"$enable_qconf"],
160 [*yes*], [need_pkgconfig=yes],
161 [*auto*], [need_pkgconfig=yes],
162 [need_pkgconfig=no ])
163 [need_gtk="$enable_gconf"]
164 [need_qt="$enable_qconf"]
166 #---------------------------------------------------------------------------
167 # Now check we have the required stuff
169 #----------------------------------------
170 # Some program checks
181 [AC_MSG_ERROR([can not find gperf])])
183 [test "$need_pkgconfig" = "yes"],
184 [PKG_PROG_PKG_CONFIG()])
186 AC_SUBST([AM_LFLAGS], ["-L -P zconf"])
188 AC_SUBST([AM_YFLAGS], ["-t -l -p zconf"])
190 #----------------------------------------
191 # Check for standard headers
194 AC_CHECK_HEADERS([ fcntl.h libintl.h limits.h locale.h ])
195 AC_CHECK_HEADERS([ stdlib.h string.h sys/time.h unistd.h ])
198 #----------------------------------------
199 # Checks for library functions.
203 AC_CHECK_FUNCS([ bzero memmove memset ])
204 AC_CHECK_FUNCS([ strcasecmp strchr strcspn strdup strncasecmp strpbrk strrchr strspn strtol ])
205 AC_CHECK_FUNCS([ gettimeofday mkdir regcomp setlocale uname ])
207 #----------------------------------------
208 # Check for gettext, for the kconfig frontends
212 [ac_ct_gettext_hdr=$ac_header; break],
213 [AC_MSG_WARN([libintl is missing, frontends will not be localised])])
215 [test -n "$ac_ct_gettext_hdr"],
218 [AC_MSG_WARN([gettext is missing, frontends will not be localised])
219 GETTEXT=-DKBUILD_NO_NLS],
220 [#include <$ac_ct_gettext_hdr>])])
222 #----------------------------------------
223 # Check for ncurses, for the mconf & nconf frontends
225 [test "$need_curses" = "yes" -o "$need_curses" = "auto"],
226 [AC_SUBST([CURSES_LOC])
227 AC_SUBST([ncurses_LIBS])
231 [ncurses/ncurses.h ncurses/curses.h ncursesw/curses.h ncurses.h curses.h],
232 [CURSES_LOC=$ac_header; break])
234 [test -z "$CURSES_LOC"],
236 [test "$need_curses" = "yes"],
237 [AC_MSG_ERROR([could not find curses headers (frontends: mconf/nconf)])],
241 [ncursesw ncurses curses],
242 [ac_ct_curses_lib_found=yes; break])
244 [test -z "$ac_ct_curses_lib_found"],
246 [test "$need_curses" = "yes"],
247 [AC_MSG_ERROR([could not find curses library (frontends: mconf/nconf)])],
253 [test "$has_curses" = "no" ],
254 [enable_mconf=no; enable_nconf=no])
256 #----------------------------------------
257 # Check for libpanel and libmenu, for the nconf frontend
259 [test "$need_panel_menu" = "yes" -o "$need_panel_menu" = "auto"],
260 [AC_SUBST([ncurses_extra_LIBS])
266 [ac_ct_panel_lib_found=yes; break],,
269 [test -z "$ac_ct_panel_lib_found"],
271 [test "$need_panel_menu" = "yes"],
272 [AC_MSG_ERROR([could not find libpanel library (frontend: nconf)])],
273 [has_panel_menu=no])])
277 [ac_ct_menu_lib_found=yes; break],,
280 [test -z "$ac_ct_panel_lib_found"],
282 [test "$need_panel_menu" = "yes"],
283 [AC_MSG_ERROR([could not find libmenu library (frontend: nconf)])],
284 [has_panel_menu=no])])
285 ncurses_extra_LIBS="$LIBS"
289 [test "$has_panel_menu" = "no" ],
292 #----------------------------------------
293 # Check headers and libs for gconf
295 [test "$need_gtk" = "yes" -o "$need_gtk" = "auto"],
298 [gtk+-2.0 gmodule-2.0 libglade-2.0],
301 [test "$need_gtk" = "yes"],
302 [AC_MSG_ERROR([could not find GTK+ headers and/or libraries (frontend: gconf)])],
306 [test "$has_gtk" = "no" ],
309 #----------------------------------------
310 # Check headers and libs for qconf
312 [test "$need_qt" = "yes" -o "$need_qt" = "auto"],
315 [QtCore QtGui Qt3Support],
316 [has_qt=yes; need_moc="$need_qt"],
318 [test "$need_qt" = "yes"],
319 [AC_MSG_ERROR([could not find QT4 headers and/or libraries (frontend: qconf)])],
320 [has_qt=no; need_moc=no])])])
322 AC_ARG_VAR([MOC], [Qt meta object compiler (moc) command])
324 [test "$need_moc" = "yes" -o "$need_moc" = "auto"],
325 [QT4_BINDIR=`$PKG_CONFIG Qt --variable bindir`
334 [test "$need_moc" = "yes"],
335 [AC_MSG_ERROR([could not find moc (frontend: qconf)])],
339 [test "$has_qt" = "no" -o "$has_moc" = "no"],
342 #----------------------------------------
343 # Per-frontends extra libraries
344 AC_ARG_VAR([conf_EXTRA_LIBS], [Extra libraries to build the conf frontend] )
345 AC_ARG_VAR([gconf_EXTRA_LIBS], [Extra libraries to build the gconf frontend])
346 AC_ARG_VAR([mconf_EXTRA_LIBS], [Extra libraries to build the mconf frontend])
347 AC_ARG_VAR([nconf_EXTRA_LIBS], [Extra libraries to build the nconf frontend])
348 AC_ARG_VAR([qconf_EXTRA_LIBS], [Extra libraries to build the qconf frontend])
350 #---------------------------------------------------------------------------
351 # Now, we know what frontends to enable
352 AS_IF([test "$enable_conf" = "auto"], [enable_conf=yes ])
353 AS_IF([test "$enable_gconf" = "auto"], [enable_gconf=yes])
354 AS_IF([test "$enable_mconf" = "auto"], [enable_mconf=yes])
355 AS_IF([test "$enable_nconf" = "auto"], [enable_nconf=yes])
356 AS_IF([test "$enable_qconf" = "auto"], [enable_qconf=yes])
358 #----------------------------------------
359 # Check if the lxdialog library should be built
361 [test "$enable_mconf" = "yes"],
365 #----------------------------------------
366 # Check if the images library should be built
368 [test "$enable_gconf" = "yes" -o "$enable_qconf" = "yes"],
372 #----------------------------------------
373 # Setup automake conditional build
376 [test "$enable_conf" = "yes"])
379 [test "$enable_mconf" = "yes"])
382 [test "$enable_nconf" = "yes"])
385 [test "$enable_gconf" = "yes"])
388 [test "$enable_qconf" = "yes"])
391 [test "$need_lxdialog" = "yes"])
394 [test "$need_images" = "yes"])
397 [test "$enable_utils" = "yes"])
399 #----------------------------------------
400 # Get the version to apply to the parser shared library
402 [KCONFIGPARSER_LIB_VERSION],
403 [m4_esyscmd_s([./scripts/version.sh --plain])])
405 #----------------------------------------
412 libs/lxdialog/Makefile
415 frontends/conf/Makefile
416 frontends/mconf/Makefile
417 frontends/nconf/Makefile
418 frontends/gconf/Makefile
419 frontends/qconf/Makefile
425 #----------------------------------------
426 # Pretty-print the configuration settings
428 AS_IF([test "$enable_conf" = "yes"], [fe_list="$fe_list conf" ])
429 AS_IF([test "$enable_gconf" = "yes"], [fe_list="$fe_list gconf"])
430 AS_IF([test "$enable_mconf" = "yes"], [fe_list="$fe_list mconf"])
431 AS_IF([test "$enable_nconf" = "yes"], [fe_list="$fe_list nconf"])
432 AS_IF([test "$enable_qconf" = "yes"], [fe_list="$fe_list qconf"])
436 [test "$enable_shared" = "yes"],
437 [lib_list="$lib_list shared (version: $KCONFIGPARSER_LIB_VERSION)"])
439 [test "$enable_static" = "yes"],
440 [lib_list="$lib_list${lib_list:+,} static"])
443 AC_MSG_NOTICE([Configured with:])
444 AC_MSG_NOTICE([- parser library :$lib_list])
445 AC_MSG_NOTICE([ - root-menu prompt : $root_menu])
446 AC_MSG_NOTICE([ - config prefix : $config_prefix])
447 AC_MSG_NOTICE([- frontends :$fe_list])
448 AC_MSG_NOTICE([- install utilities : $enable_utils])
449 AC_MSG_NOTICE([- CFLAGS CXXFLAGS : $wall_CFLAGS $werror_CFLAGS])