/[pcre]/code/trunk/configure.in
ViewVC logotype

Diff of /code/trunk/configure.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 63 by nigel, Sat Feb 24 21:40:03 2007 UTC revision 77 by nigel, Sat Feb 24 21:40:45 2007 UTC
# Line 5  dnl it should be seeing, to verify it is Line 5  dnl it should be seeing, to verify it is
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.
# Line 16  dnl macro, and may be treated as octal c Line 20  dnl macro, and may be treated as octal c
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=4  PCRE_MAJOR=6
24  PCRE_MINOR=0  PCRE_MINOR=0
25  PCRE_DATE=17-Feb-2003  PCRE_DATE=07-Jun-2005
26  PCRE_VERSION=${PCRE_MAJOR}.${PCRE_MINOR}  PCRE_VERSION=${PCRE_MAJOR}.${PCRE_MINOR}
27    
28  dnl Default values for miscellaneous macros  dnl Default values for miscellaneous macros
29    
30  POSIX_MALLOC_THRESHOLD=-DPOSIX_MALLOC_THRESHOLD=10  POSIX_MALLOC_THRESHOLD=-DPOSIX_MALLOC_THRESHOLD=10
 HOST_CC=${HOST_CC:-'$(CC)'}  
 HOST_CFLAGS=${HOST_CFLAGS:-'$(CFLAGS)'}  
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    
35  PCRE_LIB_VERSION=0:1:0  PCRE_LIB_VERSION=0:1:0
36  PCRE_POSIXLIB_VERSION=0:0:0  PCRE_POSIXLIB_VERSION=0:0:0
37    PCRE_CPPLIB_VERSION=0:0:0
38    
39  dnl Checks for programs.  dnl Checks for programs.
40    
41  AC_PROG_CC  AC_PROG_CC
42    
43    dnl For the C++ wrapper libpcrecpp.
44    
45    AC_PROG_CXX
46    
47    if test -n "$ac_cv_prog_ac_ct_CXX"; then
48      MAYBE_CPP_TARGETS='$(CPP_TARGETS)'
49    fi
50    echo "Maybe-cpp-targets: '$ac_cv_prog_CXX' '$MAYBE_CPP_TARGETS'" #!!
51    AC_SUBST(MAYBE_CPP_TARGETS)
52    
53    dnl The icc compiler has the same options as gcc, so let the rest of the
54    dnl configure script think it has gcc when setting up dnl options etc.
55    dnl This is a nasty hack which no longer seems necessary with the update
56    dnl to the latest libtool files, so I have commented it out.
57    dnl
58    dnl if test "$CC" = "icc" ; then GCC=yes ; fi
59    
60  AC_PROG_INSTALL  AC_PROG_INSTALL
61  AC_LIBTOOL_WIN32_DLL  AC_LIBTOOL_WIN32_DLL
62  AC_PROG_LIBTOOL  AC_PROG_LIBTOOL
63    
64    dnl We need to find a compiler for compiling a program to run on the local host
65    dnl while building. It needs to be different from CC when cross-compiling.
66    dnl There is a macro called AC_PROG_CC_FOR_BUILD in the GNU archive for
67    dnl figuring this out automatically. Unfortunately, it does not work with the
68    dnl latest versions of autoconf. So for the moment, we just default to the
69    dnl same values as the "main" compiler. People who are corss-compiling will
70    dnl just have to adjust the Makefile by hand or set these values when they
71    dnl run "configure".
72    
73    CC_FOR_BUILD=${CC_FOR_BUILD:-'$(CC)'}
74    CXX_FOR_BUILD=${CXX_FOR_BUILD:-'$(CXX)'}
75    CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD:-'$(CFLAGS)'}
76    CPPFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD:-'$(CPPFLAGS)'}
77    CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD:-'$(CXXFLAGS)'}
78    BUILD_EXEEXT=${BUILD_EXEEXT:-'$(EXEEXT)'}
79    BUILD_OBJEXT=${BUILD_OBJEXT:-'$(OBJEXT)'}
80    
81  dnl Checks for header files.  dnl Checks for header files.
82    
83  AC_HEADER_STDC  AC_HEADER_STDC
84  AC_CHECK_HEADERS(limits.h)  AC_CHECK_HEADERS(limits.h)
85    
86    dnl These are C++ header files
87    
88    AC_LANG_SAVE
89    AC_LANG_CPLUSPLUS
90    dnl I could be more clever here, given I'm doing AC_SUBST with this
91    dnl (eg set a var to be the name of the include file I want).  But I'm not
92    dnl so it's easy to change back to 'regular' autoconf vars if we needed to.
93    AC_CHECK_HEADERS(bits/type_traits.h, [pcre_has_bits_type_traits="1"],
94                                         [pcre_has_bits_type_traits="0"])
95    AC_CHECK_HEADERS(type_traits.h, [pcre_has_type_traits="1"],
96                                    [pcre_has_type_traits="0"])
97    dnl Using AC_SUBST eliminates the need to include config.h in a public .h file
98    AC_SUBST(pcre_has_bits_type_traits)
99    AC_SUBST(pcre_has_type_traits)
100    AC_LANG_RESTORE
101    
102  dnl Checks for typedefs, structures, and compiler characteristics.  dnl Checks for typedefs, structures, and compiler characteristics.
103    
104  AC_C_CONST  AC_C_CONST
105  AC_TYPE_SIZE_T  AC_TYPE_SIZE_T
106    
107    AC_CHECK_TYPES([long long], [pcre_has_long_long="1"], [pcre_has_long_long="0"])
108    AC_CHECK_TYPES([unsigned long long], [pcre_has_ulong_long="1"], [pcre_has_ulong_long="0"])
109    AC_SUBST(pcre_has_long_long)
110    AC_SUBST(pcre_has_ulong_long)
111    
112  dnl Checks for library functions.  dnl Checks for library functions.
113    
114  AC_CHECK_FUNCS(bcopy memmove strerror)  AC_CHECK_FUNCS(bcopy memmove strerror strtoq strtoll)
115    
116  dnl Handle --enable-utf8  dnl Handle --enable-utf8
117    
# Line 63  if test "$enableval" = "yes"; then Line 122  if test "$enableval" = "yes"; then
122  fi  fi
123  )  )
124    
125    dnl Handle --enable-unicode-properties
126    
127    AC_ARG_ENABLE(unicode-properties,
128    [  --enable-unicode-properties  enable Unicode properties support],
129    if test "$enableval" = "yes"; then
130      UCP=-DSUPPORT_UCP
131    fi
132    )
133    
134  dnl Handle --enable-newline-is-cr  dnl Handle --enable-newline-is-cr
135    
136  AC_ARG_ENABLE(newline-is-cr,  AC_ARG_ENABLE(newline-is-cr,
# Line 81  if test "$enableval" = "yes"; then Line 149  if test "$enableval" = "yes"; then
149  fi  fi
150  )  )
151    
152    dnl Handle --enable-ebcdic
153    
154    AC_ARG_ENABLE(ebcdic,
155    [  --enable-ebcdic         assume EBCDIC coding rather than ASCII],
156    if test "$enableval" == "yes"; then
157      EBCDIC=-DEBCDIC=1
158    fi
159    )
160    
161    dnl Handle --disable-stack-for-recursion
162    
163    AC_ARG_ENABLE(stack-for-recursion,
164    [  --disable-stack-for-recursion  disable use of stack recursion when matching],
165    if test "$enableval" = "no"; then
166      NO_RECURSE=-DNO_RECURSE
167    fi
168    )
169    
170  dnl There doesn't seem to be a straightforward way of having parameters  dnl There doesn't seem to be a straightforward way of having parameters
171  dnl that set values, other than fudging the --with thing. So that's what  dnl that set values, other than fudging the --with thing. So that's what
172  dnl I've done.  dnl I've done.
# Line 106  AC_ARG_WITH(match-limit, Line 192  AC_ARG_WITH(match-limit,
192    MATCH_LIMIT=-DMATCH_LIMIT=$withval    MATCH_LIMIT=-DMATCH_LIMIT=$withval
193  )  )
194    
195  dnl Now arrange to build libtool  dnl Unicode character property support implies UTF-8 support
196    
197  AC_PROG_LIBTOOL  if test "$UCP" != "" ; then
198      UTF8=-DSUPPORT_UTF8
199    fi
200    
201  dnl "Export" these variables  dnl "Export" these variables
202    
203    AC_SUBST(BUILD_EXEEXT)
204    AC_SUBST(BUILD_OBJEXT)
205    AC_SUBST(CC_FOR_BUILD)
206    AC_SUBST(CXX_FOR_BUILD)
207    AC_SUBST(CFLAGS_FOR_BUILD)
208    AC_SUBST(CXXFLAGS_FOR_BUILD)
209    AC_SUBST(EBCDIC)
210  AC_SUBST(HAVE_MEMMOVE)  AC_SUBST(HAVE_MEMMOVE)
211  AC_SUBST(HAVE_STRERROR)  AC_SUBST(HAVE_STRERROR)
 AC_SUBST(HOST_CC)  
 AC_SUBST(HOST_CFLAGS)  
 AC_SUBST(NEWLINE)  
212  AC_SUBST(LINK_SIZE)  AC_SUBST(LINK_SIZE)
213  AC_SUBST(MATCH_LIMIT)  AC_SUBST(MATCH_LIMIT)
214  AC_SUBST(UTF8)  AC_SUBST(NEWLINE)
215    AC_SUBST(NO_RECURSE)
216  AC_SUBST(PCRE_MAJOR)  AC_SUBST(PCRE_MAJOR)
217  AC_SUBST(PCRE_MINOR)  AC_SUBST(PCRE_MINOR)
218  AC_SUBST(PCRE_DATE)  AC_SUBST(PCRE_DATE)
219  AC_SUBST(PCRE_VERSION)  AC_SUBST(PCRE_VERSION)
220  AC_SUBST(PCRE_LIB_VERSION)  AC_SUBST(PCRE_LIB_VERSION)
221  AC_SUBST(PCRE_POSIXLIB_VERSION)  AC_SUBST(PCRE_POSIXLIB_VERSION)
222    AC_SUBST(PCRE_CPPLIB_VERSION)
223  AC_SUBST(POSIX_MALLOC_THRESHOLD)  AC_SUBST(POSIX_MALLOC_THRESHOLD)
224    AC_SUBST(UCP)
225    AC_SUBST(UTF8)
226    
227  dnl Stuff to make Win32 work better  dnl Stuff to make MinGW work better. Special treatment is no longer
228    dnl needed for Cygwin.
229    
230  case $host_os in  case $host_os in
231  mingw* )  mingw* )
232      POSIX_OBJ=pcreposix.o      POSIX_OBJ=pcreposix.o
233      POSIX_LOBJ=pcreposix.lo      POSIX_LOBJ=pcreposix.lo
234      POSIX_LIB=      POSIX_LIB=
235        ON_WINDOWS=
236        NOT_ON_WINDOWS="#"
237        WIN_PREFIX=
238      ;;      ;;
239  * )  * )
240        ON_WINDOWS="#"
241        NOT_ON_WINDOWS=
242      POSIX_OBJ=      POSIX_OBJ=
243      POSIX_LOBJ=      POSIX_LOBJ=
244      POSIX_LIB=libpcreposix.la      POSIX_LIB=libpcreposix.la
245        WIN_PREFIX=
246      ;;      ;;
247  esac  esac
248    AC_SUBST(WIN_PREFIX)
249    AC_SUBST(ON_WINDOWS)
250    AC_SUBST(NOT_ON_WINDOWS)
251  AC_SUBST(POSIX_OBJ)  AC_SUBST(POSIX_OBJ)
252  AC_SUBST(POSIX_LOBJ)  AC_SUBST(POSIX_LOBJ)
253  AC_SUBST(POSIX_LIB)  AC_SUBST(POSIX_LIB)
254    
255  if test "x$enable_shared" = "xno" ; then  if test "x$enable_shared" = "xno" ; then
256      AC_DEFINE(PCRE_STATIC,1)      AC_DEFINE([PCRE_STATIC],[1],[to link statically])
257  fi  fi
258    
259  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
260  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 libpcre.pc:libpcre.pc.in pcrecpp.h:pcrecpp.h.in pcre_stringpiece.h:pcre_stringpiece.h.in RunGrepTest:RunGrepTest.in RunTest:RunTest.in,[chmod a+x RunTest RunGrepTest pcre-config])

Legend:
Removed from v.63  
changed lines
  Added in v.77

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12