2 # Process this file with autoconf to produce a configure script.
4 #---------------------------------------------------------------------------
5 # Global initialisation
7 #----------------------------------------
12 [m4_esyscmd_s([./scripts/version.sh])],
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/scritps])
18 AC_CONFIG_MACRO_DIR([scripts/.autostuff/m4])
20 #----------------------------------------
24 #----------------------------------------
27 LT_INIT([disable-static])
29 #---------------------------------------------------------------------------
31 # Although there is a default (="linux") in the code, we do provide
32 # a default here, to get a consistent autostuff behavior
36 [--enable-root-menu-prompt=PROMPT],
37 [set the root-menu prompt (default=Configuration)])],
40 [yes], [root_menu=Configuration],
42 [# Escape the $ signs, otherwise they would get munged by make
43 # Also, append a space at the end, to separate the package
44 # name from the literal 'Configuration'
45 root_menu="$( echo "$enableval" |sed -r -e 's/\$/\\$$/g;' )"])])
46 AC_SUBST([root_menu], [${root_menu=Configuration}])
51 [--enable-config-prefix=PREFIX],
52 [the prefix to the config option (default=CONFIG_)])],
55 [*" "*],[AC_MSG_ERROR([config prefix can not contain spaces: '$enableval'])],
56 [yes], [config_prefix=CONFIG_],
57 [no], [config_prefix=],
58 [config_prefix=$enableval])])
59 AC_SUBST([config_prefix], [${config_prefix-CONFIG_}])
61 #----------------------------------------
62 # Options to selectively enable/disable frontends
63 # All are selected by default
68 [conf, the stdin-based frontend (default=auto)])])
69 AC_SUBST([enable_conf], [${enable_conf:-auto}])
74 [mconf, the traditional ncurses-based frontend (default=auto)])])
75 AC_SUBST([enable_mconf], [${enable_mconf:-auto}])
80 [nconf, the modern ncurses-based frontend (default=auto)])])
81 AC_SUBST([enable_nconf], [${enable_nconf:-auto}])
86 [gconf, the GTK-based frontend (default=auto)])])
87 AC_SUBST([enable_gconf], [${enable_gconf:-auto}])
92 [qconf, the QT-based frontend (default=auto)])])
93 AC_SUBST([enable_qconf], [${enable_qconf:-auto}])
98 [--enable-frontends=list],
99 [enables only the set of frontends in comma-separated 'list'
100 (default: auto selection), takes precedence over all
101 --enable-*conf, above])],
102 [for f in conf mconf nconf gconf qconf; do
105 [yes], [eval enable_$f=yes],
106 ["$f"], [eval enable_$f=yes],
107 ["$f",*], [eval enable_$f=yes],
108 [*,"$f"], [eval enable_$f=yes],
109 [*,"$f",*], [eval enable_$f=yes],
112 AC_SUBST([enable_frontends])
114 #----------------------------------------
115 # Dependencies that will be needed, depending on the frontends
117 ["$enable_mconf":"$enable_nconf"],
118 [*yes*], [need_curses=yes],
119 [*auto*], [need_curses=auto],
121 [need_panel_menu="$enable_nconf"]
123 ["$enable_gconf":"$enable_qconf"],
124 [*yes*], [need_pkgconfig=yes],
125 [*auto*], [need_pkgconfig=yes],
126 [need_pkgconfig=no ])
127 [need_gtk="$enable_gconf"]
128 [need_qt="$enable_qconf"]
130 #---------------------------------------------------------------------------
131 # Now check we have the required stuff
133 #----------------------------------------
134 # Some program checks
145 [AC_MSG_ERROR([can not find gperf])])
147 [test "$need_pkgconfig" = "yes"],
148 [PKG_PROG_PKG_CONFIG()])
150 AC_SUBST([AM_LFLAGS], ["-L -P zconf"])
152 AC_SUBST([AM_YFLAGS], ["-t -l -p zconf"])
154 #----------------------------------------
155 # Check for standard headers
158 AC_CHECK_HEADERS([ fcntl.h libintl.h limits.h locale.h ])
159 AC_CHECK_HEADERS([ stdlib.h string.h sys/time.h unistd.h ])
162 #----------------------------------------
163 # Checks for library functions.
167 AC_CHECK_FUNCS([ bzero memmove memset ])
168 AC_CHECK_FUNCS([ strcasecmp strchr strcspn strdup strncasecmp strpbrk strrchr strspn strtol ])
169 AC_CHECK_FUNCS([ gettimeofday mkdir regcomp setlocale uname ])
171 #----------------------------------------
172 # Check for gettext, for the kconfig frontends
176 [ac_ct_gettext_hdr=$ac_header; break],
177 [AC_MSG_WARN([libintl is missing, frontends will not be localised])])
179 [test -n "$ac_ct_gettext_hdr"],
182 [AC_MSG_WARN([gettext is missing, frontends will not be localised])
183 GETTEXT=-DKBUILD_NO_NLS],
184 [#include <$ac_ct_gettext_hdr>])])
186 #----------------------------------------
187 # Check for ncurses, for the mconf & nconf frontends
189 [test "$need_curses" = "yes" -o "$need_curses" = "auto"],
190 [AC_SUBST([CURSES_LOC])
191 AC_SUBST([ncurses_LIBS])
195 [ncurses/ncurses.h ncurses/curses.h ncursesw/curses.h ncurses.h curses.h],
196 [CURSES_LOC=$ac_header; break])
198 [test -z "$CURSES_LOC"],
200 [test "$need_curses" = "yes"],
201 [AC_MSG_ERROR([could not find curses headers (frontends: mconf/nconf)])],
205 [ncursesw ncurses curses],
206 [ac_ct_curses_lib_found=yes; break])
208 [test -z "$ac_ct_curses_lib_found"],
210 [test "$need_curses" = "yes"],
211 [AC_MSG_ERROR([could not find curses library (frontends: mconf/nconf)])],
217 [test "$has_curses" = "no" ],
218 [enable_mconf=no; enable_nconf=no])
220 #----------------------------------------
221 # Check for libpanel and libmenu, for the nconf frontend
223 [test "$need_panel_menu" = "yes" -o "$need_panel_menu" = "auto"],
224 [AC_SUBST([ncurses_extra_LIBS])
230 [ac_ct_panel_lib_found=yes; break],,
233 [test -z "$ac_ct_panel_lib_found"],
235 [test "$need_panel_menu" = "yes"],
236 [AC_MSG_ERROR([could not find libpanel library (frontend: nconf)])],
237 [has_panel_menu=no])])
241 [ac_ct_menu_lib_found=yes; break],,
244 [test -z "$ac_ct_panel_lib_found"],
246 [test "$need_panel_menu" = "yes"],
247 [AC_MSG_ERROR([could not find libmenu library (frontend: nconf)])],
248 [has_panel_menu=no])])
249 ncurses_extra_LIBS="$LIBS"
253 [test "$has_panel_menu" = "no" ],
256 #----------------------------------------
257 # Check headers and libs for gconf
259 [test "$need_gtk" = "yes" -o "$need_gtk" = "auto"],
262 [gtk+-2.0 gmodule-2.0 libglade-2.0],
265 [test "$need_gtk" = "yes"],
266 [AC_MSG_ERROR([could not find GTK+ headers and/or libraries (frontend: gconf)])],
270 [test "$has_gtk" = "no" ],
273 #----------------------------------------
274 # Check headers and libs for qconf
276 [test "$need_qt" = "yes" -o "$need_qt" = "auto"],
279 [QtCore QtGui Qt3Support],
282 [test "$need_qt" = "yes"],
283 [AC_MSG_ERROR([could not find QT4 headers and/or libraries (frontend: qconf)])],
287 [test "$has_qt" = "no" ],
290 #---------------------------------------------------------------------------
291 # Now, we know what frontends to enable
292 AS_IF([test "$enable_conf" = "auto"], [enable_conf=yes ])
293 AS_IF([test "$enable_gconf" = "auto"], [enable_gconf=yes])
294 AS_IF([test "$enable_mconf" = "auto"], [enable_mconf=yes])
295 AS_IF([test "$enable_nconf" = "auto"], [enable_nconf=yes])
296 AS_IF([test "$enable_qconf" = "auto"], [enable_qconf=yes])
298 #----------------------------------------
299 # Check if the lxdialog library should be built
301 [test "$enable_mconf" = "yes"],
305 #----------------------------------------
306 # Setup automake conditional build
309 [test "$enable_conf" = "yes"])
312 [test "$enable_mconf" = "yes"])
315 [test "$enable_nconf" = "yes"])
318 [test "$enable_gconf" = "yes"])
321 [test "$enable_qconf" = "yes"])
324 [test "$need_lxdialog" = "yes"])
326 #----------------------------------------
327 # Get the version to apply to the parser shared library
329 [KCONFIGPARSER_LIB_VERSION],
330 [m4_esyscmd_s([./scripts/version.sh --plain])])
332 #----------------------------------------
338 libs/lxdialog/Makefile
341 frontends/conf/Makefile
342 frontends/mconf/Makefile
343 frontends/nconf/Makefile
344 frontends/gconf/Makefile
345 frontends/qconf/Makefile
350 AC_MSG_NOTICE([Configured with:])
351 AC_MSG_NOTICE([- root-menu prompt: '$root_menu'])
352 AC_MSG_NOTICE([- config prefix: '$config_prefix'])
353 AC_MSG_NOTICE([- frontends:])
354 AS_IF([test "$enable_conf" = "yes"],
355 [AC_MSG_NOTICE([ - conf: yes])],
356 [AC_MSG_NOTICE([ - conf: no])])
357 AS_IF([test "$enable_gconf" = "yes"],
358 [AC_MSG_NOTICE([ - gconf: yes])],
359 [AC_MSG_NOTICE([ - gconf: no])])
360 AS_IF([test "$enable_mconf" = "yes"],
361 [AC_MSG_NOTICE([ - mconf: yes])],
362 [AC_MSG_NOTICE([ - mconf: no])])
363 AS_IF([test "$enable_nconf" = "yes"],
364 [AC_MSG_NOTICE([ - nconf: yes])],
365 [AC_MSG_NOTICE([ - nconf: no])])
366 AS_IF([test "$enable_qconf" = "yes"],
367 [AC_MSG_NOTICE([ - qconf: yes])],
368 [AC_MSG_NOTICE([ - qconf: no])])
369 AC_MSG_NOTICE([- parser library:])
370 AS_IF([test "$enable_shared" = "yes"],
371 [AC_MSG_NOTICE([ - shared: yes, versioned $KCONFIGPARSER_LIB_VERSION])],
372 [AC_MSG_NOTICE([ - shared: no])])
373 AC_MSG_NOTICE([ - static: $enable_static])