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}])
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 # Some program checks
123 [AC_MSG_ERROR([can not find gperf])])
124 AC_SUBST([AM_LFLAGS], ["-L -P zconf"])
125 AC_SUBST([AM_YFLAGS], ["-t -l -p zconf"])
127 #----------------------------------------
128 # Check for gettext, for the kconfig frontends
132 [ac_ct_gettext_hdr=$ac_header; break],
133 [AC_MSG_WARN([libintl is missing, frontends will not be localised])])
135 [test -n "$ac_ct_gettext_hdr"],
138 [AC_MSG_WARN([gettext is missing, frontends will not be localised])
139 GETTEXT=-DKBUILD_NO_NLS],
140 [#include <$ac_ct_gettext_hdr>])])
142 #----------------------------------------
143 # Check for ncurses, for the mconf & nconf frontends
145 ["$enable_mconf":"$enable_nconf"],
146 [yes:*], [need_curses=yes],
147 [*:yes], [need_curses=yes],
148 [auto:*], [need_curses=auto],
149 [*:auto], [need_curses=auto],
153 [test "$need_curses" = "yes" -o "$need_curses" = "auto"],
154 [AC_SUBST([CURSES_LOC])
155 AC_SUBST([ncurses_LIBS])
158 [ncurses/ncurses.h ncurses/curses.h ncursesw/curses.h ncurses.h curses.h],
159 [CURSES_LOC=$ac_header; break])
161 [test -z "$CURSES_LOC"],
163 [test "$need_curses" = "yes"],
164 [AC_MSG_ERROR([could not find curses headers (frontends: mconf/nconf)])],
168 [ncursesw ncurses curses],
169 [ac_ct_curses_lib_found=yes; break])
171 [test -z "$ac_ct_curses_lib_found"],
173 [test "$need_curses" = "yes"],
174 [AC_MSG_ERROR([could not find curses library (frontends: mconf/nconf)])],
180 [test "$has_curses" = "no" ],
181 [enable_mconf=no; enable_nconf=no])
183 #----------------------------------------
184 # Check for libpanel and libmenu, for the nconf frontend
185 [need_panel_menu="$enable_nconf"]
188 [test "$need_panel_menu" = "yes" -o "$need_panel_menu" = "auto"],
189 [AC_SUBST([ncurses_extra_LIBS])
194 [ac_ct_panel_lib_found=yes; break])
196 [test -z "$ac_ct_panel_lib_found"],
198 [test "$need_panel_menu" = "yes"],
199 [AC_MSG_ERROR([could not find libpanel library (frontend: nconf)])],
200 [has_panel_menu=no])])
204 [ac_ct_menu_lib_found=yes; break])
206 [test -z "$ac_ct_panel_lib_found"],
208 [test "$need_panel_menu" = "yes"],
209 [AC_MSG_ERROR([could not find libmenu library (frontend: nconf)])],
210 [has_panel_menu=no])])
211 ncurses_extra_LIBS="$LIBS"
215 [test "$has_panel_menu" = "no" ],
218 #----------------------------------------
219 # Check if the lxdialog library should be built
221 [test "$enable_mconf" = "yes" -o "$enable_mconf" = "auto"],
225 #----------------------------------------
226 # Check pkg-config if needed
228 ["$enable_gconf":"$enable_qconf"],
229 [yes:*], [need_pkgconfig=yes],
230 [*:yes], [need_pkgconfig=yes],
231 [auto:*], [need_pkgconfig=yes],
232 [*:auto], [need_pkgconfig=yes],
233 [need_pkgconfig=no ])
236 [test "$need_pkgconfig" = "yes"],
237 [PKG_PROG_PKG_CONFIG()])
239 #----------------------------------------
240 # Check headers and libs for gconf
241 [need_gtk="$enable_gconf"]
244 [test "$need_gtk" = "yes" -o "$need_gtk" = "auto"],
247 [gtk+-2.0 gmodule-2.0 libglade-2.0],
250 [test "$need_gtk" = "yes"],
251 [AC_MSG_ERROR([could not find GTK+ headers and/or libraries (frontend: gconf)])],
255 [test "$has_gtk" = "no" ],
258 #----------------------------------------
259 # Check headers and libs for gconf
260 [need_qt="$enable_qconf"]
263 [test "$need_qt" = "yes" -o "$need_qt" = "auto"],
266 [QtCore QtGui Qt3Support],
269 [test "$need_qt" = "yes"],
270 [AC_MSG_ERROR([could not find QT4 headers and/or libraries (frontend: qconf)])],
274 [test "$has_qt" = "no" ],
277 #---------------------------------------------------------------------------
278 # Now, we know what frontends to enable
279 AS_IF([test "$enable_conf" = "auto"], [enable_conf=yes ])
280 AS_IF([test "$enable_gconf" = "auto"], [enable_gconf=yes])
281 AS_IF([test "$enable_mconf" = "auto"], [enable_mconf=yes])
282 AS_IF([test "$enable_nconf" = "auto"], [enable_nconf=yes])
283 AS_IF([test "$enable_qconf" = "auto"], [enable_qconf=yes])
285 #---------------------------------------------------------------------------
291 [test "$enable_conf" = "yes"])
294 [test "$enable_mconf" = "yes"])
297 [test "$enable_nconf" = "yes"])
300 [test "$enable_gconf" = "yes"])
303 [test "$enable_qconf" = "yes"])
306 [test "$need_lxdialog" = "yes"])
308 #---------------------------------------------------------------------------
310 LT_INIT([disable-static])
312 #----------------------------------------
313 # Get the version to apply to the parser shared library
315 [KCONFIGPARSER_LIB_VERSION],
316 [m4_esyscmd_s([./scripts/version.sh --plain])])
318 #----------------------------------------
323 libs/lxdialog/Makefile
326 frontends/conf/Makefile
327 frontends/mconf/Makefile
328 frontends/nconf/Makefile
329 frontends/gconf/Makefile
330 frontends/qconf/Makefile
334 AC_MSG_NOTICE([Configured with:])
335 AC_MSG_NOTICE([- package name: '$package_name'])
336 AC_MSG_NOTICE([- frontends:])
337 AS_IF([test "$enable_conf" = "yes"],
338 [AC_MSG_NOTICE([ - conf: yes])],
339 [AC_MSG_NOTICE([ - conf: no])])
340 AS_IF([test "$enable_gconf" = "yes"],
341 [AC_MSG_NOTICE([ - gconf: yes])],
342 [AC_MSG_NOTICE([ - gconf: no])])
343 AS_IF([test "$enable_mconf" = "yes"],
344 [AC_MSG_NOTICE([ - mconf: yes])],
345 [AC_MSG_NOTICE([ - mconf: no])])
346 AS_IF([test "$enable_nconf" = "yes"],
347 [AC_MSG_NOTICE([ - nconf: yes])],
348 [AC_MSG_NOTICE([ - nconf: no])])
349 AS_IF([test "$enable_qconf" = "yes"],
350 [AC_MSG_NOTICE([ - qconf: yes])],
351 [AC_MSG_NOTICE([ - qconf: no])])
352 AC_MSG_NOTICE([- parser library:])
353 AS_IF([test "$enable_shared" = "yes"],
354 [AC_MSG_NOTICE([ - shared: yes, versioned $KCONFIGPARSER_LIB_VERSION])],
355 [AC_MSG_NOTICE([ - shared: no])])
356 AC_MSG_NOTICE([ - static: $enable_static])