2 # Process this file with autoconf to produce a configure script.
7 [m4_esyscmd_s([./scripts/version.sh])],
9 AC_CONFIG_SRCDIR([frontends/conf/conf.c])
10 # Use a config.h to avoid brazilions -DHAVE_FOO on compile lines
11 AC_CONFIG_HEADERS([config.h])
12 AC_CONFIG_AUX_DIR([scripts])
14 # Checks for programs.
19 # Checks for libraries.
22 # Checks for header files.
24 # The folowing AC_CHECK_HEADERS was a single big line
25 AC_CHECK_HEADERS([ fcntl.h libintl.h limits.h locale.h ])
26 AC_CHECK_HEADERS([ stdlib.h string.h sys/time.h unistd.h ])
28 # Checks for typedefs, structures, and compiler characteristics.
33 # Checks for library functions.
37 # The following AC_CHECK_FUNCS was a single big line
38 AC_CHECK_FUNCS([ bzero memmove memset ])
39 AC_CHECK_FUNCS([ strcasecmp strchr strcspn strdup strncasecmp strpbrk strrchr strspn strtol ])
40 AC_CHECK_FUNCS([ gettimeofday mkdir regcomp setlocale uname ])
42 # End of the autoscan-detected stuff
43 #---------------------------------------------------------------------------
45 #----------------------------------------
47 # Although there is a default (="linux") in the code, we do provide
48 # a default here, to get a consistent autostuff behavior
52 [--enable-package-name],
53 [set the package name (default=kconfig-frontends)])],
56 [yes], [package_name=$PACKAGE_NAME],
57 [no], [package_name=],
58 [package_name=$enableval])])
59 AC_SUBST([package_name], [${package_name=$PACKAGE_NAME}])
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 # Some program checks
136 [AC_MSG_ERROR([can not find gperf])])
137 AC_SUBST([AM_LFLAGS], ["-L -P zconf"])
138 AC_SUBST([AM_YFLAGS], ["-t -l -p zconf"])
140 #----------------------------------------
141 # Check for gettext, for the kconfig frontends
145 [ac_ct_gettext_hdr=$ac_header; break],
146 [AC_MSG_WARN([libintl is missing, frontends will not be localised])])
148 [test -n "$ac_ct_gettext_hdr"],
151 [AC_MSG_WARN([gettext is missing, frontends will not be localised])
152 GETTEXT=-DKBUILD_NO_NLS],
153 [#include <$ac_ct_gettext_hdr>])])
155 #----------------------------------------
156 # Check for ncurses, for the mconf & nconf frontends
158 ["$enable_mconf":"$enable_nconf"],
159 [yes:*], [need_curses=yes],
160 [*:yes], [need_curses=yes],
161 [auto:*], [need_curses=auto],
162 [*:auto], [need_curses=auto],
166 [test "$need_curses" = "yes" -o "$need_curses" = "auto"],
167 [AC_SUBST([CURSES_LOC])
168 AC_SUBST([ncurses_LIBS])
171 [ncurses/ncurses.h ncurses/curses.h ncursesw/curses.h ncurses.h curses.h],
172 [CURSES_LOC=$ac_header; break])
174 [test -z "$CURSES_LOC"],
176 [test "$need_curses" = "yes"],
177 [AC_MSG_ERROR([could not find curses headers (frontends: mconf/nconf)])],
181 [ncursesw ncurses curses],
182 [ac_ct_curses_lib_found=yes; break])
184 [test -z "$ac_ct_curses_lib_found"],
186 [test "$need_curses" = "yes"],
187 [AC_MSG_ERROR([could not find curses library (frontends: mconf/nconf)])],
193 [test "$has_curses" = "no" ],
194 [enable_mconf=no; enable_nconf=no])
196 #----------------------------------------
197 # Check for libpanel and libmenu, for the nconf frontend
198 [need_panel_menu="$enable_nconf"]
201 [test "$need_panel_menu" = "yes" -o "$need_panel_menu" = "auto"],
202 [AC_SUBST([ncurses_extra_LIBS])
207 [ac_ct_panel_lib_found=yes; break])
209 [test -z "$ac_ct_panel_lib_found"],
211 [test "$need_panel_menu" = "yes"],
212 [AC_MSG_ERROR([could not find libpanel library (frontend: nconf)])],
213 [has_panel_menu=no])])
217 [ac_ct_menu_lib_found=yes; break])
219 [test -z "$ac_ct_panel_lib_found"],
221 [test "$need_panel_menu" = "yes"],
222 [AC_MSG_ERROR([could not find libmenu library (frontend: nconf)])],
223 [has_panel_menu=no])])
224 ncurses_extra_LIBS="$LIBS"
228 [test "$has_panel_menu" = "no" ],
231 #----------------------------------------
232 # Check pkg-config if needed
234 ["$enable_gconf":"$enable_qconf"],
235 [yes:*], [need_pkgconfig=yes],
236 [*:yes], [need_pkgconfig=yes],
237 [auto:*], [need_pkgconfig=yes],
238 [*:auto], [need_pkgconfig=yes],
239 [need_pkgconfig=no ])
242 [test "$need_pkgconfig" = "yes"],
243 [PKG_PROG_PKG_CONFIG()])
245 #----------------------------------------
246 # Check headers and libs for gconf
247 [need_gtk="$enable_gconf"]
250 [test "$need_gtk" = "yes" -o "$need_gtk" = "auto"],
253 [gtk+-2.0 gmodule-2.0 libglade-2.0],
256 [test "$need_gtk" = "yes"],
257 [AC_MSG_ERROR([could not find GTK+ headers and/or libraries (frontend: gconf)])],
261 [test "$has_gtk" = "no" ],
264 #----------------------------------------
265 # Check headers and libs for gconf
266 [need_qt="$enable_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 #---------------------------------------------------------------------------
304 [test "$enable_conf" = "yes"])
307 [test "$enable_mconf" = "yes"])
310 [test "$enable_nconf" = "yes"])
313 [test "$enable_gconf" = "yes"])
316 [test "$enable_qconf" = "yes"])
319 [test "$need_lxdialog" = "yes"])
321 #---------------------------------------------------------------------------
323 LT_INIT([disable-static])
325 #----------------------------------------
326 # Get the version to apply to the parser shared library
328 [KCONFIGPARSER_LIB_VERSION],
329 [m4_esyscmd_s([./scripts/version.sh --plain])])
331 #----------------------------------------
336 libs/lxdialog/Makefile
339 frontends/conf/Makefile
340 frontends/mconf/Makefile
341 frontends/nconf/Makefile
342 frontends/gconf/Makefile
343 frontends/qconf/Makefile
347 AC_MSG_NOTICE([Configured with:])
348 AC_MSG_NOTICE([- package name: '$package_name'])
349 AC_MSG_NOTICE([- config prefix: '$config_prefix'])
350 AC_MSG_NOTICE([- frontends:])
351 AS_IF([test "$enable_conf" = "yes"],
352 [AC_MSG_NOTICE([ - conf: yes])],
353 [AC_MSG_NOTICE([ - conf: no])])
354 AS_IF([test "$enable_gconf" = "yes"],
355 [AC_MSG_NOTICE([ - gconf: yes])],
356 [AC_MSG_NOTICE([ - gconf: no])])
357 AS_IF([test "$enable_mconf" = "yes"],
358 [AC_MSG_NOTICE([ - mconf: yes])],
359 [AC_MSG_NOTICE([ - mconf: no])])
360 AS_IF([test "$enable_nconf" = "yes"],
361 [AC_MSG_NOTICE([ - nconf: yes])],
362 [AC_MSG_NOTICE([ - nconf: no])])
363 AS_IF([test "$enable_qconf" = "yes"],
364 [AC_MSG_NOTICE([ - qconf: yes])],
365 [AC_MSG_NOTICE([ - qconf: no])])
366 AC_MSG_NOTICE([- parser library:])
367 AS_IF([test "$enable_shared" = "yes"],
368 [AC_MSG_NOTICE([ - shared: yes, versioned $KCONFIGPARSER_LIB_VERSION])],
369 [AC_MSG_NOTICE([ - shared: no])])
370 AC_MSG_NOTICE([ - static: $enable_static])