VirtualBox

source: kBuild/trunk/src/sed/configure.ac@ 2788

Last change on this file since 2788 was 1158, checked in by bird, 17 years ago

The FreeBSD sed doesn't grok a\ unless in a script.

File size: 4.6 KB
Line 
1dnl Process this file with -*- autoconf -*- to produce a configure script.
2AC_INIT(sed, 4.1.5, [email protected], sed)
3AC_CONFIG_AUX_DIR(config)
4AC_CONFIG_SRCDIR([sed/sed.c])
5AM_CONFIG_HEADER(config.h:config_h.in)
6AC_PREREQ(2.59)
7AM_INIT_AUTOMAKE
8
9SED_FEATURE_VERSION=4.1
10AC_DEFINE_UNQUOTED(SED_FEATURE_VERSION, "$SED_FEATURE_VERSION",
11 [Define to the version of GNU sed whose features are supported by this sed.])
12AC_SUBST(SED_FEATURE_VERSION)
13
14AC_PROG_CC
15AC_PROG_RANLIB
16AC_GNU_SOURCE
17AC_AIX
18AC_MINIX
19AC_ISC_POSIX
20AC_SYS_LARGEFILE
21AC_SYS_LONG_FILE_NAMES
22
23AC_CACHE_CHECK([whether -lcP is needed], [sed_cv_libcp_needed], [
24AC_TRY_RUN([
25#include <stdio.h>
26#include <errno.h>
27
28int 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])
42if test "$sed_cv_libcp_needed" = yes; then
43 LIBS="-lcP $LIBS"
44fi
45
46AC_HEADER_DIRENT
47AC_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])
50AC_C_CONST
51AC_TYPE_SIZE_T
52AC_CHECK_TYPE(ssize_t, int)
53
54AC_HEADER_STDBOOL
55if test "$ac_cv_type__Bool" = no; then
56 HAVE__BOOL=0
57else
58 HAVE__BOOL=1
59fi
60AC_SUBST(HAVE__BOOL)
61if test "$ac_cv_header_stdbool_h" = no; then
62 AC_CONFIG_FILES(lib/stdbool.h:lib/stdbool_.h)
63fi
64
65AC_FUNC_ALLOCA
66AC_FUNC_VPRINTF
67AM_FUNC_GETLINE
68AC_FUNC_OBSTACK
69AC_FUNC_MBRTOWC
70AC_TYPE_MBSTATE_T
71gl_FUNC_STRVERSCMP
72AC_REPLACE_FUNCS(memchr memcmp memmove strerror mkstemp)
73AC_CHECK_FUNCS(isatty bcopy bzero isascii memcpy memset strchr strtoul popen \
74 pathconf isblank fchown fchmod setlocale wcrtomb wcscoll btowc)
75
76AC_ARG_ENABLE(i18n,
77[ --disable-i18n disable internationalization (default=yes)], ,
78enable_i18n=yes)
79if test "x$enable_i18n" = xno; then
80 ac_cv_func_wcscoll=false
81fi
82
83AC_ARG_WITH(included-regex,
84[ --with-included-regex use included regex matcher (default=yes)], ,
85with_included_regex=yes)
86
87if 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
95fi
96
97AC_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
101fi],
102enable_regex_tests=$with_included_regex)
103
104AM_CONDITIONAL(TEST_REGEX, test "x$enable_regex_tests" != xno)
105if test "x$with_included_regex" != xno; then
106 AC_CONFIG_LINKS(lib/regex.h:lib/regex_.h)
107 AC_LIBOBJ(regex)
108fi
109if 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])
112fi
113
114AC_ARG_ENABLE(html,
115[ --enable-html build HTML manual (default=no)], ,
116enable_html=no)
117
118AM_CONDITIONAL(BUILD_HTML, test "x$enable_html" != xno)
119
120: ${TEXI2HTML=texi2html -monolithic}
121AC_SUBST(TEXI2HTML)
122
123AC_MSG_CHECKING(how to build HTML documentation)
124if eval $am_missing_run makeinfo --help 2>&1 | grep .-html > /dev/null; then
125 AC_MSG_RESULT(with makeinfo)
126 enable_html=makeinfo
127else
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
138fi
139
140AM_CONDITIONAL(MAKEINFO_HTML, test "x$enable_html" = xmakeinfo)
141AM_CONDITIONAL(TEXI2HTML_HTML, test "x$enable_html" = xtexi2html)
142
143
144AC_DEFUN([AM_MKINSTALLDIRS], [MKINSTALLDIRS="$mkdir_p" AC_SUBST(MKINSTALLDIRS)])
145AM_GNU_GETTEXT_VERSION(0.14)
146AM_GNU_GETTEXT(no-libtool, need-ngettext, ../intl)
147dnl bird: made the 'expr/a\' stuff work on BSD. a\ only works when scripting there.
148AC_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
156 rm -f tmp.sed], [
157 install_sh="$install_sh"])
158
159AC_CONFIG_FILES([bootstrap.sh], chmod +x bootstrap.sh)
160AC_CONFIG_FILES([Makefile doc/Makefile \
161lib/Makefile sed/Makefile testsuite/Makefile \
162po/Makefile.in intl/Makefile])
163AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette