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 #----------------------------------------
46 # Options to selectively enable/disable frontends
47 # All are selected by default
52 [conf, the stdin-based frontend (default=enabled)])])
53 AC_SUBST([enable_conf], [${enable_conf:-auto}])
58 [mconf, the traditional ncurses-based frontend (default=enabled)])])
59 AC_SUBST([enable_mconf], [${enable_mconf:-auto}])
64 [nconf, the modern ncurses-based frontend (default=enabled)])])
65 AC_SUBST([enable_nconf], [${enable_nconf:-auto}])
70 [gconf, the GTK-based frontend (default=enabled)])])
71 AC_SUBST([enable_gconf], [${enable_gconf:-auto}])
76 [qconf, the QT-based frontend (default=enabled)])])
77 AC_SUBST([enable_qconf], [${enable_qconf:-auto}])
79 #----------------------------------------
88 [AC_MSG_ERROR([can not find gperf])])
89 AC_SUBST([AM_LFLAGS], ["-L -P zconf"])
90 AC_SUBST([AM_YFLAGS], ["-t -l -p zconf"])
92 #----------------------------------------
93 # Check for gettext, for the kconfig frontends
97 [ac_ct_gettext_hdr=$ac_header; break],
98 [AC_MSG_WARN([libintl is missing, frontends will not be localised])])
100 [test -n "$ac_ct_gettext_hdr"],
103 [AC_MSG_WARN([gettext is missing, frontends will not be localised])
104 GETTEXT=-DKBUILD_NO_NLS],
105 [#include <$ac_ct_gettext_hdr>])])
107 #----------------------------------------
108 # Check for ncurses, for the mconf & nconf frontends
110 ["$enable_mconf":"$enable_nconf"],
111 [yes:*], [need_curses=yes],
112 [*:yes], [need_curses=yes],
113 [auto:*], [need_curses=auto],
114 [*:auto], [need_curses=auto],
118 [test "$need_curses" = "yes" -o "$need_curses" = "auto"],
119 [AC_SUBST([CURSES_LOC])
120 AC_SUBST([ncurses_LIBS])
123 [ncurses/ncurses.h ncurses/curses.h ncursesw/curses.h ncurses.h curses.h],
124 [CURSES_LOC=$ac_header; break])
126 [test -z "$CURSES_LOC"],
128 [test "$need_curses" = "yes"],
129 [AC_MSG_ERROR([could not find curses headers (frontends: mconf/nconf)])],
133 [ncursesw ncurses curses],
134 [ac_ct_curses_lib_found=yes; break])
136 [test -z "$ac_ct_curses_lib_found"],
138 [test "$need_curses" = "yes"],
139 [AC_MSG_ERROR([could not find curses library (frontends: mconf/nconf)])],
145 [test "$has_curses" = "no" ],
146 [enable_mconf=no; enable_nconf=no])
148 #----------------------------------------
149 # Check for libpanel and libmenu, for the nconf frontend
150 [need_panel_menu="$enable_nconf"]
153 [test "$need_panel_menu" = "yes" -o "$need_panel_menu" = "auto"],
154 [AC_SUBST([ncurses_extra_LIBS])
159 [ac_ct_panel_lib_found=yes; break])
161 [test -z "$ac_ct_panel_lib_found"],
163 [test "$need_panel_menu" = "yes"],
164 [AC_MSG_ERROR([could not find libpanel library (frontend: nconf)])],
165 [has_panel_menu=no])])
169 [ac_ct_menu_lib_found=yes; break])
171 [test -z "$ac_ct_panel_lib_found"],
173 [test "$need_panel_menu" = "yes"],
174 [AC_MSG_ERROR([could not find libmenu library (frontend: nconf)])],
175 [has_panel_menu=no])])
176 ncurses_extra_LIBS="$LIBS"
180 [test "$has_panel_menu" = "no" ],
183 #----------------------------------------
184 # Check if the lxdialog library should be built
186 [test "$enable_mconf" = "yes" -o "$enable_mconf" = "auto"],
190 #----------------------------------------
191 # Check pkg-config if needed
193 ["$enable_gconf":"$enable_qconf"],
194 [yes:*], [need_pkgconfig=yes],
195 [*:yes], [need_pkgconfig=yes],
196 [auto:*], [need_pkgconfig=yes],
197 [*:auto], [need_pkgconfig=yes],
198 [need_pkgconfig=no ])
201 [test "$need_pkgconfig" = "yes"],
202 [PKG_PROG_PKG_CONFIG()])
204 #----------------------------------------
205 # Check headers and libs for gconf
206 [need_gtk="$enable_gconf"]
209 [test "$need_gtk" = "yes" -o "$need_gtk" = "auto"],
212 [gtk+-2.0 gmodule-2.0 libglade-2.0],
215 [test "$need_gtk" = "yes"],
216 [AC_MSG_ERROR([could not find GTK+ headers and/or libraries (frontend: gconf)])],
220 [test "$has_gtk" = "no" ],
223 #----------------------------------------
224 # Check headers and libs for gconf
225 [need_qt="$enable_qconf"]
228 [test "$need_qt" = "yes" -o "$need_qt" = "auto"],
231 [QtCore QtGui Qt3Support],
234 [test "$need_qt" = "yes"],
235 [AC_MSG_ERROR([could not find QT4 headers and/or libraries (frontend: qconf)])],
239 [test "$has_qt" = "no" ],
242 #---------------------------------------------------------------------------
243 # Now, we know what frontends to enable
244 AS_IF([test "$enable_conf" = "auto"], [enable_conf=yes ])
245 AS_IF([test "$enable_gconf" = "auto"], [enable_gconf=yes])
246 AS_IF([test "$enable_mconf" = "auto"], [enable_mconf=yes])
247 AS_IF([test "$enable_nconf" = "auto"], [enable_nconf=yes])
248 AS_IF([test "$enable_qconf" = "auto"], [enable_qconf=yes])
250 #---------------------------------------------------------------------------
256 [test "$enable_conf" = "yes"])
259 [test "$enable_mconf" = "yes"])
262 [test "$enable_nconf" = "yes"])
265 [test "$enable_gconf" = "yes"])
268 [test "$enable_qconf" = "yes"])
271 [test "$need_lxdialog" = "yes"])
273 #---------------------------------------------------------------------------
275 LT_INIT([disable-static])
277 #----------------------------------------
278 # Get the version to apply to the parser shared library
280 [KCONFIGPARSER_LIB_VERSION],
281 [m4_esyscmd_s([./scripts/version.sh --plain])])
283 #----------------------------------------
288 libs/lxdialog/Makefile
291 frontends/conf/Makefile
292 frontends/mconf/Makefile
293 frontends/nconf/Makefile
294 frontends/gconf/Makefile
295 frontends/qconf/Makefile
299 AC_MSG_NOTICE([Configured with:])
300 AC_MSG_NOTICE([- frontends:])
301 AS_IF([test "$enable_conf" = "yes"],
302 [AC_MSG_NOTICE([ - conf: yes])],
303 [AC_MSG_NOTICE([ - conf: no])])
304 AS_IF([test "$enable_gconf" = "yes"],
305 [AC_MSG_NOTICE([ - gconf: yes])],
306 [AC_MSG_NOTICE([ - gconf: no])])
307 AS_IF([test "$enable_mconf" = "yes"],
308 [AC_MSG_NOTICE([ - mconf: yes])],
309 [AC_MSG_NOTICE([ - mconf: no])])
310 AS_IF([test "$enable_nconf" = "yes"],
311 [AC_MSG_NOTICE([ - nconf: yes])],
312 [AC_MSG_NOTICE([ - nconf: no])])
313 AS_IF([test "$enable_qconf" = "yes"],
314 [AC_MSG_NOTICE([ - qconf: yes])],
315 [AC_MSG_NOTICE([ - qconf: no])])
316 AC_MSG_NOTICE([- parser library:])
317 AS_IF([test "$enable_shared" = "yes"],
318 [AC_MSG_NOTICE([ - shared: yes, versioned $KCONFIGPARSER_LIB_VERSION])],
319 [AC_MSG_NOTICE([ - shared: no])])
320 AC_MSG_NOTICE([ - static: $enable_static])