5 |
|
|
6 |
AC_INIT(dftables.c) |
AC_INIT(dftables.c) |
7 |
|
|
8 |
|
dnl A safety precaution |
9 |
|
|
10 |
|
AC_PREREQ(2.57) |
11 |
|
|
12 |
dnl Arrange to build config.h from config.in. Note that pcre.h is |
dnl Arrange to build config.h from config.in. Note that pcre.h is |
13 |
dnl built differently, as it is just a "substitution" file. |
dnl built differently, as it is just a "substitution" file. |
14 |
dnl Manual says this macro should come right after AC_INIT. |
dnl Manual says this macro should come right after AC_INIT. |
20 |
dnl digits for minor numbers less than 10. There are unlikely to be |
dnl digits for minor numbers less than 10. There are unlikely to be |
21 |
dnl that many releases anyway. |
dnl that many releases anyway. |
22 |
|
|
23 |
PCRE_MAJOR=3 |
PCRE_MAJOR=4 |
24 |
PCRE_MINOR=7 |
PCRE_MINOR=3 |
25 |
PCRE_DATE=29-Oct-2001 |
PCRE_DATE=21-May-2003 |
26 |
PCRE_VERSION=${PCRE_MAJOR}.${PCRE_MINOR} |
PCRE_VERSION=${PCRE_MAJOR}.${PCRE_MINOR} |
27 |
|
|
28 |
|
dnl Default values for miscellaneous macros |
29 |
|
|
30 |
|
POSIX_MALLOC_THRESHOLD=-DPOSIX_MALLOC_THRESHOLD=10 |
31 |
|
|
32 |
dnl Provide versioning information for libtool shared libraries that |
dnl Provide versioning information for libtool shared libraries that |
33 |
dnl are built by default on Unix systems. |
dnl are built by default on Unix systems. |
34 |
|
|
39 |
|
|
40 |
AC_PROG_CC |
AC_PROG_CC |
41 |
AC_PROG_INSTALL |
AC_PROG_INSTALL |
42 |
AC_PROG_RANLIB |
AC_LIBTOOL_WIN32_DLL |
43 |
|
AC_PROG_LIBTOOL |
44 |
|
|
45 |
|
dnl We need to find a compiler for compiling a program to run on the local host |
46 |
|
dnl while building. It needs to be different from CC when cross-compiling. |
47 |
|
dnl There is a macro called AC_PROG_CC_FOR_BUILD in the GNU archive for |
48 |
|
dnl figuring this out automatically. Unfortunately, it does not work with the |
49 |
|
dnl latest versions of autoconf. So for the moment, we just default to the |
50 |
|
dnl same values as the "main" compiler. People who are corss-compiling will |
51 |
|
dnl just have to adjust the Makefile by hand or set these values when they |
52 |
|
dnl run "configure". |
53 |
|
|
54 |
|
CC_FOR_BUILD=${CC_FOR_BUILD:-'$(CC)'} |
55 |
|
CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD:-'$(CFLAGS)'} |
56 |
|
BUILD_EXEEXT=${BUILD_EXEEXT:-'$(EXEEXT)'} |
57 |
|
BUILD_OBJEXT=${BUILD_OBJEXT:-'$(OBJEXT)'} |
58 |
|
|
59 |
dnl Checks for header files. |
dnl Checks for header files. |
60 |
|
|
73 |
dnl Handle --enable-utf8 |
dnl Handle --enable-utf8 |
74 |
|
|
75 |
AC_ARG_ENABLE(utf8, |
AC_ARG_ENABLE(utf8, |
76 |
[ --enable-utf8 enable UTF8 support (incomplete)], |
[ --enable-utf8 enable UTF8 support], |
77 |
if test "$enableval" = "yes"; then |
if test "$enableval" = "yes"; then |
78 |
UTF8=-DSUPPORT_UTF8 |
UTF8=-DSUPPORT_UTF8 |
79 |
fi |
fi |
97 |
fi |
fi |
98 |
) |
) |
99 |
|
|
100 |
|
dnl There doesn't seem to be a straightforward way of having parameters |
101 |
|
dnl that set values, other than fudging the --with thing. So that's what |
102 |
|
dnl I've done. |
103 |
|
|
104 |
|
dnl Handle --with-posix-malloc-threshold=n |
105 |
|
|
106 |
|
AC_ARG_WITH(posix-malloc-threshold, |
107 |
|
[ --with-posix-malloc-threshold=5 threshold for POSIX malloc usage], |
108 |
|
POSIX_MALLOC_THRESHOLD=-DPOSIX_MALLOC_THRESHOLD=$withval |
109 |
|
) |
110 |
|
|
111 |
|
dnl Handle --with-link-size=n |
112 |
|
|
113 |
|
AC_ARG_WITH(link-size, |
114 |
|
[ --with-link-size=2 internal link size (2, 3, or 4 allowed)], |
115 |
|
LINK_SIZE=-DLINK_SIZE=$withval |
116 |
|
) |
117 |
|
|
118 |
|
dnl Handle --with-match_limit=n |
119 |
|
|
120 |
|
AC_ARG_WITH(match-limit, |
121 |
|
[ --with-match-limit=10000000 default limit on internal looping)], |
122 |
|
MATCH_LIMIT=-DMATCH_LIMIT=$withval |
123 |
|
) |
124 |
|
|
125 |
dnl Now arrange to build libtool |
dnl Now arrange to build libtool |
126 |
|
|
127 |
AC_PROG_LIBTOOL |
AC_PROG_LIBTOOL |
128 |
|
|
129 |
dnl "Export" these variables |
dnl "Export" these variables |
130 |
|
|
131 |
|
AC_SUBST(BUILD_EXEEXT) |
132 |
|
AC_SUBST(BUILD_OBJEXT) |
133 |
|
AC_SUBST(CC_FOR_BUILD) |
134 |
|
AC_SUBST(CFLAGS_FOR_BUILD) |
135 |
AC_SUBST(HAVE_MEMMOVE) |
AC_SUBST(HAVE_MEMMOVE) |
136 |
AC_SUBST(HAVE_STRERROR) |
AC_SUBST(HAVE_STRERROR) |
137 |
|
AC_SUBST(LINK_SIZE) |
138 |
|
AC_SUBST(MATCH_LIMIT) |
139 |
AC_SUBST(NEWLINE) |
AC_SUBST(NEWLINE) |
|
AC_SUBST(UTF8) |
|
140 |
AC_SUBST(PCRE_MAJOR) |
AC_SUBST(PCRE_MAJOR) |
141 |
AC_SUBST(PCRE_MINOR) |
AC_SUBST(PCRE_MINOR) |
142 |
AC_SUBST(PCRE_DATE) |
AC_SUBST(PCRE_DATE) |
143 |
AC_SUBST(PCRE_VERSION) |
AC_SUBST(PCRE_VERSION) |
144 |
AC_SUBST(PCRE_LIB_VERSION) |
AC_SUBST(PCRE_LIB_VERSION) |
145 |
AC_SUBST(PCRE_POSIXLIB_VERSION) |
AC_SUBST(PCRE_POSIXLIB_VERSION) |
146 |
|
AC_SUBST(POSIX_MALLOC_THRESHOLD) |
147 |
|
AC_SUBST(UTF8) |
148 |
|
|
149 |
|
dnl Stuff to make Win32 work better |
150 |
|
|
151 |
|
case $host_os in |
152 |
|
mingw* ) |
153 |
|
POSIX_OBJ=pcreposix.o |
154 |
|
POSIX_LOBJ=pcreposix.lo |
155 |
|
POSIX_LIB= |
156 |
|
ON_WINDOWS= |
157 |
|
NOT_ON_WINDOWS="#" |
158 |
|
WIN_PREFIX= |
159 |
|
;; |
160 |
|
cygwin* ) |
161 |
|
ON_WINDOWS= |
162 |
|
POSIX_OBJ=pcreposix.o |
163 |
|
POSIX_LOBJ=pcreposix.lo |
164 |
|
POSIX_LIB= |
165 |
|
WIN_PREFIX=cyg |
166 |
|
NOT_ON_WINDOWS="#" |
167 |
|
;; |
168 |
|
* ) |
169 |
|
ON_WINDOWS="#" |
170 |
|
NOT_ON_WINDOWS= |
171 |
|
POSIX_OBJ= |
172 |
|
POSIX_LOBJ= |
173 |
|
POSIX_LIB=libpcreposix.la |
174 |
|
WIN_PREFIX= |
175 |
|
;; |
176 |
|
esac |
177 |
|
AC_SUBST(WIN_PREFIX) |
178 |
|
AC_SUBST(ON_WINDOWS) |
179 |
|
AC_SUBST(NOT_ON_WINDOWS) |
180 |
|
AC_SUBST(POSIX_OBJ) |
181 |
|
AC_SUBST(POSIX_LOBJ) |
182 |
|
AC_SUBST(POSIX_LIB) |
183 |
|
|
184 |
|
if test "x$enable_shared" = "xno" ; then |
185 |
|
AC_DEFINE(PCRE_STATIC,1) |
186 |
|
fi |
187 |
|
|
188 |
dnl This must be last; it determines what files are written as well as config.h |
dnl This must be last; it determines what files are written as well as config.h |
189 |
AC_OUTPUT(Makefile pcre.h:pcre.in pcre-config:pcre-config.in RunTest:RunTest.in,[chmod a+x RunTest pcre-config]) |
AC_OUTPUT(Makefile pcre.h:pcre.in pcre-config:pcre-config.in RunTest:RunTest.in,[chmod a+x RunTest pcre-config]) |