]> git.sur5r.net Git - kconfig-frontends/blob - configure.ac
frontends: add qconf
[kconfig-frontends] / configure.ac
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ([2.67])
5 AC_INIT([kconfig-frontends], [m4_esyscmd_s([cat .version])], [nobody@nowhere.org])
6 AC_CONFIG_SRCDIR([frontends/conf/conf.c])
7 # Use a config.h to avoid brazilions -DHAVE_FOO on compile lines
8 AC_CONFIG_HEADERS([config.h])
9 AC_CONFIG_AUX_DIR([scripts])
10
11 # Checks for programs.
12 AC_PROG_CC
13 AC_PROG_CXX
14 AC_PROG_MAKE_SET
15
16 # Checks for libraries.
17 # (none)
18
19 # Checks for header files.
20 AC_HEADER_STDC
21 # The folowing AC_CHECK_HEADERS was a single big line
22 AC_CHECK_HEADERS([ fcntl.h libintl.h limits.h locale.h ])
23 AC_CHECK_HEADERS([ stdlib.h string.h sys/time.h unistd.h ])
24
25 # Checks for typedefs, structures, and compiler characteristics.
26 AC_HEADER_STDBOOL
27 AC_C_INLINE
28 AC_TYPE_SIZE_T
29
30 # Checks for library functions.
31 AC_FUNC_MALLOC
32 AC_FUNC_REALLOC
33 AC_FUNC_ALLOCA
34 # The following AC_CHECK_FUNCS was a single big line
35 AC_CHECK_FUNCS([ bzero memmove memset ])
36 AC_CHECK_FUNCS([ strcasecmp strchr strcspn strdup strncasecmp strpbrk strrchr strspn strtol ])
37 AC_CHECK_FUNCS([ gettimeofday mkdir regcomp setlocale uname ])
38
39 # End of the autoscan-detected stuff
40 #---------------------------------------------------------------------------
41
42 #----------------------------------------
43 # Options to selectively enable/disable frontends
44 # All are selected by default
45 AC_ARG_ENABLE(
46     [conf],
47     [AS_HELP_STRING(
48         [--enable-conf],
49         [conf, the stdin-based frontend (default=yes)])])
50 AC_SUBST([enable_conf], [${enable_conf:-yes}])
51 AC_ARG_ENABLE(
52     [mconf],
53     [AS_HELP_STRING(
54         [--enable-mconf],
55         [mconf, the traditional ncurses-based frontend (default=yes)])])
56 AC_SUBST([enable_mconf], [${enable_mconf:-yes}])
57 AC_ARG_ENABLE(
58     [nconf],
59     [AS_HELP_STRING(
60         [--enable-nconf],
61         [nconf, the modern ncurses-based frontend (default=yes)])])
62 AC_SUBST([enable_nconf], [${enable_nconf:-yes}])
63 AC_ARG_ENABLE(
64     [gconf],
65     [AS_HELP_STRING(
66         [--enable-gconf],
67         [gconf, the GTK-based frontend (default=yes)])])
68 AC_SUBST([enable_gconf], [${enable_gconf:-yes}])
69 AC_ARG_ENABLE(
70     [qconf],
71     [AS_HELP_STRING(
72         [--enable-qconf],
73         [qconf, the QT-based frontend (default=yes)])])
74 AC_SUBST([enable_qconf], [${enable_qconf:-yes}])
75
76 #----------------------------------------
77 # Some program checks
78 AC_PROG_RANLIB
79 AC_PROG_LEX
80 AC_PROG_YACC
81 AC_CHECK_PROGS(
82     [GPERF],
83     [gperf])
84 AS_IF(
85     [test -z "$GPERF"],
86     [AC_MSG_ERROR([can not find gperf])])
87 AC_SUBST([AM_LFLAGS], ["-L -P zconf"])
88 AC_SUBST([AM_YFLAGS], ["-t -l -p zconf"])
89
90 #----------------------------------------
91 # Check for gettext, for the kconfig frontends
92 AC_SUBST([GETTEXT])
93 AC_CHECK_HEADERS(
94     [libintl.h],
95     [ac_ct_gettext_hdr=$ac_header; break],
96     [AC_MSG_WARN([libintl is missing, frontends will not be localised])])
97 AS_IF(
98     [test -n "$ac_ct_gettext_hdr"],
99     [AC_CHECK_DECL(
100         [gettext],,
101         [AC_MSG_WARN([gettext is missing, frontends will not be localised])
102          GETTEXT=-DKBUILD_NO_NLS],
103         [#include <$ac_ct_gettext_hdr>])])
104
105 #----------------------------------------
106 # Check for ncurses, for the kconfig frontends
107 AC_SUBST([CURSES_LOC])
108 AC_CHECK_HEADERS(
109     [ncurses/ncurses.h ncurses/curses.h ncursesw/curses.h ncurses.h curses.h],
110     [CURSES_LOC=$ac_header; break])
111 AS_IF(
112     [test -z "$CURSES_LOC"],
113     [AC_MSG_ERROR([could not find curses headers])])
114 AC_SEARCH_LIBS(
115     [initscr],
116     [ncursesw ncurses curses],
117     [ac_ct_curses_lib_found=yes; break])
118 AS_IF(
119     [test -z "$ac_ct_curses_lib_found"],
120     [AC_MSG_ERROR([could not find curses library])])
121
122 #----------------------------------------
123 # Check pkg-config if needed
124 AS_IF(
125     [test    "$enable_gconf" = "yes"    \
126           -o "$enable_qconf" = "yes"],
127     [PKG_PROG_PKG_CONFIG()])
128
129 #----------------------------------------
130 # Check headers and libs for gconf
131 AS_IF(
132     [test "$enable_gconf" = yes ],
133     [PKG_CHECK_MODULES(
134         [gtk],
135         [gtk+-2.0 gmodule-2.0 libglade-2.0])])
136
137 #----------------------------------------
138 # Check headers and libs for gconf
139 AS_IF(
140     [test "$enable_qconf" = "yes"],
141     [PKG_CHECK_MODULES(
142         [qt4],
143         [QtCore QtGui Qt3Support])])
144
145 #---------------------------------------------------------------------------
146 # Prepare automake
147 AM_INIT_AUTOMAKE
148 AM_PROG_CC_C_O
149 AM_CONDITIONAL(
150     [COND_conf],
151     [test "$enable_conf" = "yes"])
152 AM_CONDITIONAL(
153     [COND_mconf],
154     [test "$enable_mconf" = "yes"])
155 AM_CONDITIONAL(
156     [COND_nconf],
157     [test "$enable_nconf" = "yes"])
158 AM_CONDITIONAL(
159     [COND_gconf],
160     [test "$enable_gconf" = "yes"])
161 AM_CONDITIONAL(
162     [COND_qconf],
163     [test "$enable_qconf" = "yes"])
164
165 #----------------------------------------
166 # Finalise
167 AC_CONFIG_FILES([
168     Makefile
169     libs/Makefile
170     libs/lxdialog/Makefile
171     libs/parser/Makefile
172     frontends/Makefile
173     frontends/conf/Makefile
174     frontends/mconf/Makefile
175     frontends/nconf/Makefile
176     frontends/gconf/Makefile
177     frontends/qconf/Makefile
178 ])
179 AC_OUTPUT