/[pcre]/code/branches/pcre16/configure.ac
ViewVC logotype

Diff of /code/branches/pcre16/configure.ac

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

revision 96 by nigel, Fri Mar 2 13:10:43 2007 UTC revision 97 by ph10, Mon Mar 5 12:36:47 2007 UTC
# Line 1  Line 1 
1  dnl Process this file with autoconf to produce a configure script.  dnl Process this file with autoconf to produce a configure script.
2    
3  dnl This configure.in file has been hacked around quite a lot as a result of  m4_define(pcre_major, [7])
4  dnl patches that various people have sent to me (PH). Sometimes the information  m4_define(pcre_minor, [1])
5  dnl I get is contradictory. I've tried to put in comments that explain things,  m4_define(pcre_prerelease, [-RC0])
6  dnl but in some cases the information is second-hand and I have no way of  m4_define(pcre_date, [2006-12-18])
7  dnl verifying it. I am not an autoconf or libtool expert!  
8    # Libtool shared library interface versions (current:revision:age)
9  dnl This is required at the start; the name is the name of a file  m4_define(libpcre_version, [0:1:0])
10  dnl it should be seeing, to verify it is in the same directory.  m4_define(libpcreposix_version, [0:0:0])
11    m4_define(libpcrecpp_version, [0:0:0])
 AC_INIT(dftables.c)  
 AC_CONFIG_SRCDIR([pcre.h])  
   
 dnl A safety precaution  
12    
13  AC_PREREQ(2.57)  AC_PREREQ(2.57)
14    AC_INIT(PCRE, pcre_major.pcre_minor[]pcre_prerelease, , pcre)
15    AC_CONFIG_SRCDIR([pcre.h.in])
16    AM_INIT_AUTOMAKE([dist-bzip2 dist-zip])
17    AC_CONFIG_HEADERS(config.h)
18    AC_PROG_CC
19    AC_PROG_CXX
20    AC_PROG_INSTALL
21    AC_LIBTOOL_WIN32_DLL
22    AC_PROG_LIBTOOL
23    
24  dnl Arrange to build config.h from config.h.in.  PCRE_MAJOR="pcre_major"
25  dnl Manual says this macro should come right after AC_INIT.  PCRE_MINOR="pcre_minor"
26  AC_CONFIG_HEADER(config.h)  PCRE_PRERELEASE="pcre_prerelease"
27    PCRE_DATE="pcre_date"
28  dnl Default values for miscellaneous macros  
29    AC_SUBST(PCRE_MAJOR)
30  POSIX_MALLOC_THRESHOLD=-DPOSIX_MALLOC_THRESHOLD=10  AC_SUBST(PCRE_MINOR)
31    AC_SUBST(PCRE_PRERELEASE)
32    AC_SUBST(PCRE_DATE)
33    
34  dnl Provide versioning information for libtool shared libraries that  # Set a more sensible default value for $(htmldir).
35  dnl are built by default on Unix systems.  if test "x$htmldir" = 'x${docdir}'
36    then
37      htmldir='${docdir}/html'
38    fi
39    
40  PCRE_LIB_VERSION=0:1:0  # Handle --disable-cpp
41  PCRE_POSIXLIB_VERSION=0:0:0  AC_ARG_ENABLE(cpp,
42  PCRE_CPPLIB_VERSION=0:0:0                AS_HELP_STRING([--disable-cpp],
43                                 [disable C++ support]),
44                  , enable_cpp=yes)
45    
46  dnl Find the PCRE version from the pcre.h file. The PCRE_VERSION variable is  # Handle --enable-utf8 (disabled by default)
47  dnl substituted in pcre-config.in.  AC_ARG_ENABLE(utf8,
48                  AS_HELP_STRING([--enable-utf8],
49                                 [enable UTF-8 support]),
50                  , enable_utf8=unset)
51    
52  PCRE_MAJOR=`grep '#define PCRE_MAJOR' ${srcdir}/pcre.h | cut -c 29-`  # Handle --enable-unicode-properties
53  PCRE_MINOR=`grep '#define PCRE_MINOR' ${srcdir}/pcre.h | cut -c 29-`  AC_ARG_ENABLE(unicode-properties,
54  PCRE_PRERELEASE=`grep '#define PCRE_PRERELEASE' ${srcdir}/pcre.h | cut -c 29-`                AS_HELP_STRING([--enable-unicode-properties],
55  PCRE_VERSION=${PCRE_MAJOR}.${PCRE_MINOR}${PCRE_PRERELEASE}                               [enable Unicode properties support (implies --enable-utf8)]),
56                  , enable_unicode_properties=no)
57    
58    # Handle --enable-newline=NL
59    dnl AC_ARG_ENABLE(newline,
60    dnl               AS_HELP_STRING([--enable-newline=NL],
61    dnl                              [use NL as newline (lf, cr, crlf, any; default=lf)]),
62    dnl               , enable_newline=lf)
63    
64  dnl Handle --disable-cpp  # Separate newline options
65    ac_pcre_newline=lf
66    AC_ARG_ENABLE(newline-is-cr,
67                  AS_HELP_STRING([--enable-newline-is-cr],
68                                 [use CR as newline character]),
69                  ac_pcre_newline=cr)
70    AC_ARG_ENABLE(newline-is-lf,
71                  AS_HELP_STRING([--enable-newline-is-lf],
72                                 [use LF as newline character (default)]),
73                  ac_pcre_newline=lf)
74    AC_ARG_ENABLE(newline-is-crlf,
75                  AS_HELP_STRING([--enable-newline-is-crlf],
76                                 [use CRLF as newline sequence]),
77                  ac_pcre_newline=crlf)
78    AC_ARG_ENABLE(newline-is-any,
79                  AS_HELP_STRING([--enable-newline-is-any],
80                                 [use any valid Unicode newline sequence]),
81                  ac_pcre_newline=any)
82    enable_newline="$ac_pcre_newline"
83    
84  AC_ARG_ENABLE(cpp,  # Handle --enable-ebcdic
85  [  --disable-cpp           disable C++ support],  AC_ARG_ENABLE(ebcdic,
86  want_cpp="$enableval", want_cpp=yes)                AS_HELP_STRING([--enable-ebcdic],
87                                 [assume EBCDIC coding rather than ASCII]),
88                  , enable_ebcdic=no)
89    
90  dnl Checks for programs.  # Handle --disable-stack-for-recursion
91    AC_ARG_ENABLE(stack-for-recursion,
92                  AS_HELP_STRING([--disable-stack-for-recursion],
93                                 [don't use stack recursion when matching]),
94                  , enable_stack_for_recursion=yes)
95    
96  AC_PROG_CC  # Handle --with-posix-malloc-threshold=NBYTES
97    AC_ARG_WITH(posix-malloc-threshold,
98                AS_HELP_STRING([--with-posix-malloc-threshold=NBYTES],
99                               [threshold for POSIX malloc usage (default=10)]),
100                , with_posix_malloc_threshold=10)
101    
102  dnl Test for C++ for the C++ wrapper libpcrecpp. It seems, however, that  # Handle --with-link-size=N
103  dnl AC_PROC_CXX will set $CXX to "g++" when no C++ compiler is installed, even  AC_ARG_WITH(link-size,
104  dnl though that is completely bogus. (This may happen only on certain systems              AS_HELP_STRING([--with-link-size=N],
105  dnl with certain versions of autoconf, of course.) An attempt to include this                             [internal link size (2, 3, or 4 allowed; default=2)]),
106  dnl test inside a check for want_cpp was criticized by a libtool expert, who              , with_link_size=2)
 dnl tells me that it isn't allowed.  
107    
108  AC_PROG_CXX  # Handle --with-match-limit=N
109    AC_ARG_WITH(match-limit,
110                AS_HELP_STRING([--with-match-limit=N],
111                               [default limit on internal looping (default=10000000)]),
112                , with_match_limit=10000000)
113    
114    # Handle --with-match-limit_recursion=N
115    #
116    # Note: In config.h, the default is to define MATCH_LIMIT_RECURSION
117    # symbolically as MATCH_LIMIT, which in turn is defined to be some numeric
118    # value (e.g. 10000000). MATCH_LIMIT_RECURSION can otherwise be set to some
119    # different numeric value (or even the same numeric value as MATCH_LIMIT,
120    # though no longer defined in terms of the latter).
121    #
122    AC_ARG_WITH(match-limit-recursion,
123                AS_HELP_STRING([--with-match-limit-recursion=N],
124                               [default limit on internal recursion (default=MATCH_LIMIT)]),
125                , with_match_limit_recursion=MATCH_LIMIT)
126    
127    # Make sure that if enable_unicode_properties was set, that UTF-8 support
128    # is enabled.
129    #
130    if test "x$enable_unicode_properties" = "xyes"
131    then
132      if test "x$enable_utf8" = "xno"
133      then
134        AC_MSG_ERROR([support for Unicode properties requires UTF-8 support])
135      fi
136      enable_utf8=yes
137    fi
138    
139  dnl The icc compiler has the same options as gcc, so let the rest of the  if test "x$enable_utf8" = "xunset"
140  dnl configure script think it has gcc when setting up dnl options etc.  then
141  dnl This is a nasty hack which no longer seems necessary with the update    enable_utf8=no
142  dnl to the latest libtool files, so I have commented it out.  fi
 dnl  
 dnl if test "$CC" = "icc" ; then GCC=yes ; fi  
143    
144  AC_PROG_INSTALL  # Convert the newline identifier into the appropriate integer value.
145  AC_LIBTOOL_WIN32_DLL  case "$enable_newline" in
146  AC_PROG_LIBTOOL    lf)   ac_pcre_newline_value=10   ;;
147      cr)   ac_pcre_newline_value=13   ;;
148      crlf) ac_pcre_newline_value=3338 ;;
149      any)  ac_pcre_newline_value=-1   ;;
150      *)
151      AC_MSG_ERROR([invalid argument \"$enable_newline\" to --enable-newline option])
152      ;;
153    esac
154    
155  dnl We need to find a compiler for compiling a program to run on the local host  # Check argument to --with-link-size
156  dnl while building. It needs to be different from CC when cross-compiling.  case "$with_link_size" in
157  dnl There is a macro called AC_PROG_CC_FOR_BUILD in the GNU archive for    2|3|4) ;;
158  dnl figuring this out automatically. Unfortunately, it does not work with the    *)
159  dnl latest versions of autoconf. So for the moment, we just default to the    AC_MSG_ERROR([invalid argument \"$with_link_size\" to --with-link-size option])
160  dnl same values as the "main" compiler. People who are cross-compiling will    ;;
161  dnl just have to adjust the Makefile by hand or set these values when they  esac
 dnl run "configure".  
   
 CC_FOR_BUILD=${CC_FOR_BUILD:-'$(CC)'}  
 CXX_FOR_BUILD=${CXX_FOR_BUILD:-'$(CXX)'}  
 CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD:-'$(CFLAGS)'}  
 CPPFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD:-'$(CPPFLAGS)'}  
 CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD:-'$(CXXFLAGS)'}  
 BUILD_EXEEXT=${BUILD_EXEEXT:-'$(EXEEXT)'}  
 BUILD_OBJEXT=${BUILD_OBJEXT:-'$(OBJEXT)'}  
162    
163  dnl Checks for header files.  AH_TOP([
164    /* On Unix-like systems config.in is converted by "configure" into
165    config.h.  Some other environments also support the use of "configure".
166    PCRE is written in Standard C, but there are a few non-standard things
167    it can cope with, allowing it to run on SunOS4 and other "close to
168    standard" systems.
169    
170    On a non-Unix-like system you should just copy this file into config.h,
171    and set up the macros the way you need them.  You should normally change
172    the definitions of HAVE_STRERROR and HAVE_MEMMOVE to 1.  Unfortunately,
173    because of the way autoconf works, these cannot be made the defaults.
174    If your system has bcopy() and not memmove(), change the definition of
175    HAVE_BCOPY instead of HAVE_MEMMOVE.  If your system has neither bcopy()
176    nor memmove(), leave them both as 0; an emulation function will be
177    used. */])
178    
179    # Checks for header files.
180  AC_HEADER_STDC  AC_HEADER_STDC
181  AC_CHECK_HEADERS(limits.h)  AC_CHECK_HEADERS(limits.h sys/types.h sys/stat.h dirent.h windows.h)
   
 dnl The files below are C++ header files. One person told me (PH) that  
 dnl AC_LANG_CPLUSPLUS unsets CXX if it was explicitly set to something which  
 dnl doesn't work. However, this doesn't always seem to be the case.  
182    
183  if test "x$want_cpp" = "xyes" -a -n "$CXX"  # The files below are C++ header files.
184    pcre_have_type_traits="0"
185    pcre_have_bits_type_traits="0"
186    if test "x$enable_cpp" = "xyes" -a -n "$CXX"
187  then  then
188  AC_LANG_SAVE  AC_LANG_PUSH(C++)
 AC_LANG_CPLUSPLUS  
189    
190  dnl We could be more clever here, given we're doing AC_SUBST with this  # We could be more clever here, given we're doing AC_SUBST with this
191  dnl (eg set a var to be the name of the include file we want).  But we're not  # (eg set a var to be the name of the include file we want).  But we're not
192  dnl so it's easy to change back to 'regular' autoconf vars if we needed to.  # so it's easy to change back to 'regular' autoconf vars if we needed to.
193  AC_CHECK_HEADERS(string, [pcre_have_cpp_headers="1"],  AC_CHECK_HEADERS(string, [pcre_have_cpp_headers="1"],
194                           [pcre_have_cpp_headers="0"])                           [pcre_have_cpp_headers="0"])
195  AC_CHECK_HEADERS(bits/type_traits.h, [pcre_have_bits_type_traits="1"],  AC_CHECK_HEADERS(bits/type_traits.h, [pcre_have_bits_type_traits="1"],
196                                       [pcre_have_bits_type_traits="0"])                                       [pcre_have_bits_type_traits="0"])
197  AC_CHECK_HEADERS(type_traits.h, [pcre_have_type_traits="1"],  AC_CHECK_HEADERS(type_traits.h, [pcre_have_type_traits="1"],
198                                  [pcre_have_type_traits="0"])                                  [pcre_have_type_traits="0"])
199  dnl Using AC_SUBST eliminates the need to include config.h in a public .h file  AC_LANG_POP
 AC_SUBST(pcre_have_bits_type_traits)  
 AC_SUBST(pcre_have_type_traits)  
 AC_LANG_RESTORE  
200  fi  fi
201    # Using AC_SUBST eliminates the need to include config.h in a public .h file
202    AC_SUBST(pcre_have_type_traits)
203    AC_SUBST(pcre_have_bits_type_traits)
204    
205  dnl From the above, we now have enough info to know if C++ is fully installed  # Conditional compilation
206  if test "x$want_cpp" = "xyes" -a -n "$CXX" -a "$pcre_have_cpp_headers" = 1; then  AM_CONDITIONAL(WITH_PCRE_CPP, test "x$enable_cpp" = "xyes")
   MAYBE_CPP_TARGETS='$(CPP_TARGETS)'  
   HAVE_CPP=  
 else  
   MAYBE_CPP_TARGETS=  
   HAVE_CPP="#"  
 fi  
 AC_SUBST(MAYBE_CPP_TARGETS)  
 AC_SUBST(HAVE_CPP)  
207    
208  dnl Checks for typedefs, structures, and compiler characteristics.  # Checks for typedefs, structures, and compiler characteristics.
209    
210  AC_C_CONST  AC_C_CONST
211  AC_TYPE_SIZE_T  AC_TYPE_SIZE_T
212    
213  AC_CHECK_TYPES([long long], [pcre_have_long_long="1"], [pcre_have_long_long="0"])  AC_CHECK_TYPES([long long],
214  AC_CHECK_TYPES([unsigned long long], [pcre_have_ulong_long="1"], [pcre_have_ulong_long="0"])                 [pcre_have_long_long="1"],
215                   [pcre_have_long_long="0"])
216    AC_CHECK_TYPES([unsigned long long],
217                   [pcre_have_ulong_long="1"],
218                   [pcre_have_ulong_long="0"])
219  AC_SUBST(pcre_have_long_long)  AC_SUBST(pcre_have_long_long)
220  AC_SUBST(pcre_have_ulong_long)  AC_SUBST(pcre_have_ulong_long)
221    
222  dnl Checks for library functions.  # Checks for library functions.
223    
224  AC_CHECK_FUNCS(bcopy memmove strerror strtoq strtoll)  AC_CHECK_FUNCS(bcopy memmove strerror strtoq strtoll)
225    
226  dnl Handle --enable-utf8  # This facilitates -ansi builds under Linux
227    dnl AC_DEFINE([_GNU_SOURCE], [], [Enable GNU extensions in glibc])
 AC_ARG_ENABLE(utf8,  
 [  --enable-utf8           enable UTF8 support],  
 if test "$enableval" = "yes"; then  
   UTF8=-DSUPPORT_UTF8  
 fi  
 )  
   
 dnl Handle --enable-unicode-properties  
228    
229  AC_ARG_ENABLE(unicode-properties,  if test "x$enable_shared" = "xno" ; then
230  [  --enable-unicode-properties  enable Unicode properties support],    AC_DEFINE([PCRE_STATIC], [1], [
231  if test "$enableval" = "yes"; then      Define if linking statically (TODO: make nice with Libtool)])
   UCP=-DSUPPORT_UCP  
 fi  
 )  
   
 dnl Handle --enable-newline-is-cr  
   
 AC_ARG_ENABLE(newline-is-cr,  
 [  --enable-newline-is-cr  use CR as the newline character],  
 if test "$enableval" = "yes"; then  
   NEWLINE=-DNEWLINE=13  
 fi  
 )  
   
 dnl Handle --enable-newline-is-lf  
   
 AC_ARG_ENABLE(newline-is-lf,  
 [  --enable-newline-is-lf  use LF as the newline character],  
 if test "$enableval" = "yes"; then  
   NEWLINE=-DNEWLINE=10  
 fi  
 )  
   
 dnl Handle --enable-newline-is-crlf  
   
 AC_ARG_ENABLE(newline-is-crlf,  
 [  --enable-newline-is-crlf  use CRLF as the newline sequence],  
 if test "$enableval" = "yes"; then  
   NEWLINE=-DNEWLINE=3338  
 fi  
 )  
   
 dnl Handle --enable-newline-is-any  
   
 AC_ARG_ENABLE(newline-is-any,  
 [  --enable-newline-is-any  use any Unicode newline sequence],  
 if test "$enableval" = "yes"; then  
   NEWLINE=-DNEWLINE=-1  
 fi  
 )  
   
 dnl Handle --enable-ebcdic  
   
 AC_ARG_ENABLE(ebcdic,  
 [  --enable-ebcdic         assume EBCDIC coding rather than ASCII],  
 if test "$enableval" = "yes"; then  
   EBCDIC=-DEBCDIC=1  
 fi  
 )  
   
 dnl Handle --disable-stack-for-recursion  
   
 AC_ARG_ENABLE(stack-for-recursion,  
 [  --disable-stack-for-recursion  disable use of stack recursion when matching],  
 if test "$enableval" = "no"; then  
   NO_RECURSE=-DNO_RECURSE  
232  fi  fi
 )  
233    
234  dnl There doesn't seem to be a straightforward way of having parameters  # Here is where pcre specific defines are handled
 dnl that set values, other than fudging the --with thing. So that's what  
 dnl I've done.  
235    
236  dnl Handle --with-posix-malloc-threshold=n  if test "$enable_utf8" = "yes"; then
237      AC_DEFINE([SUPPORT_UTF8], [], [
238  AC_ARG_WITH(posix-malloc-threshold,      Define to enable support for the UTF-8 Unicode encoding.])
239  [  --with-posix-malloc-threshold=10  threshold for POSIX malloc usage],  fi
240    POSIX_MALLOC_THRESHOLD=-DPOSIX_MALLOC_THRESHOLD=$withval  
241  )  if test "$enable_unicode_properties" = "yes"; then
242      AC_DEFINE([SUPPORT_UCP], [], [
243  dnl Handle --with-link-size=n      Define to enable support for Unicode properties])
244    fi
245  AC_ARG_WITH(link-size,  
246  [  --with-link-size=2    internal link size (2, 3, or 4 allowed)],  if test "$enable_stack_for_recursion" = "no"; then
247    LINK_SIZE=-DLINK_SIZE=$withval    AC_DEFINE([NO_RECURSE], [], [
248  )      PCRE uses recursive function calls to handle backtracking while
249        matching.  This can sometimes be a problem on systems that have
250  dnl Handle --with-match-limit=n      stacks of limited size.  Define NO_RECURSE to get a version that
251        doesn't use recursion in the match() function; instead it creates
252  AC_ARG_WITH(match-limit,      its own stack by steam using pcre_recurse_malloc() to obtain memory
253  [  --with-match-limit=10000000  default limit on internal looping],      from the heap. For more detail, see the comments and other stuff
254    MATCH_LIMIT=-DMATCH_LIMIT=$withval      just above the match() function. On systems that support it,
255  )      "configure" can be used to set this in the Makefile
256        (use --disable-stack-for-recursion).])
257  dnl Handle --with-match-limit_recursion=n  fi
258    
259  AC_ARG_WITH(match-limit-recursion,  AC_DEFINE_UNQUOTED([NEWLINE], [$ac_pcre_newline_value], [
260  [  --with-match-limit-recursion=10000000  default limit on internal recursion],    The value of NEWLINE determines the newline character. The default is
261    MATCH_LIMIT_RECURSION=-DMATCH_LIMIT_RECURSION=$withval    to leave it up to the compiler, but some sites want to force a
262  )    particular value.  On Unix-like systems, "configure" can be used to
263      override this default.])
264    
265    AC_DEFINE_UNQUOTED([LINK_SIZE], [$with_link_size], [
266      The value of LINK_SIZE determines the number of bytes used to store
267      links as offsets within the compiled regex. The default is 2, which
268      allows for compiled patterns up to 64K long. This covers the vast
269      majority of cases. However, PCRE can also be compiled to use 3 or 4
270      bytes instead. This allows for longer patterns in extreme cases. On
271      systems that support it, "configure" can be used to override this default.])
272    
273    AC_DEFINE_UNQUOTED([POSIX_MALLOC_THRESHOLD], [$with_posix_malloc_threshold], [
274      When calling PCRE via the POSIX interface, additional working storage
275      is required for holding the pointers to capturing substrings because
276      PCRE requires three integers per substring, whereas the POSIX
277      interface provides only two. If the number of expected substrings is
278      small, the wrapper function uses space on the stack, because this is
279      faster than using malloc() for each call. The threshold above which
280      the stack is no longer used is defined by POSIX_MALLOC_THRESHOLD. On
281      systems that support it, "configure" can be used to override this
282      default.])
283    
284    AC_DEFINE_UNQUOTED([MATCH_LIMIT], [$with_match_limit], [
285      The value of MATCH_LIMIT determines the default number of times the
286      internal match() function can be called during a single execution of
287      pcre_exec().  There is a runtime interface for setting a different
288      limit. The limit exists in order to catch runaway regular
289      expressions that take for ever to determine that they do not match.
290      The default is set very large so that it does not accidentally catch
291      legitimate cases. On systems that support it, "configure" can be
292      used to override this default default.])
293    
294    AC_DEFINE_UNQUOTED([MATCH_LIMIT_RECURSION], [$with_match_limit_recursion], [
295      The above limit applies to all calls of match(), whether or not they
296      increase the recursion depth. In some environments it is desirable
297      to limit the depth of recursive calls of match() more strictly, in
298      order to restrict the maximum amount of stack (or heap, if
299      NO_RECURSE is defined) that is used. The value of
300      MATCH_LIMIT_RECURSION applies only to recursive calls of match(). To
301      have any useful effect, it must be less than the value of
302      MATCH_LIMIT. There is a runtime method for setting a different
303      limit. On systems that support it, "configure" can be used to
304      override this default default.])
305    
306    AC_DEFINE([MAX_NAME_SIZE], [32], [
307      This limit is parameterized just in case anybody ever wants to
308      change it. Care must be taken if it is increased, because it guards
309      against integer overflow caused by enormously large patterns.])
310    
311    AC_DEFINE([MAX_NAME_COUNT], [10000], [
312      This limit is parameterized just in case anybody ever wants to
313      change it. Care must be taken if it is increased, because it guards
314      against integer overflow caused by enormously large patterns.])
315    
316    AC_DEFINE([MAX_DUPLENGTH], [30000], [
317      This limit is parameterized just in case anybody ever wants to
318      change it. Care must be taken if it is increased, because it guards
319      against integer overflow caused by enormously large patterns.])
320    
321    AH_VERBATIM([PCRE_DATA_SCOPE], [
322    /* If you are compiling for a system other than a Unix-like system or
323       Win32, and it needs some magic to be inserted before the definition
324       of a function that is exported by the library, define this macro to
325       contain the relevant magic. If you do not define this macro, it
326       defaults to "extern" for a C compiler and "extern C" for a C++
327       compiler on non-Win32 systems. This macro apears at the start of
328       every exported function that is part of the external API. It does
329       not appear on functions that are "external" in the C sense, but
330       which are internal to the library. */
331    #undef PCRE_DATA_SCOPE])
332    
333    if test "$enable_ebcdic" = "yes"; then
334      AC_DEFINE_UNQUOTED([EBCDIC], [], [
335        If you are compiling for a system that uses EBCDIC instead of ASCII
336        character codes, define this macro as 1. On systems that can use
337        "configure", this can be done via --enable-ebcdic.])
338    fi
339    
340    # Here is where pcre specific substs are handled
341    # These 3 are only used by RunTest.in.
342    # TODO: remove once RunTest uses pcretest -C instead.
343    AC_SUBST(LINK_SIZE, $with_link_size)
344    AC_SUBST(UTF8, $enable_utf8)
345    AC_SUBST(UCP, $enable_unicode_properties)
346    
347    # Platform specific issues
348    NO_UNDEFINED=
349    EXPORT_ALL_SYMBOLS=
350    case $host_os in
351      cygwin* | mingw* )
352        if test X"$enable_shared" = Xyes; then
353          NO_UNDEFINED="-no-undefined"
354          EXPORT_ALL_SYMBOLS="-Wl,--export-all-symbols"
355        fi
356        ;;
357    esac
358    
359  dnl Unicode character property support implies UTF-8 support  # The extra LDFLAGS for each particular library
360    # (Note: The libpcre*_version bits are m4 variables, assigned above)
361    
362  if test "$UCP" != "" ; then  EXTRA_LIBPCRE_LDFLAGS="$NO_UNDEFINED -version-info libpcre_version"
   UTF8=-DSUPPORT_UTF8  
 fi  
363    
364  dnl "Export" these variables  EXTRA_LIBPCREPOSIX_LDFLAGS="$NO_UNDEFINED -version-info libpcreposix_version"
365    
366  AC_SUBST(BUILD_EXEEXT)  EXTRA_LIBPCRECPP_LDFLAGS="$NO_UNDEFINED $EXPORT_ALL_SYMBOLS -version-info libpcrecpp_version"
 AC_SUBST(BUILD_OBJEXT)  
 AC_SUBST(CC_FOR_BUILD)  
 AC_SUBST(CXX_FOR_BUILD)  
 AC_SUBST(CFLAGS_FOR_BUILD)  
 AC_SUBST(CXXFLAGS_FOR_BUILD)  
 AC_SUBST(CXXLDFLAGS)  
 AC_SUBST(EBCDIC)  
 AC_SUBST(HAVE_MEMMOVE)  
 AC_SUBST(HAVE_STRERROR)  
 AC_SUBST(LINK_SIZE)  
 AC_SUBST(MATCH_LIMIT)  
 AC_SUBST(MATCH_LIMIT_RECURSION)  
 AC_SUBST(NEWLINE)  
 AC_SUBST(NO_RECURSE)  
 AC_SUBST(PCRE_LIB_VERSION)  
 AC_SUBST(PCRE_POSIXLIB_VERSION)  
 AC_SUBST(PCRE_CPPLIB_VERSION)  
 AC_SUBST(PCRE_VERSION)  
 AC_SUBST(POSIX_MALLOC_THRESHOLD)  
 AC_SUBST(UCP)  
 AC_SUBST(UTF8)  
367    
368  dnl Stuff to make MinGW work better. Special treatment is no longer  AC_SUBST(EXTRA_LIBPCRE_LDFLAGS)
369  dnl needed for Cygwin.  AC_SUBST(EXTRA_LIBPCREPOSIX_LDFLAGS)
370    AC_SUBST(EXTRA_LIBPCRECPP_LDFLAGS)
371    
372    # When we run 'make distcheck', use these arguments.
373    DISTCHECK_CONFIGURE_FLAGS="--enable-cpp --enable-unicode-properties"
374    AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
375    
376    # Produce these files, in addition to config.h.
377    AC_CONFIG_FILES(
378            Makefile
379            RunGrepTest
380            RunTest
381            libpcre.pc
382            libpcrecpp.pc
383            pcre-config
384            pcre.h
385            pcre_stringpiece.h
386            pcrecpparg.h
387    )
388    
389    # Make the generated script files executable.
390    AC_CONFIG_COMMANDS([script-chmod], [chmod a+x RunTest RunGrepTest pcre-config])
391    
392    AC_OUTPUT
393    
394    # Print out a nice little message after configure is run displaying your
395    # chosen options.
396    #
397    cat <<EOF
398    
399    $PACKAGE-$VERSION configuration summary:
400    
401        Install prefix ......... : ${prefix}
402        C preprocessor ......... : ${CPP}
403        C compiler ............. : ${CC}
404        C++ preprocessor ....... : ${CXXCPP}
405        C++ compiler ........... : ${CXX}
406        Linker ................. : ${LD}
407        C preprocessor flags ... : ${CPPFLAGS}
408        C compiler flags ....... : ${CFLAGS}
409        C++ compiler flags ..... : ${CXXFLAGS}
410        Linker flags ........... : ${LDFLAGS}
411        Extra libraries ........ : ${LIBS}
412    
413        Build C++ library ...... : ${enable_cpp}
414        Enable UTF-8 support ... : ${enable_utf8}
415        Unicode properties ..... : ${enable_unicode_properties}
416        Newline char/sequence .. : ${enable_newline}
417        EBCDIC coding .......... : ${enable_ebcdic}
418        Use stack recursion .... : ${enable_stack_for_recursion}
419        POSIX mem threshold .... : ${with_posix_malloc_threshold}
420        Internal link size ..... : ${with_link_size}
421        Match limit ............ : ${with_match_limit}
422        Match limit recursion .. : ${with_match_limit_recursion}
423        Build shared libs ...... : ${enable_shared}
424        Build static libs ...... : ${enable_static}
425    
426  case $host_os in  EOF
 mingw* )  
     POSIX_OBJ=pcreposix.o  
     POSIX_LOBJ=pcreposix.lo  
     POSIX_LIB=  
     ON_WINDOWS=  
     NOT_ON_WINDOWS="#"  
     WIN_PREFIX=  
     ;;  
 * )  
     ON_WINDOWS="#"  
     NOT_ON_WINDOWS=  
     POSIX_OBJ=  
     POSIX_LOBJ=  
     POSIX_LIB=libpcreposix.la  
     WIN_PREFIX=  
     ;;  
 esac  
 AC_SUBST(WIN_PREFIX)  
 AC_SUBST(ON_WINDOWS)  
 AC_SUBST(NOT_ON_WINDOWS)  
 AC_SUBST(POSIX_OBJ)  
 AC_SUBST(POSIX_LOBJ)  
 AC_SUBST(POSIX_LIB)  
   
 if test "x$enable_shared" = "xno" ; then  
     AC_DEFINE([PCRE_STATIC],[1],[to link statically])  
 fi  
427    
428  dnl This must be last; it determines what files are written as well as config.h  dnl end configure.ac
 AC_OUTPUT(Makefile pcre-config:pcre-config.in libpcre.pc:libpcre.pc.in libpcrecpp.pc:libpcrecpp.pc.in pcrecpparg.h:pcrecpparg.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.96  
changed lines
  Added in v.97

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12