1 | dnl Process this file with autoconf to produce a configure script. |
---|
2 | AC_INIT(sed/sed.c) |
---|
3 | AM_CONFIG_HEADER(config.h:config_h.in) |
---|
4 | AC_PREREQ(2.12)dnl (not tested with anything older) |
---|
5 | AM_INIT_AUTOMAKE(sed, 3.02) |
---|
6 | AC_PROG_CC |
---|
7 | AC_PROG_RANLIB |
---|
8 | |
---|
9 | dnl Solaris 2.6 needs special compilation flags to support large files |
---|
10 | dnl (i.e. files larger than 2 GB). |
---|
11 | dnl This code frament taken from the configure.in file from patch-2.5. |
---|
12 | dnl Hopefully someday it will be handled directly by autoconf |
---|
13 | dnl without having to include this mess here. |
---|
14 | # If available, prefer support for large files unless the user specified |
---|
15 | # one of the CPPFLAGS, LDFLAGS, or LIBS variables. |
---|
16 | AC_MSG_CHECKING(whether large file support needs explicit enabling) |
---|
17 | ac_getconfs='' |
---|
18 | ac_result=yes |
---|
19 | ac_set='' |
---|
20 | ac_shellvars='CPPFLAGS LDFLAGS LIBS' |
---|
21 | for ac_shellvar in $ac_shellvars; do |
---|
22 | case $ac_shellvar in |
---|
23 | CPPFLAGS) ac_lfsvar=LFS_CFLAGS ;; |
---|
24 | *) ac_lfsvar=LFS_$ac_shellvar ;; |
---|
25 | esac |
---|
26 | eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar |
---|
27 | (getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; } |
---|
28 | ac_getconf=`getconf $ac_lfsvar` |
---|
29 | ac_getconfs=$ac_getconfs$ac_getconf |
---|
30 | eval ac_test_$ac_shellvar=\$ac_getconf |
---|
31 | done |
---|
32 | case "$ac_result$ac_getconfs" in |
---|
33 | yes) ac_result=no ;; |
---|
34 | esac |
---|
35 | case "$ac_result$ac_set" in |
---|
36 | yes?*) ac_result="yes, but $ac_set is already set, so use its settings" |
---|
37 | esac |
---|
38 | AC_MSG_RESULT($ac_result) |
---|
39 | case $ac_result in |
---|
40 | yes) |
---|
41 | for ac_shellvar in $ac_shellvars; do |
---|
42 | eval $ac_shellvar=\$ac_test_$ac_shellvar |
---|
43 | done ;; |
---|
44 | esac |
---|
45 | |
---|
46 | AC_MINIX |
---|
47 | AC_AIX |
---|
48 | AC_CHECK_LIB(cposix,strerror) |
---|
49 | |
---|
50 | AC_STDC_HEADERS |
---|
51 | AC_CHECK_HEADERS(string.h stdlib.h limits.h unistd.h memory.h sys/types.h) |
---|
52 | AC_C_CONST |
---|
53 | AC_TYPE_SIZE_T |
---|
54 | |
---|
55 | AC_MSG_CHECKING(which regex library to use) |
---|
56 | ac_regex_lib=lib/regex.o |
---|
57 | AC_ARG_WITH(regex, |
---|
58 | [ --with-regex=REGEX-LIB specify an alternative regex implementation], |
---|
59 | [case "$withval" in yes|no) ;; *) ac_regex_lib="$withval" ;; esac]) |
---|
60 | case "$ac_regex_lib" in |
---|
61 | lib/regex.o) LIBOBJS="$LIBOBJS regex.o" ;; |
---|
62 | ""|no) ;; |
---|
63 | *) LIBS="$LIBS $ac_regex_lib" ;; |
---|
64 | esac |
---|
65 | case "$ac_regex_lib" in |
---|
66 | "") AC_MSG_RESULT(using system's regex) ;; |
---|
67 | *) AC_MSG_RESULT(using $ac_regex_lib) ;; |
---|
68 | esac |
---|
69 | |
---|
70 | case " $LIBOBJS " in |
---|
71 | *\ regex.o\ *) |
---|
72 | ac_cv_func_regnexec=yes |
---|
73 | ac_cv_func_regexec=yes |
---|
74 | cat >> confdefs.h <<\EOF |
---|
75 | #define HAVE_REGNEXEC 1 |
---|
76 | #define HAVE_REGEXEC 1 |
---|
77 | EOF |
---|
78 | AC_DEFINE(USE_REGEX_GNU_H) |
---|
79 | ;; |
---|
80 | *) |
---|
81 | AC_CHECK_HEADERS(regex.h) |
---|
82 | case "$ac_cv_header_regex_h" in |
---|
83 | yes) ;; |
---|
84 | *) |
---|
85 | AC_MSG_ERROR(dnl |
---|
86 | <regex.h> header is required for use with non-default regex implementation) |
---|
87 | ;; |
---|
88 | esac |
---|
89 | AC_CHECK_FUNCS(regnexec regexec) |
---|
90 | ;; |
---|
91 | esac |
---|
92 | case "$ac_cv_func_regnexec $ac_cv_func_regexec" in |
---|
93 | *yes*) ;; |
---|
94 | *) AC_MSG_ERROR(at least one of regexec() or regnexec() must be supported) ;; |
---|
95 | esac |
---|
96 | |
---|
97 | AC_FUNC_ALLOCA |
---|
98 | AC_FUNC_MMAP |
---|
99 | AC_FUNC_VPRINTF |
---|
100 | |
---|
101 | AC_REPLACE_FUNCS(memchr memcmp memmove strerror) |
---|
102 | AC_CHECK_FUNCS(isatty bcopy bzero isascii memcpy) |
---|
103 | |
---|
104 | AC_ARG_PROGRAM |
---|
105 | AC_OUTPUT(Makefile djgpp/Makefile doc/Makefile dnl |
---|
106 | lib/Makefile sed/Makefile testsuite/Makefile |
---|
107 | dnl testsuite/version.good:testsuite/version.gin dnl |
---|
108 | ) |
---|