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_}])
86 #----------------------------------------
87 # Options to selectively enable/disable frontends
88 # All are selected by default
93 [conf, the stdin-based frontend (default=auto)])])
94 AC_SUBST([enable_conf], [${enable_conf:-auto}])
99 [mconf, the traditional ncurses-based frontend (default=auto)])])
100 AC_SUBST([enable_mconf], [${enable_mconf:-auto}])
105 [nconf, the modern ncurses-based frontend (default=auto)])])
106 AC_SUBST([enable_nconf], [${enable_nconf:-auto}])
111 [gconf, the GTK-based frontend (default=auto)])])
112 AC_SUBST([enable_gconf], [${enable_gconf:-auto}])
117 [qconf, the QT-based frontend (default=auto)])])
118 AC_SUBST([enable_qconf], [${enable_qconf:-auto}])
123 [--enable-frontends=list],
124 [enables only the set of frontends in comma-separated 'list'
125 (default: auto selection), takes precedence over all
126 --enable-*conf, above])],
127 [for f in conf mconf nconf gconf qconf; do
130 [yes], [eval enable_$f=yes],
131 ["$f"], [eval enable_$f=yes],
132 ["$f",*], [eval enable_$f=yes],
133 [*,"$f"], [eval enable_$f=yes],
134 [*,"$f",*], [eval enable_$f=yes],
137 AC_SUBST([enable_frontends])
139 #----------------------------------------
140 # What extra CFLAGS we will be using
141 AC_SUBST([kf_CFLAGS], ["$wall_CFLAGS $werror_CFLAGS"])
143 #----------------------------------------
144 # Dependencies that will be needed, depending on the frontends
146 ["$enable_mconf":"$enable_nconf"],
147 [*yes*], [need_curses=yes],
148 [*auto*], [need_curses=auto],
150 [need_panel_menu="$enable_nconf"]
152 ["$enable_gconf":"$enable_qconf"],
153 [*yes*], [need_pkgconfig=yes],
154 [*auto*], [need_pkgconfig=yes],
155 [need_pkgconfig=no ])
156 [need_gtk="$enable_gconf"]
157 [need_qt="$enable_qconf"]
159 #---------------------------------------------------------------------------
160 # Now check we have the required stuff
162 #----------------------------------------
163 # Some program checks
174 [AC_MSG_ERROR([can not find gperf])])
176 [test "$need_pkgconfig" = "yes"],
177 [PKG_PROG_PKG_CONFIG()])
179 AC_SUBST([AM_LFLAGS], ["-L -P zconf"])
181 AC_SUBST([AM_YFLAGS], ["-t -l -p zconf"])
183 #----------------------------------------
184 # Check for standard headers
187 AC_CHECK_HEADERS([ fcntl.h libintl.h limits.h locale.h ])
188 AC_CHECK_HEADERS([ stdlib.h string.h sys/time.h unistd.h ])
191 #----------------------------------------
192 # Checks for library functions.
196 AC_CHECK_FUNCS([ bzero memmove memset ])
197 AC_CHECK_FUNCS([ strcasecmp strchr strcspn strdup strncasecmp strpbrk strrchr strspn strtol ])
198 AC_CHECK_FUNCS([ gettimeofday mkdir regcomp setlocale uname ])
200 #----------------------------------------
201 # Check for gettext, for the kconfig frontends
205 [ac_ct_gettext_hdr=$ac_header; break],
206 [AC_MSG_WARN([libintl is missing, frontends will not be localised])])
208 [test -n "$ac_ct_gettext_hdr"],
211 [AC_MSG_WARN([gettext is missing, frontends will not be localised])
212 GETTEXT=-DKBUILD_NO_NLS],
213 [#include <$ac_ct_gettext_hdr>])])
215 #----------------------------------------
216 # Check for ncurses, for the mconf & nconf frontends
218 [test "$need_curses" = "yes" -o "$need_curses" = "auto"],
219 [AC_SUBST([CURSES_LOC])
220 AC_SUBST([ncurses_LIBS])
224 [ncurses/ncurses.h ncurses/curses.h ncursesw/curses.h ncurses.h curses.h],
225 [CURSES_LOC=$ac_header; break])
227 [test -z "$CURSES_LOC"],
229 [test "$need_curses" = "yes"],
230 [AC_MSG_ERROR([could not find curses headers (frontends: mconf/nconf)])],
234 [ncursesw ncurses curses],
235 [ac_ct_curses_lib_found=yes; break])
237 [test -z "$ac_ct_curses_lib_found"],
239 [test "$need_curses" = "yes"],
240 [AC_MSG_ERROR([could not find curses library (frontends: mconf/nconf)])],
246 [test "$has_curses" = "no" ],
247 [enable_mconf=no; enable_nconf=no])
249 #----------------------------------------
250 # Check for libpanel and libmenu, for the nconf frontend
252 [test "$need_panel_menu" = "yes" -o "$need_panel_menu" = "auto"],
253 [AC_SUBST([ncurses_extra_LIBS])
259 [ac_ct_panel_lib_found=yes; break],,
262 [test -z "$ac_ct_panel_lib_found"],
264 [test "$need_panel_menu" = "yes"],
265 [AC_MSG_ERROR([could not find libpanel library (frontend: nconf)])],
266 [has_panel_menu=no])])
270 [ac_ct_menu_lib_found=yes; break],,
273 [test -z "$ac_ct_panel_lib_found"],
275 [test "$need_panel_menu" = "yes"],
276 [AC_MSG_ERROR([could not find libmenu library (frontend: nconf)])],
277 [has_panel_menu=no])])
278 ncurses_extra_LIBS="$LIBS"
282 [test "$has_panel_menu" = "no" ],
285 #----------------------------------------
286 # Check headers and libs for gconf
288 [test "$need_gtk" = "yes" -o "$need_gtk" = "auto"],
291 [gtk+-2.0 gmodule-2.0 libglade-2.0],
294 [test "$need_gtk" = "yes"],
295 [AC_MSG_ERROR([could not find GTK+ headers and/or libraries (frontend: gconf)])],
299 [test "$has_gtk" = "no" ],
302 #----------------------------------------
303 # Check headers and libs for qconf
305 [test "$need_qt" = "yes" -o "$need_qt" = "auto"],
308 [QtCore QtGui Qt3Support],
309 [has_qt=yes; need_moc="$need_qt"],
311 [test "$need_qt" = "yes"],
312 [AC_MSG_ERROR([could not find QT4 headers and/or libraries (frontend: qconf)])],
313 [has_qt=no; need_moc=no])])])
315 AC_ARG_VAR([MOC], [Qt meta object compiler (moc) command])
317 [test "$need_moc" = "yes" -o "$need_moc" = "auto"],
318 [QT4_BINDIR=`$PKG_CONFIG Qt --variable bindir`
327 [test "$need_moc" = "yes"],
328 [AC_MSG_ERROR([could not find moc (frontend: qconf)])],
332 [test "$has_qt" = "no" -o "$has_moc" = "no"],
335 #----------------------------------------
336 # Per-frontends extra libraries
337 AC_ARG_VAR([conf_EXTRA_LIBS], [Extra libraries to build the conf frontend] )
338 AC_ARG_VAR([gconf_EXTRA_LIBS], [Extra libraries to build the gconf frontend])
339 AC_ARG_VAR([mconf_EXTRA_LIBS], [Extra libraries to build the mconf frontend])
340 AC_ARG_VAR([nconf_EXTRA_LIBS], [Extra libraries to build the nconf frontend])
341 AC_ARG_VAR([qconf_EXTRA_LIBS], [Extra libraries to build the qconf frontend])
343 #---------------------------------------------------------------------------
344 # Now, we know what frontends to enable
345 AS_IF([test "$enable_conf" = "auto"], [enable_conf=yes ])
346 AS_IF([test "$enable_gconf" = "auto"], [enable_gconf=yes])
347 AS_IF([test "$enable_mconf" = "auto"], [enable_mconf=yes])
348 AS_IF([test "$enable_nconf" = "auto"], [enable_nconf=yes])
349 AS_IF([test "$enable_qconf" = "auto"], [enable_qconf=yes])
351 #----------------------------------------
352 # Check if the lxdialog library should be built
354 [test "$enable_mconf" = "yes"],
358 #----------------------------------------
359 # Setup automake conditional build
362 [test "$enable_conf" = "yes"])
365 [test "$enable_mconf" = "yes"])
368 [test "$enable_nconf" = "yes"])
371 [test "$enable_gconf" = "yes"])
374 [test "$enable_qconf" = "yes"])
377 [test "$need_lxdialog" = "yes"])
379 #----------------------------------------
380 # Get the version to apply to the parser shared library
382 [KCONFIGPARSER_LIB_VERSION],
383 [m4_esyscmd_s([./scripts/version.sh --plain])])
385 #----------------------------------------
392 libs/lxdialog/Makefile
395 frontends/conf/Makefile
396 frontends/mconf/Makefile
397 frontends/nconf/Makefile
398 frontends/gconf/Makefile
399 frontends/qconf/Makefile
404 AC_MSG_NOTICE([Configured with:])
405 AS_IF([test "$enable_wall" = "yes"],
406 [AC_MSG_NOTICE([- catch all warnings : yes])],
407 [AC_MSG_NOTICE([- catch all warnings : no])])
408 AS_IF([test "$enable_werror" = "yes"],
409 [AC_MSG_NOTICE([- treat warnings as errors: yes])],
410 [AC_MSG_NOTICE([- treat warnings as errors: no])])
411 AC_MSG_NOTICE([- root-menu prompt : '$root_menu'])
412 AC_MSG_NOTICE([- config prefix : '$config_prefix'])
413 AC_MSG_NOTICE([- frontends:])
414 AS_IF([test "$enable_conf" = "yes"],
415 [AC_MSG_NOTICE([ - conf : yes])],
416 [AC_MSG_NOTICE([ - conf : no])])
417 AS_IF([test "$enable_gconf" = "yes"],
418 [AC_MSG_NOTICE([ - gconf: yes])],
419 [AC_MSG_NOTICE([ - gconf: no])])
420 AS_IF([test "$enable_mconf" = "yes"],
421 [AC_MSG_NOTICE([ - mconf: yes])],
422 [AC_MSG_NOTICE([ - mconf: no])])
423 AS_IF([test "$enable_nconf" = "yes"],
424 [AC_MSG_NOTICE([ - nconf: yes])],
425 [AC_MSG_NOTICE([ - nconf: no])])
426 AS_IF([test "$enable_qconf" = "yes"],
427 [AC_MSG_NOTICE([ - qconf: yes])],
428 [AC_MSG_NOTICE([ - qconf: no])])
429 AC_MSG_NOTICE([- parser library:])
430 AS_IF([test "$enable_shared" = "yes"],
431 [AC_MSG_NOTICE([ - shared: yes, versioned $KCONFIGPARSER_LIB_VERSION])],
432 [AC_MSG_NOTICE([ - shared: no])])
433 AC_MSG_NOTICE([ - static: $enable_static])