1 | dnl Process this file with -*- autoconf -*- to produce a configure script.
|
---|
2 | AC_INIT(sed, 4.1.5, bonzini@gnu.org, sed)
|
---|
3 | AC_CONFIG_AUX_DIR(config)
|
---|
4 | AC_CONFIG_SRCDIR([sed/sed.c])
|
---|
5 | AM_CONFIG_HEADER(config.h:config_h.in)
|
---|
6 | AC_PREREQ(2.59)
|
---|
7 | AM_INIT_AUTOMAKE
|
---|
8 |
|
---|
9 | SED_FEATURE_VERSION=4.1
|
---|
10 | AC_DEFINE_UNQUOTED(SED_FEATURE_VERSION, "$SED_FEATURE_VERSION",
|
---|
11 | [Define to the version of GNU sed whose features are supported by this sed.])
|
---|
12 | AC_SUBST(SED_FEATURE_VERSION)
|
---|
13 |
|
---|
14 | AC_PROG_CC
|
---|
15 | AC_PROG_RANLIB
|
---|
16 | AC_GNU_SOURCE
|
---|
17 | AC_AIX
|
---|
18 | AC_MINIX
|
---|
19 | AC_ISC_POSIX
|
---|
20 | AC_SYS_LARGEFILE
|
---|
21 | AC_SYS_LONG_FILE_NAMES
|
---|
22 |
|
---|
23 | AC_CACHE_CHECK([whether -lcP is needed], [sed_cv_libcp_needed], [
|
---|
24 | AC_TRY_RUN([
|
---|
25 | #include <stdio.h>
|
---|
26 | #include <errno.h>
|
---|
27 |
|
---|
28 | int main()
|
---|
29 | {
|
---|
30 | FILE *fp;
|
---|
31 | int result;
|
---|
32 | errno = 0;
|
---|
33 | fp = fopen ("conftest.c", "r");
|
---|
34 | if (!fp) return 0; /* error, assume not needed */
|
---|
35 | result = fflush (fp) == EOF && errno == 0;
|
---|
36 | fclose (fp);
|
---|
37 | return result;
|
---|
38 | }], [sed_cv_libcp_needed=no],
|
---|
39 | [sed_cv_libcp_needed=yes],
|
---|
40 | [sed_cv_libcp_needed="assuming no"])
|
---|
41 | ])
|
---|
42 | if test "$sed_cv_libcp_needed" = yes; then
|
---|
43 | LIBS="-lcP $LIBS"
|
---|
44 | fi
|
---|
45 |
|
---|
46 | AC_HEADER_DIRENT
|
---|
47 | AC_CHECK_HEADERS(io.h limits.h locale.h stdarg.h alloca.h stddef.h errno.h \
|
---|
48 | wchar.h wctype.h sys/file.h mcheck.h, [], [],
|
---|
49 | [AC_INCLUDES_DEFAULT])
|
---|
50 | AC_C_CONST
|
---|
51 | AC_TYPE_SIZE_T
|
---|
52 | AC_CHECK_TYPE(ssize_t, int)
|
---|
53 |
|
---|
54 | AC_HEADER_STDBOOL
|
---|
55 | if test "$ac_cv_type__Bool" = no; then
|
---|
56 | HAVE__BOOL=0
|
---|
57 | else
|
---|
58 | HAVE__BOOL=1
|
---|
59 | fi
|
---|
60 | AC_SUBST(HAVE__BOOL)
|
---|
61 | if test "$ac_cv_header_stdbool_h" = no; then
|
---|
62 | AC_CONFIG_FILES(lib/stdbool.h:lib/stdbool_.h)
|
---|
63 | fi
|
---|
64 |
|
---|
65 | AC_FUNC_ALLOCA
|
---|
66 | AC_FUNC_VPRINTF
|
---|
67 | AM_FUNC_GETLINE
|
---|
68 | AC_FUNC_OBSTACK
|
---|
69 | AC_FUNC_MBRTOWC
|
---|
70 | AC_TYPE_MBSTATE_T
|
---|
71 | gl_FUNC_STRVERSCMP
|
---|
72 | AC_REPLACE_FUNCS(memchr memcmp memmove strerror mkstemp)
|
---|
73 | AC_CHECK_FUNCS(isatty bcopy bzero isascii memcpy memset strchr strtoul popen \
|
---|
74 | pathconf isblank fchown fchmod setlocale wcrtomb wcscoll btowc)
|
---|
75 |
|
---|
76 | AC_ARG_ENABLE(i18n,
|
---|
77 | [ --disable-i18n disable internationalization (default=yes)], ,
|
---|
78 | enable_i18n=yes)
|
---|
79 | if test "x$enable_i18n" = xno; then
|
---|
80 | ac_cv_func_wcscoll=false
|
---|
81 | fi
|
---|
82 |
|
---|
83 | AC_ARG_WITH(included-regex,
|
---|
84 | [ --with-included-regex use included regex matcher (default=yes)], ,
|
---|
85 | with_included_regex=yes)
|
---|
86 |
|
---|
87 | if test "x$with_included_regex" = xno; then
|
---|
88 | AC_CHECK_HEADERS(regex.h)
|
---|
89 | AC_CHECK_LIB(regex, re_search)
|
---|
90 | AC_CHECK_FUNC(re_search)
|
---|
91 | if test $ac_cv_header_regex_h = no || test $ac_cv_func_re_search = no; then
|
---|
92 | AC_MSG_WARN([GNU regex not found, falling back to the included version])
|
---|
93 | with_included_regex=yes
|
---|
94 | fi
|
---|
95 | fi
|
---|
96 |
|
---|
97 | AC_ARG_ENABLE(regex-tests,
|
---|
98 | [ --enable-regex-tests enable regex matcher regression tests (default=yes)],
|
---|
99 | [if test "x$with_included_regex" = xno; then
|
---|
100 | enable_regex_tests=no
|
---|
101 | fi],
|
---|
102 | enable_regex_tests=$with_included_regex)
|
---|
103 |
|
---|
104 | AM_CONDITIONAL(TEST_REGEX, test "x$enable_regex_tests" != xno)
|
---|
105 | if test "x$with_included_regex" != xno; then
|
---|
106 | AC_CONFIG_LINKS(lib/regex.h:lib/regex_.h)
|
---|
107 | AC_LIBOBJ(regex)
|
---|
108 | fi
|
---|
109 | if test "x$enable_regex_tests" = xyes; then
|
---|
110 | AC_DEFINE_UNQUOTED(_REGEX_RE_COMP, 1,
|
---|
111 | [Include BSD functions in regex, used by the testsuite])
|
---|
112 | fi
|
---|
113 |
|
---|
114 | AC_ARG_ENABLE(html,
|
---|
115 | [ --enable-html build HTML manual (default=no)], ,
|
---|
116 | enable_html=no)
|
---|
117 |
|
---|
118 | AM_CONDITIONAL(BUILD_HTML, test "x$enable_html" != xno)
|
---|
119 |
|
---|
120 | : ${TEXI2HTML=texi2html -monolithic}
|
---|
121 | AC_SUBST(TEXI2HTML)
|
---|
122 |
|
---|
123 | AC_MSG_CHECKING(how to build HTML documentation)
|
---|
124 | if eval $am_missing_run makeinfo --help 2>&1 | grep .-html > /dev/null; then
|
---|
125 | AC_MSG_RESULT(with makeinfo)
|
---|
126 | enable_html=makeinfo
|
---|
127 | else
|
---|
128 | if $TEXI2HTML --help 2>&1 | grep monolithic > /dev/null; then
|
---|
129 | AC_MSG_RESULT(with texi2html)
|
---|
130 | enable_html=texi2html
|
---|
131 | else
|
---|
132 | AC_MSG_RESULT(not built)
|
---|
133 | if test "x$enable_html" != xno; then
|
---|
134 | AC_MSG_ERROR(cannot build HTML documentation, install makeinfo 4.0 or texi2html)
|
---|
135 | fi
|
---|
136 | enable_html=no
|
---|
137 | fi
|
---|
138 | fi
|
---|
139 |
|
---|
140 | AM_CONDITIONAL(MAKEINFO_HTML, test "x$enable_html" = xmakeinfo)
|
---|
141 | AM_CONDITIONAL(TEXI2HTML_HTML, test "x$enable_html" = xtexi2html)
|
---|
142 |
|
---|
143 |
|
---|
144 | AC_DEFUN([AM_MKINSTALLDIRS], [MKINSTALLDIRS="$mkdir_p" AC_SUBST(MKINSTALLDIRS)])
|
---|
145 | AM_GNU_GETTEXT_VERSION(0.14)
|
---|
146 | AM_GNU_GETTEXT(no-libtool, need-ngettext, ../intl)
|
---|
147 | AC_CONFIG_COMMANDS([gettext-fix], [
|
---|
148 | sed -e '/^mkinstalldirs *=/a\' \
|
---|
149 | -e "install_sh=$install_sh" \
|
---|
150 | -e 's/^mkinstalldirs *=.*/mkinstalldirs=$(MKINSTALLDIRS)/' \
|
---|
151 | intl/Makefile > intl/Makefile.tmp
|
---|
152 | mv intl/Makefile.tmp intl/Makefile
|
---|
153 | sed -e '/^mkinstalldirs *=/a\' \
|
---|
154 | -e "install_sh=$install_sh" \
|
---|
155 | -e 's/^mkinstalldirs *=.*/mkinstalldirs=$(MKINSTALLDIRS)/' \
|
---|
156 | po/Makefile > po/Makefile.tmp
|
---|
157 | mv po/Makefile.tmp po/Makefile], [
|
---|
158 | install_sh="$install_sh"])
|
---|
159 |
|
---|
160 | AC_CONFIG_FILES([bootstrap.sh], chmod +x bootstrap.sh)
|
---|
161 | AC_CONFIG_FILES([Makefile doc/Makefile \
|
---|
162 | lib/Makefile sed/Makefile testsuite/Makefile \
|
---|
163 | po/Makefile.in intl/Makefile])
|
---|
164 | AC_OUTPUT
|
---|