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 -Werror, unless the user asks for it
37 [build with -Werror (default=no)])],
40 [yes], [werror_CFLAGS=-Werror],
41 [*], [werror_CFLAGS=""])])
42 AC_SUBST([werror_CFLAGS],[${werror_CFLAGS}])
44 # Although there is a default (="linux") in the code, we do provide
45 # a default here, to get a consistent autostuff behavior
49 [--enable-root-menu-prompt=PROMPT],
50 [set the root-menu prompt (default=Configuration)])],
53 [yes], [root_menu=Configuration],
55 [# Escape the $ signs, otherwise they would get munged by make
56 # Also, append a space at the end, to separate the package
57 # name from the literal 'Configuration'
58 root_menu="$( echo "$enableval" |sed -r -e 's/\$/\\$$/g;' )"])])
59 AC_SUBST([root_menu], [${root_menu=Configuration}])
64 [--enable-config-prefix=PREFIX],
65 [the prefix to the config option (default=CONFIG_)])],
68 [*" "*],[AC_MSG_ERROR([config prefix can not contain spaces: '$enableval'])],
69 [yes], [config_prefix=CONFIG_],
70 [no], [config_prefix=],
71 [config_prefix=$enableval])])
72 AC_SUBST([config_prefix], [${config_prefix-CONFIG_}])
74 #----------------------------------------
75 # Options to selectively enable/disable frontends
76 # All are selected by default
81 [conf, the stdin-based frontend (default=auto)])])
82 AC_SUBST([enable_conf], [${enable_conf:-auto}])
87 [mconf, the traditional ncurses-based frontend (default=auto)])])
88 AC_SUBST([enable_mconf], [${enable_mconf:-auto}])
93 [nconf, the modern ncurses-based frontend (default=auto)])])
94 AC_SUBST([enable_nconf], [${enable_nconf:-auto}])
99 [gconf, the GTK-based frontend (default=auto)])])
100 AC_SUBST([enable_gconf], [${enable_gconf:-auto}])
105 [qconf, the QT-based frontend (default=auto)])])
106 AC_SUBST([enable_qconf], [${enable_qconf:-auto}])
111 [--enable-frontends=list],
112 [enables only the set of frontends in comma-separated 'list'
113 (default: auto selection), takes precedence over all
114 --enable-*conf, above])],
115 [for f in conf mconf nconf gconf qconf; do
118 [yes], [eval enable_$f=yes],
119 ["$f"], [eval enable_$f=yes],
120 ["$f",*], [eval enable_$f=yes],
121 [*,"$f"], [eval enable_$f=yes],
122 [*,"$f",*], [eval enable_$f=yes],
125 AC_SUBST([enable_frontends])
127 #----------------------------------------
128 # Dependencies that will be needed, depending on the frontends
130 ["$enable_mconf":"$enable_nconf"],
131 [*yes*], [need_curses=yes],
132 [*auto*], [need_curses=auto],
134 [need_panel_menu="$enable_nconf"]
136 ["$enable_gconf":"$enable_qconf"],
137 [*yes*], [need_pkgconfig=yes],
138 [*auto*], [need_pkgconfig=yes],
139 [need_pkgconfig=no ])
140 [need_gtk="$enable_gconf"]
141 [need_qt="$enable_qconf"]
143 #---------------------------------------------------------------------------
144 # Now check we have the required stuff
146 #----------------------------------------
147 # Some program checks
158 [AC_MSG_ERROR([can not find gperf])])
160 [test "$need_pkgconfig" = "yes"],
161 [PKG_PROG_PKG_CONFIG()])
163 AC_SUBST([AM_LFLAGS], ["-L -P zconf"])
165 AC_SUBST([AM_YFLAGS], ["-t -l -p zconf"])
167 #----------------------------------------
168 # Check for standard headers
171 AC_CHECK_HEADERS([ fcntl.h libintl.h limits.h locale.h ])
172 AC_CHECK_HEADERS([ stdlib.h string.h sys/time.h unistd.h ])
175 #----------------------------------------
176 # Checks for library functions.
180 AC_CHECK_FUNCS([ bzero memmove memset ])
181 AC_CHECK_FUNCS([ strcasecmp strchr strcspn strdup strncasecmp strpbrk strrchr strspn strtol ])
182 AC_CHECK_FUNCS([ gettimeofday mkdir regcomp setlocale uname ])
184 #----------------------------------------
185 # Check for gettext, for the kconfig frontends
189 [ac_ct_gettext_hdr=$ac_header; break],
190 [AC_MSG_WARN([libintl is missing, frontends will not be localised])])
192 [test -n "$ac_ct_gettext_hdr"],
195 [AC_MSG_WARN([gettext is missing, frontends will not be localised])
196 GETTEXT=-DKBUILD_NO_NLS],
197 [#include <$ac_ct_gettext_hdr>])])
199 #----------------------------------------
200 # Check for ncurses, for the mconf & nconf frontends
202 [test "$need_curses" = "yes" -o "$need_curses" = "auto"],
203 [AC_SUBST([CURSES_LOC])
204 AC_SUBST([ncurses_LIBS])
208 [ncurses/ncurses.h ncurses/curses.h ncursesw/curses.h ncurses.h curses.h],
209 [CURSES_LOC=$ac_header; break])
211 [test -z "$CURSES_LOC"],
213 [test "$need_curses" = "yes"],
214 [AC_MSG_ERROR([could not find curses headers (frontends: mconf/nconf)])],
218 [ncursesw ncurses curses],
219 [ac_ct_curses_lib_found=yes; break])
221 [test -z "$ac_ct_curses_lib_found"],
223 [test "$need_curses" = "yes"],
224 [AC_MSG_ERROR([could not find curses library (frontends: mconf/nconf)])],
230 [test "$has_curses" = "no" ],
231 [enable_mconf=no; enable_nconf=no])
233 #----------------------------------------
234 # Check for libpanel and libmenu, for the nconf frontend
236 [test "$need_panel_menu" = "yes" -o "$need_panel_menu" = "auto"],
237 [AC_SUBST([ncurses_extra_LIBS])
243 [ac_ct_panel_lib_found=yes; break],,
246 [test -z "$ac_ct_panel_lib_found"],
248 [test "$need_panel_menu" = "yes"],
249 [AC_MSG_ERROR([could not find libpanel library (frontend: nconf)])],
250 [has_panel_menu=no])])
254 [ac_ct_menu_lib_found=yes; break],,
257 [test -z "$ac_ct_panel_lib_found"],
259 [test "$need_panel_menu" = "yes"],
260 [AC_MSG_ERROR([could not find libmenu library (frontend: nconf)])],
261 [has_panel_menu=no])])
262 ncurses_extra_LIBS="$LIBS"
266 [test "$has_panel_menu" = "no" ],
269 #----------------------------------------
270 # Check headers and libs for gconf
272 [test "$need_gtk" = "yes" -o "$need_gtk" = "auto"],
275 [gtk+-2.0 gmodule-2.0 libglade-2.0],
278 [test "$need_gtk" = "yes"],
279 [AC_MSG_ERROR([could not find GTK+ headers and/or libraries (frontend: gconf)])],
283 [test "$has_gtk" = "no" ],
286 #----------------------------------------
287 # Check headers and libs for qconf
289 [test "$need_qt" = "yes" -o "$need_qt" = "auto"],
292 [QtCore QtGui Qt3Support],
293 [has_qt=yes; need_moc="$need_qt"],
295 [test "$need_qt" = "yes"],
296 [AC_MSG_ERROR([could not find QT4 headers and/or libraries (frontend: qconf)])],
297 [has_qt=no; need_moc=no])])])
299 AC_ARG_VAR([MOC], [Qt meta object compiler (moc) command])
301 [test "$need_moc" = "yes" -o "$need_moc" = "auto"],
302 [QT4_BINDIR=`$PKG_CONFIG Qt --variable bindir`
311 [test "$need_moc" = "yes"],
312 [AC_MSG_ERROR([could not find moc (frontend: qconf)])],
316 [test "$has_qt" = "no" -o "$has_moc" = "no"],
319 #----------------------------------------
320 # Per-frontends extra libraries
321 AC_ARG_VAR([conf_EXTRA_LIBS], [Extra libraries to build the conf frontend] )
322 AC_ARG_VAR([gconf_EXTRA_LIBS], [Extra libraries to build the gconf frontend])
323 AC_ARG_VAR([mconf_EXTRA_LIBS], [Extra libraries to build the mconf frontend])
324 AC_ARG_VAR([nconf_EXTRA_LIBS], [Extra libraries to build the nconf frontend])
325 AC_ARG_VAR([qconf_EXTRA_LIBS], [Extra libraries to build the qconf frontend])
327 #---------------------------------------------------------------------------
328 # Now, we know what frontends to enable
329 AS_IF([test "$enable_conf" = "auto"], [enable_conf=yes ])
330 AS_IF([test "$enable_gconf" = "auto"], [enable_gconf=yes])
331 AS_IF([test "$enable_mconf" = "auto"], [enable_mconf=yes])
332 AS_IF([test "$enable_nconf" = "auto"], [enable_nconf=yes])
333 AS_IF([test "$enable_qconf" = "auto"], [enable_qconf=yes])
335 #----------------------------------------
336 # Check if the lxdialog library should be built
338 [test "$enable_mconf" = "yes"],
342 #----------------------------------------
343 # Setup automake conditional build
346 [test "$enable_conf" = "yes"])
349 [test "$enable_mconf" = "yes"])
352 [test "$enable_nconf" = "yes"])
355 [test "$enable_gconf" = "yes"])
358 [test "$enable_qconf" = "yes"])
361 [test "$need_lxdialog" = "yes"])
363 #----------------------------------------
364 # Get the version to apply to the parser shared library
366 [KCONFIGPARSER_LIB_VERSION],
367 [m4_esyscmd_s([./scripts/version.sh --plain])])
369 #----------------------------------------
375 libs/lxdialog/Makefile
378 frontends/conf/Makefile
379 frontends/mconf/Makefile
380 frontends/nconf/Makefile
381 frontends/gconf/Makefile
382 frontends/qconf/Makefile
387 AC_MSG_NOTICE([Configured with:])
388 AS_IF([test "$enable_werror" = "yes"],
389 [AC_MSG_NOTICE([- treat warnings as errors: yes])],
390 [AC_MSG_NOTICE([- treat warnings as errors: no])])
391 AC_MSG_NOTICE([- root-menu prompt: '$root_menu'])
392 AC_MSG_NOTICE([- config prefix: '$config_prefix'])
393 AC_MSG_NOTICE([- frontends:])
394 AS_IF([test "$enable_conf" = "yes"],
395 [AC_MSG_NOTICE([ - conf: yes])],
396 [AC_MSG_NOTICE([ - conf: no])])
397 AS_IF([test "$enable_gconf" = "yes"],
398 [AC_MSG_NOTICE([ - gconf: yes])],
399 [AC_MSG_NOTICE([ - gconf: no])])
400 AS_IF([test "$enable_mconf" = "yes"],
401 [AC_MSG_NOTICE([ - mconf: yes])],
402 [AC_MSG_NOTICE([ - mconf: no])])
403 AS_IF([test "$enable_nconf" = "yes"],
404 [AC_MSG_NOTICE([ - nconf: yes])],
405 [AC_MSG_NOTICE([ - nconf: no])])
406 AS_IF([test "$enable_qconf" = "yes"],
407 [AC_MSG_NOTICE([ - qconf: yes])],
408 [AC_MSG_NOTICE([ - qconf: no])])
409 AC_MSG_NOTICE([- parser library:])
410 AS_IF([test "$enable_shared" = "yes"],
411 [AC_MSG_NOTICE([ - shared: yes, versioned $KCONFIGPARSER_LIB_VERSION])],
412 [AC_MSG_NOTICE([ - shared: no])])
413 AC_MSG_NOTICE([ - static: $enable_static])