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)
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)
21 AC_SYS_LONG_FILE_NAMES
23 AC_CACHE_CHECK([whether -lcP is needed], [sed_cv_libcp_needed], [
33 fp = fopen ("conftest.c", "r");
34 if (!fp) return 0; /* error, assume not needed */
35 result = fflush (fp) == EOF && errno == 0;
38 }], [sed_cv_libcp_needed=no],
39 [sed_cv_libcp_needed=yes],
40 [sed_cv_libcp_needed="assuming no"])
42 if test "$sed_cv_libcp_needed" = yes; then
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])
52 AC_CHECK_TYPE(ssize_t, int)
55 if test "$ac_cv_type__Bool" = no; then
61 if test "$ac_cv_header_stdbool_h" = no; then
62 AC_CONFIG_FILES(lib/stdbool.h:lib/stdbool_.h)
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)
77 [ --disable-i18n disable internationalization (default=yes)], ,
79 if test "x$enable_i18n" = xno; then
80 ac_cv_func_wcscoll=false
83 AC_ARG_WITH(included-regex,
84 [ --with-included-regex use included regex matcher (default=yes)], ,
85 with_included_regex=yes)
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
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
102 enable_regex_tests=$with_included_regex)
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)
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])
115 [ --enable-html build HTML manual (default=no)], ,
118 AM_CONDITIONAL(BUILD_HTML, test "x$enable_html" != xno)
120 : ${TEXI2HTML=texi2html -monolithic}
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)
128 if $TEXI2HTML --help 2>&1 | grep monolithic > /dev/null; then
129 AC_MSG_RESULT(with texi2html)
130 enable_html=texi2html
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)
140 AM_CONDITIONAL(MAKEINFO_HTML, test "x$enable_html" = xmakeinfo)
141 AM_CONDITIONAL(TEXI2HTML_HTML, test "x$enable_html" = xtexi2html)
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 dnl bird: made the 'expr/a\' stuff work on BSD. a\ only works when scripting there.
148 AC_CONFIG_COMMANDS([gettext-fix], [
149 echo '/^mkinstalldirs *=/a\' > tmp.sed
150 echo "install_sh=$install_sh" >> tmp.sed
151 echo 's/^mkinstalldirs *=.*/mkinstalldirs=$(MKINSTALLDIRS)/' >> tmp.sed
152 sed -f tmp.sed intl/Makefile > intl/Makefile.tmp
153 mv intl/Makefile.tmp intl/Makefile
154 sed -f tmp.sed po/Makefile > po/Makefile.tmp
155 mv po/Makefile.tmp po/Makefile
157 install_sh="$install_sh"])
159 AC_CONFIG_FILES([bootstrap.sh], chmod +x bootstrap.sh)
160 AC_CONFIG_FILES([Makefile doc/Makefile \
161 lib/Makefile sed/Makefile testsuite/Makefile \
162 po/Makefile.in intl/Makefile])