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-package-name],
37 [set the package name (default=kconfig-frontends)])],
40 [yes], [package_name=$PACKAGE_NAME],
41 [no], [package_name=],
42 [package_name=$enableval])])
43 AC_SUBST([package_name], [${package_name=$PACKAGE_NAME}])
48 [--enable-config-prefix=PREFIX],
49 [the prefix to the config option (default=CONFIG_)])],
52 [*" "*],[AC_MSG_ERROR([config prefix can not contain spaces: '$enableval'])],
53 [yes], [config_prefix=CONFIG_],
54 [no], [config_prefix=],
55 [config_prefix=$enableval])])
56 AC_SUBST([config_prefix], [${config_prefix-CONFIG_}])
58 #----------------------------------------
59 # Options to selectively enable/disable frontends
60 # All are selected by default
65 [conf, the stdin-based frontend (default=auto)])])
66 AC_SUBST([enable_conf], [${enable_conf:-auto}])
71 [mconf, the traditional ncurses-based frontend (default=auto)])])
72 AC_SUBST([enable_mconf], [${enable_mconf:-auto}])
77 [nconf, the modern ncurses-based frontend (default=auto)])])
78 AC_SUBST([enable_nconf], [${enable_nconf:-auto}])
83 [gconf, the GTK-based frontend (default=auto)])])
84 AC_SUBST([enable_gconf], [${enable_gconf:-auto}])
89 [qconf, the QT-based frontend (default=auto)])])
90 AC_SUBST([enable_qconf], [${enable_qconf:-auto}])
95 [--enable-frontends=list],
96 [enables only the set of frontends in comma-separated 'list'
97 (default: auto selection), takes precedence over all
98 --enable-*conf, above])],
99 [for f in conf mconf nconf gconf qconf; do
102 [yes], [eval enable_$f=yes],
103 ["$f"], [eval enable_$f=yes],
104 ["$f",*], [eval enable_$f=yes],
105 [*,"$f"], [eval enable_$f=yes],
106 [*,"$f",*], [eval enable_$f=yes],
109 AC_SUBST([enable_frontends])
111 #----------------------------------------
112 # Dependencies that will be needed, depending on the frontends
114 ["$enable_mconf":"$enable_nconf"],
115 [*yes*], [need_curses=yes],
116 [*auto*], [need_curses=auto],
118 [need_panel_menu="$enable_nconf"]
120 ["$enable_gconf":"$enable_qconf"],
121 [*yes*], [need_pkgconfig=yes],
122 [*auto*], [need_pkgconfig=yes],
123 [need_pkgconfig=no ])
124 [need_gtk="$enable_gconf"]
125 [need_qt="$enable_qconf"]
127 #---------------------------------------------------------------------------
128 # Now check we have the required stuff
130 #----------------------------------------
131 # Some program checks
142 [AC_MSG_ERROR([can not find gperf])])
144 [test "$need_pkgconfig" = "yes"],
145 [PKG_PROG_PKG_CONFIG()])
147 AC_SUBST([AM_LFLAGS], ["-L -P zconf"])
149 AC_SUBST([AM_YFLAGS], ["-t -l -p zconf"])
151 #----------------------------------------
152 # Check for standard headers
155 AC_CHECK_HEADERS([ fcntl.h libintl.h limits.h locale.h ])
156 AC_CHECK_HEADERS([ stdlib.h string.h sys/time.h unistd.h ])
159 #----------------------------------------
160 # Checks for library functions.
164 AC_CHECK_FUNCS([ bzero memmove memset ])
165 AC_CHECK_FUNCS([ strcasecmp strchr strcspn strdup strncasecmp strpbrk strrchr strspn strtol ])
166 AC_CHECK_FUNCS([ gettimeofday mkdir regcomp setlocale uname ])
168 #----------------------------------------
169 # Check for gettext, for the kconfig frontends
173 [ac_ct_gettext_hdr=$ac_header; break],
174 [AC_MSG_WARN([libintl is missing, frontends will not be localised])])
176 [test -n "$ac_ct_gettext_hdr"],
179 [AC_MSG_WARN([gettext is missing, frontends will not be localised])
180 GETTEXT=-DKBUILD_NO_NLS],
181 [#include <$ac_ct_gettext_hdr>])])
183 #----------------------------------------
184 # Check for ncurses, for the mconf & nconf frontends
186 [test "$need_curses" = "yes" -o "$need_curses" = "auto"],
187 [AC_SUBST([CURSES_LOC])
188 AC_SUBST([ncurses_LIBS])
191 [ncurses/ncurses.h ncurses/curses.h ncursesw/curses.h ncurses.h curses.h],
192 [CURSES_LOC=$ac_header; break])
194 [test -z "$CURSES_LOC"],
196 [test "$need_curses" = "yes"],
197 [AC_MSG_ERROR([could not find curses headers (frontends: mconf/nconf)])],
201 [ncursesw ncurses curses],
202 [ac_ct_curses_lib_found=yes; break])
204 [test -z "$ac_ct_curses_lib_found"],
206 [test "$need_curses" = "yes"],
207 [AC_MSG_ERROR([could not find curses library (frontends: mconf/nconf)])],
213 [test "$has_curses" = "no" ],
214 [enable_mconf=no; enable_nconf=no])
216 #----------------------------------------
217 # Check for libpanel and libmenu, for the nconf frontend
219 [test "$need_panel_menu" = "yes" -o "$need_panel_menu" = "auto"],
220 [AC_SUBST([ncurses_extra_LIBS])
225 [ac_ct_panel_lib_found=yes; break])
227 [test -z "$ac_ct_panel_lib_found"],
229 [test "$need_panel_menu" = "yes"],
230 [AC_MSG_ERROR([could not find libpanel library (frontend: nconf)])],
231 [has_panel_menu=no])])
235 [ac_ct_menu_lib_found=yes; break])
237 [test -z "$ac_ct_panel_lib_found"],
239 [test "$need_panel_menu" = "yes"],
240 [AC_MSG_ERROR([could not find libmenu library (frontend: nconf)])],
241 [has_panel_menu=no])])
242 ncurses_extra_LIBS="$LIBS"
246 [test "$has_panel_menu" = "no" ],
249 #----------------------------------------
250 # Check headers and libs for gconf
252 [test "$need_gtk" = "yes" -o "$need_gtk" = "auto"],
255 [gtk+-2.0 gmodule-2.0 libglade-2.0],
258 [test "$need_gtk" = "yes"],
259 [AC_MSG_ERROR([could not find GTK+ headers and/or libraries (frontend: gconf)])],
263 [test "$has_gtk" = "no" ],
266 #----------------------------------------
267 # Check headers and libs for qconf
269 [test "$need_qt" = "yes" -o "$need_qt" = "auto"],
272 [QtCore QtGui Qt3Support],
275 [test "$need_qt" = "yes"],
276 [AC_MSG_ERROR([could not find QT4 headers and/or libraries (frontend: qconf)])],
280 [test "$has_qt" = "no" ],
283 #---------------------------------------------------------------------------
284 # Now, we know what frontends to enable
285 AS_IF([test "$enable_conf" = "auto"], [enable_conf=yes ])
286 AS_IF([test "$enable_gconf" = "auto"], [enable_gconf=yes])
287 AS_IF([test "$enable_mconf" = "auto"], [enable_mconf=yes])
288 AS_IF([test "$enable_nconf" = "auto"], [enable_nconf=yes])
289 AS_IF([test "$enable_qconf" = "auto"], [enable_qconf=yes])
291 #----------------------------------------
292 # Check if the lxdialog library should be built
294 [test "$enable_mconf" = "yes"],
298 #----------------------------------------
299 # Setup automake conditional build
302 [test "$enable_conf" = "yes"])
305 [test "$enable_mconf" = "yes"])
308 [test "$enable_nconf" = "yes"])
311 [test "$enable_gconf" = "yes"])
314 [test "$enable_qconf" = "yes"])
317 [test "$need_lxdialog" = "yes"])
319 #----------------------------------------
320 # Get the version to apply to the parser shared library
322 [KCONFIGPARSER_LIB_VERSION],
323 [m4_esyscmd_s([./scripts/version.sh --plain])])
325 #----------------------------------------
331 libs/lxdialog/Makefile
334 frontends/conf/Makefile
335 frontends/mconf/Makefile
336 frontends/nconf/Makefile
337 frontends/gconf/Makefile
338 frontends/qconf/Makefile
343 AC_MSG_NOTICE([Configured with:])
344 AC_MSG_NOTICE([- package name: '$package_name'])
345 AC_MSG_NOTICE([- config prefix: '$config_prefix'])
346 AC_MSG_NOTICE([- frontends:])
347 AS_IF([test "$enable_conf" = "yes"],
348 [AC_MSG_NOTICE([ - conf: yes])],
349 [AC_MSG_NOTICE([ - conf: no])])
350 AS_IF([test "$enable_gconf" = "yes"],
351 [AC_MSG_NOTICE([ - gconf: yes])],
352 [AC_MSG_NOTICE([ - gconf: no])])
353 AS_IF([test "$enable_mconf" = "yes"],
354 [AC_MSG_NOTICE([ - mconf: yes])],
355 [AC_MSG_NOTICE([ - mconf: no])])
356 AS_IF([test "$enable_nconf" = "yes"],
357 [AC_MSG_NOTICE([ - nconf: yes])],
358 [AC_MSG_NOTICE([ - nconf: no])])
359 AS_IF([test "$enable_qconf" = "yes"],
360 [AC_MSG_NOTICE([ - qconf: yes])],
361 [AC_MSG_NOTICE([ - qconf: no])])
362 AC_MSG_NOTICE([- parser library:])
363 AS_IF([test "$enable_shared" = "yes"],
364 [AC_MSG_NOTICE([ - shared: yes, versioned $KCONFIGPARSER_LIB_VERSION])],
365 [AC_MSG_NOTICE([ - shared: no])])
366 AC_MSG_NOTICE([ - static: $enable_static])