]> git.sur5r.net Git - kconfig-frontends/blob - configure.ac
configure: add option to select frontends
[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_CXX
13 AC_PROG_CC
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
64 #----------------------------------------
65 # Some program checks
66 AC_PROG_RANLIB
67 AC_PROG_LEX
68 AC_PROG_YACC
69 AC_CHECK_PROGS(
70     [GPERF],
71     [gperf])
72 AS_IF(
73     [test -z "$GPERF"],
74     [AC_MSG_ERROR([can not find gperf])])
75 AC_SUBST([AM_LFLAGS], ["-L -P zconf"])
76 AC_SUBST([AM_YFLAGS], ["-t -l -p zconf"])
77
78 #----------------------------------------
79 # Check for gettext, for the kconfig frontends
80 AC_SUBST([GETTEXT])
81 AC_CHECK_HEADERS(
82     [libintl.h],
83     [ac_ct_gettext_hdr=$ac_header; break],
84     [AC_MSG_WARN([libintl is missing, frontends will not be localised])])
85 AS_IF(
86     [test -n "$ac_ct_gettext_hdr"],
87     [AC_CHECK_DECL(
88         [gettext],,
89         [AC_MSG_WARN([gettext is missing, frontends will not be localised])
90          GETTEXT=-DKBUILD_NO_NLS],
91         [#include <$ac_ct_gettext_hdr>])])
92
93 #----------------------------------------
94 # Check for ncurses, for the kconfig frontends
95 AC_SUBST([CURSES_LOC])
96 AC_CHECK_HEADERS(
97     [ncurses/ncurses.h ncurses/curses.h ncursesw/curses.h ncurses.h curses.h],
98     [CURSES_LOC=$ac_header; break])
99 AS_IF(
100     [test -z "$CURSES_LOC"],
101     [AC_MSG_ERROR([could not find curses headers])])
102 AC_SEARCH_LIBS(
103     [initscr],
104     [ncursesw ncurses curses],
105     [ac_ct_curses_lib_found=yes; break])
106 AS_IF(
107     [test -z "$ac_ct_curses_lib_found"],
108     [AC_MSG_ERROR([could not find curses library])])
109
110 #----------------------------------------
111 # Prepare automake
112 AM_INIT_AUTOMAKE
113 AM_PROG_CC_C_O
114 AM_CONDITIONAL(
115     [COND_conf],
116     [test "$enable_conf" = "yes"])
117 AM_CONDITIONAL(
118     [COND_mconf],
119     [test "$enable_mconf" = "yes"])
120 AM_CONDITIONAL(
121     [COND_nconf],
122     [test "$enable_nconf" = "yes"])
123
124 #----------------------------------------
125 # Finalise
126 AC_CONFIG_FILES([
127     Makefile
128     lxdialog/Makefile
129     parser/Makefile
130     frontends/Makefile
131     frontends/conf/Makefile
132     frontends/mconf/Makefile
133     frontends/nconf/Makefile
134 ])
135 AC_OUTPUT