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

Diff of /code/trunk/configure.ac

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

revision 247 by ph10, Mon Sep 17 09:38:32 2007 UTC revision 885 by ph10, Tue Jan 17 14:12:47 2012 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 NOTE FOR MAINTAINERS: Do not use major or minor version numbers with  dnl NOTE FOR MAINTAINERS: Do not use minor version numbers 08 or 09 because
4  dnl leading zeros, because they may be treated as octal constants. The  dnl the leading zeros may cause them to be treated as invalid octal constants
5  dnl PCRE_PRERELEASE feature is for identifying release candidates. It might  dnl if a PCRE user writes code that uses PCRE_MINOR as a number. There is now
6  dnl be defined as -RC2, for example. For real releases, it should be defined  dnl a check further down that throws an error if 08 or 09 are used.
7  dnl empty.  
8    dnl The PCRE_PRERELEASE feature is for identifying release candidates. It might
9  m4_define(pcre_major, [7])  dnl be defined as -RC2, for example. For real releases, it should be empty.
10  m4_define(pcre_minor, [4])  
11  m4_define(pcre_prerelease, [-RC3])  m4_define(pcre_major, [8])
12  m4_define(pcre_date, [2007-09-17])  m4_define(pcre_minor, [30])
13    m4_define(pcre_prerelease, [-PT1])
14    m4_define(pcre_date, [2012-01-01])
15    
16  # Libtool shared library interface versions (current:revision:age)  # Libtool shared library interface versions (current:revision:age)
17  m4_define(libpcre_version, [0:1:0])  m4_define(libpcre_version, [1:0:0])
18    m4_define(libpcre16_version, [0:0:0])
19  m4_define(libpcreposix_version, [0:0:0])  m4_define(libpcreposix_version, [0:0:0])
20  m4_define(libpcrecpp_version, [0:0:0])  m4_define(libpcrecpp_version, [0:0:0])
21    
# Line 20  AC_PREREQ(2.57) Line 23  AC_PREREQ(2.57)
23  AC_INIT(PCRE, pcre_major.pcre_minor[]pcre_prerelease, , pcre)  AC_INIT(PCRE, pcre_major.pcre_minor[]pcre_prerelease, , pcre)
24  AC_CONFIG_SRCDIR([pcre.h.in])  AC_CONFIG_SRCDIR([pcre.h.in])
25  AM_INIT_AUTOMAKE([dist-bzip2 dist-zip])  AM_INIT_AUTOMAKE([dist-bzip2 dist-zip])
26    m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
27  AC_CONFIG_HEADERS(config.h)  AC_CONFIG_HEADERS(config.h)
28    
29    # This was added at the suggestion of libtoolize (03-Jan-10)
30    AC_CONFIG_MACRO_DIR([m4])
31    
32  # The default CFLAGS and CXXFLAGS in Autoconf are "-g -O2" for gcc and just  # The default CFLAGS and CXXFLAGS in Autoconf are "-g -O2" for gcc and just
33  # "-g" for any other compiler. There doesn't seem to be a standard way of  # "-g" for any other compiler. There doesn't seem to be a standard way of
34  # getting rid of the -g (which I don't think is needed for a production  # getting rid of the -g (which I don't think is needed for a production
# Line 60  then Line 67  then
67    fi    fi
68  fi  fi
69    
70    # AC_PROG_CXX will return "g++" even if no c++ compiler is installed.
71    # Check for that case, and just disable c++ code if g++ doesn't run.
72    AC_LANG_PUSH(C++)
73    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],, CXX=""; CXXCP=""; CXXFLAGS="")
74    AC_LANG_POP
75    
76    # Check for a 64-bit integer type
77    AC_TYPE_INT64_T
78    
79  AC_PROG_INSTALL  AC_PROG_INSTALL
80  AC_LIBTOOL_WIN32_DLL  AC_LIBTOOL_WIN32_DLL
81  AC_PROG_LIBTOOL  LT_INIT
82  AC_PROG_LN_S  AC_PROG_LN_S
83    
84  PCRE_MAJOR="pcre_major"  PCRE_MAJOR="pcre_major"
# Line 71  PCRE_MINOR="pcre_minor" Line 86  PCRE_MINOR="pcre_minor"
86  PCRE_PRERELEASE="pcre_prerelease"  PCRE_PRERELEASE="pcre_prerelease"
87  PCRE_DATE="pcre_date"  PCRE_DATE="pcre_date"
88    
89    if test "$PCRE_MINOR" = "08" -o "$PCRE_MINOR" = "09"
90    then
91      echo "***"
92      echo "*** Minor version number $PCRE_MINOR must not be used. ***"
93      echo "*** Use only 01 to 07 or 10 onwards, to avoid octal issues. ***"
94      echo "***"
95      exit 1
96    fi
97    
98  AC_SUBST(PCRE_MAJOR)  AC_SUBST(PCRE_MAJOR)
99  AC_SUBST(PCRE_MINOR)  AC_SUBST(PCRE_MINOR)
100  AC_SUBST(PCRE_PRERELEASE)  AC_SUBST(PCRE_PRERELEASE)
# Line 82  then Line 106  then
106    htmldir='${docdir}/html'    htmldir='${docdir}/html'
107  fi  fi
108    
109  # Handle --disable-cpp  # Handle --disable-pcre8 (enabled by default)
110    AC_ARG_ENABLE(pcre8,
111                  AS_HELP_STRING([--disable-pcre8],
112                                 [disable 8 bit character support]),
113                  , enable_pcre8=unset)
114    AC_SUBST(enable_pcre8)
115    
116    # Handle --enable-pcre16 (disabled by default)
117    AC_ARG_ENABLE(pcre16,
118                  AS_HELP_STRING([--enable-pcre16],
119                                 [enable 16 bit character support]),
120                  , enable_pcre16=unset)
121    AC_SUBST(enable_pcre16)
122    
123    # Handle --disable-cpp. The substitution of enable_cpp is needed for use in
124    # pcre-config.
125  AC_ARG_ENABLE(cpp,  AC_ARG_ENABLE(cpp,
126                AS_HELP_STRING([--disable-cpp],                AS_HELP_STRING([--disable-cpp],
127                               [disable C++ support]),                               [disable C++ support]),
128                , enable_cpp=yes)                , enable_cpp=unset)
129    AC_SUBST(enable_cpp)
130    
131    # Handle --enable-jit (disabled by default)
132    AC_ARG_ENABLE(jit,
133                  AS_HELP_STRING([--enable-jit],
134                                 [enable Just-In-Time compiling support]),
135                  , enable_jit=no)
136    
137    # Handle --disable-pcregrep-jit (enabled by default)
138    AC_ARG_ENABLE(pcregrep-jit,
139                  AS_HELP_STRING([--disable-pcregrep-jit],
140                                 [disable JIT support in pcregrep]),
141                  , enable_pcregrep_jit=yes)
142    
143  # Handle --enable-rebuild-chartables  # Handle --enable-rebuild-chartables
144  AC_ARG_ENABLE(rebuild-chartables,  AC_ARG_ENABLE(rebuild-chartables,
# Line 97  AC_ARG_ENABLE(rebuild-chartables, Line 149  AC_ARG_ENABLE(rebuild-chartables,
149  # Handle --enable-utf8 (disabled by default)  # Handle --enable-utf8 (disabled by default)
150  AC_ARG_ENABLE(utf8,  AC_ARG_ENABLE(utf8,
151                AS_HELP_STRING([--enable-utf8],                AS_HELP_STRING([--enable-utf8],
152                               [enable UTF-8 support]),                               [another name for --enable-utf. Kept only for compatibility reasons]),
153                , enable_utf8=unset)                , enable_utf8=unset)
154    
155    # Handle --enable-utf (disabled by default)
156    AC_ARG_ENABLE(utf,
157                  AS_HELP_STRING([--enable-utf],
158                                 [enable UTF-8/16 support (incompatible with --enable-ebcdic)]),
159                  , enable_utf=unset)
160    
161  # Handle --enable-unicode-properties  # Handle --enable-unicode-properties
162  AC_ARG_ENABLE(unicode-properties,  AC_ARG_ENABLE(unicode-properties,
163                AS_HELP_STRING([--enable-unicode-properties],                AS_HELP_STRING([--enable-unicode-properties],
164                               [enable Unicode properties support (implies --enable-utf8)]),                               [enable Unicode properties support (implies --enable-utf)]),
165                , enable_unicode_properties=no)                , enable_unicode_properties=no)
166    
167  # Handle --enable-newline=NL  # Handle --enable-newline=NL
# Line 145  AC_ARG_ENABLE(bsr-anycrlf, Line 203  AC_ARG_ENABLE(bsr-anycrlf,
203  # Handle --enable-ebcdic  # Handle --enable-ebcdic
204  AC_ARG_ENABLE(ebcdic,  AC_ARG_ENABLE(ebcdic,
205                AS_HELP_STRING([--enable-ebcdic],                AS_HELP_STRING([--enable-ebcdic],
206                               [assume EBCDIC coding rather than ASCII; use this only in (uncommon) EBCDIC environments; it implies --enable-rebuild-chartables]),                               [assume EBCDIC coding rather than ASCII; incompatible with --enable-utf; use only in (uncommon) EBCDIC environments; it implies --enable-rebuild-chartables]),
207                , enable_ebcdic=no)                , enable_ebcdic=no)
208    
209  # Handle --disable-stack-for-recursion  # Handle --disable-stack-for-recursion
# Line 154  AC_ARG_ENABLE(stack-for-recursion, Line 212  AC_ARG_ENABLE(stack-for-recursion,
212                               [don't use stack recursion when matching]),                               [don't use stack recursion when matching]),
213                , enable_stack_for_recursion=yes)                , enable_stack_for_recursion=yes)
214    
215    # Handle --enable-pcregrep-libz
216    AC_ARG_ENABLE(pcregrep-libz,
217                  AS_HELP_STRING([--enable-pcregrep-libz],
218                                 [link pcregrep with libz to handle .gz files]),
219                  , enable_pcregrep_libz=no)
220    
221    # Handle --enable-pcregrep-libbz2
222    AC_ARG_ENABLE(pcregrep-libbz2,
223                  AS_HELP_STRING([--enable-pcregrep-libbz2],
224                                 [link pcregrep with libbz2 to handle .bz2 files]),
225                  , enable_pcregrep_libbz2=no)
226    
227    # Handle --with-pcregrep-bufsize=N
228    AC_ARG_WITH(pcregrep-bufsize,
229                  AS_HELP_STRING([--with-pcregrep-bufsize=N],
230                                 [pcregrep buffer size (default=20480)]),
231                  , with_pcregrep_bufsize=20480)
232    
233    # Handle --enable-pcretest-libreadline
234    AC_ARG_ENABLE(pcretest-libreadline,
235                  AS_HELP_STRING([--enable-pcretest-libreadline],
236                                 [link pcretest with libreadline]),
237                  , enable_pcretest_libreadline=no)
238    
239  # Handle --with-posix-malloc-threshold=NBYTES  # Handle --with-posix-malloc-threshold=NBYTES
240  AC_ARG_WITH(posix-malloc-threshold,  AC_ARG_WITH(posix-malloc-threshold,
241              AS_HELP_STRING([--with-posix-malloc-threshold=NBYTES],              AS_HELP_STRING([--with-posix-malloc-threshold=NBYTES],
# Line 185  AC_ARG_WITH(match-limit-recursion, Line 267  AC_ARG_WITH(match-limit-recursion,
267                             [default limit on internal recursion (default=MATCH_LIMIT)]),                             [default limit on internal recursion (default=MATCH_LIMIT)]),
268              , with_match_limit_recursion=MATCH_LIMIT)              , with_match_limit_recursion=MATCH_LIMIT)
269    
270  # Make sure that if enable_unicode_properties was set, that UTF-8 support  # Copy enable_utf8 value to enable_utf for compatibility reasons
271  # is enabled.  if test "x$enable_utf8" != "xunset"
272  #  then
273      if test "x$enable_utf" != "xunset"
274      then
275        AC_MSG_ERROR([--enable/disable-utf8 is kept only for compatibility reasons and its value is copied to --enable/disable-utf. Newer code must use --enable/disable-utf alone.])
276      fi
277      enable_utf=$enable_utf8
278    fi
279    
280    # Set the default value for pcre8
281    if test "x$enable_pcre8" = "xunset"
282    then
283      enable_pcre8=yes
284    fi
285    
286    # Set the default value for pcre16
287    if test "x$enable_pcre16" = "xunset"
288    then
289      enable_pcre16=no
290    fi
291    
292    # Make sure enable_pcre8 or enable_pcre16 was set
293    if test "x$enable_pcre8$enable_pcre16" = "xnono"
294    then
295      AC_MSG_ERROR([Either 8 or 16 bit (or both) pcre library must be enabled])
296    fi
297    
298    # Make sure that if enable_unicode_properties was set, that UTF support is enabled.
299  if test "x$enable_unicode_properties" = "xyes"  if test "x$enable_unicode_properties" = "xyes"
300  then  then
301    if test "x$enable_utf8" = "xno"    if test "x$enable_utf" = "xno"
302    then    then
303      AC_MSG_ERROR([support for Unicode properties requires UTF-8 support])      AC_MSG_ERROR([support for Unicode properties requires UTF-8/16 support])
304    fi    fi
305    enable_utf8=yes    enable_utf=yes
306    fi
307    
308    # enable_utf is disabled by default.
309    if test "x$enable_utf" = "xunset"
310    then
311      enable_utf=no
312  fi  fi
313    
314  if test "x$enable_utf8" = "xunset"  # enable_cpp copies the value of enable_pcre8 by default
315    if test "x$enable_cpp" = "xunset"
316  then  then
317    enable_utf8=no    enable_cpp=$enable_pcre8
318    fi
319    
320    # Make sure that if enable_cpp was set, that enable_pcre8 support is enabled
321    if test "x$enable_cpp" = "xyes"
322    then
323      if test "x$enable_pcre8" = "xno"
324      then
325        AC_MSG_ERROR([C++ library requires pcre library with 8 bit characters])
326      fi
327  fi  fi
328    
329  # Make sure that if enable_ebcdic is set, rebuild_chartables is also enabled.  # Make sure that if enable_ebcdic is set, rebuild_chartables is also enabled.
330    # Also check that UTF support is not requested, because PCRE cannot handle
331    # EBCDIC and UTF in the same build. To do so it would need to use different
332    # character constants depending on the mode.
333  #  #
334  if test "x$enable_ebcdic" = "xyes"  if test "x$enable_ebcdic" = "xyes"
335  then  then
336    enable_rebuild_chartables=yes    enable_rebuild_chartables=yes
337      if test "x$enable_utf" = "xyes"
338      then
339        AC_MSG_ERROR([support for EBCDIC and UTF-8/16 cannot be enabled at the same time])
340      fi
341  fi  fi
342    
343  # Convert the newline identifier into the appropriate integer value.  # Convert the newline identifier into the appropriate integer value.
# Line 259  if test "x$enable_cpp" = "xyes" -a -n "$ Line 390  if test "x$enable_cpp" = "xyes" -a -n "$
390  then  then
391  AC_LANG_PUSH(C++)  AC_LANG_PUSH(C++)
392    
393    # Older versions of pcre defined pcrecpp::no_arg, but in new versions
394    # it's called pcrecpp::RE::no_arg.  For backwards ABI compatibility,
395    # we want to make one an alias for the other.  Different systems do
396    # this in different ways.  Some systems, for instance, can do it via
397    # a linker flag: -alias (for os x 10.5) or -i (for os x <=10.4).
398    OLD_LDFLAGS="$LDFLAGS"
399    for flag in "-alias,__ZN7pcrecpp2RE6no_argE,__ZN7pcrecpp6no_argE" \
400                "-i__ZN7pcrecpp6no_argE:__ZN7pcrecpp2RE6no_argE"; do
401      AC_MSG_CHECKING([for alias support in the linker])
402      LDFLAGS="$OLD_LDFLAGS -Wl,$flag"
403      # We try to run the linker with this new ld flag.  If the link fails,
404      # we give up and remove the new flag from LDFLAGS.
405      AC_LINK_IFELSE([AC_LANG_PROGRAM([namespace pcrecpp {
406                                        class RE { static int no_arg; };
407                                        int RE::no_arg;
408                                      }],
409                                     [])],
410                     [AC_MSG_RESULT([yes]);
411                      EXTRA_LIBPCRECPP_LDFLAGS="$EXTRA_LIBPCRECPP_LDFLAGS -Wl,$flag";
412                      break;],
413                     AC_MSG_RESULT([no]))
414    done
415    LDFLAGS="$OLD_LDFLAGS"
416    
417  # 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
418  # (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
419  # 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.
# Line 268  AC_CHECK_HEADERS(bits/type_traits.h, [pc Line 423  AC_CHECK_HEADERS(bits/type_traits.h, [pc
423                                       [pcre_have_bits_type_traits="0"])                                       [pcre_have_bits_type_traits="0"])
424  AC_CHECK_HEADERS(type_traits.h, [pcre_have_type_traits="1"],  AC_CHECK_HEADERS(type_traits.h, [pcre_have_type_traits="1"],
425                                  [pcre_have_type_traits="0"])                                  [pcre_have_type_traits="0"])
426    
427    # (This isn't c++-specific, but is only used in pcrecpp.cc, so try this
428    # in a c++ context.  This matters becuase strtoimax is C99 and may not
429    # be supported by the C++ compiler.)
430    # Figure out how to create a longlong from a string: strtoll and
431    # equiv.  It's not enough to call AC_CHECK_FUNCS: hpux has a
432    # strtoll, for instance, but it only takes 2 args instead of 3!
433    # We have to call AH_TEMPLATE since AC_DEFINE_UNQUOTED below is complex.
434    AH_TEMPLATE(HAVE_STRTOQ, [Define to 1 if you have `strtoq'.])
435    AH_TEMPLATE(HAVE_STRTOLL, [Define to 1 if you have `strtoll'.])
436    AH_TEMPLATE(HAVE__STRTOI64, [Define to 1 if you have `_strtoi64'.])
437    AH_TEMPLATE(HAVE_STRTOIMAX, [Define to 1 if you have `strtoimax'.])
438    have_strto_fn=0
439    for fn in strtoq strtoll _strtoi64 strtoimax; do
440      AC_MSG_CHECKING([for $fn])
441      if test "$fn" = strtoimax; then
442        include=stdint.h
443      else
444        include=stdlib.h
445      fi
446      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <$include>],
447                                        [char* e; return $fn("100", &e, 10)])],
448                        [AC_MSG_RESULT(yes)
449                         AC_DEFINE_UNQUOTED(HAVE_`echo $fn | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`, 1,
450                                            [Define to 1 if you have `$fn'.])
451                         have_strto_fn=1
452                         break],
453                        [AC_MSG_RESULT(no)])
454    done
455    
456    if test "$have_strto_fn" = 1; then
457      AC_CHECK_TYPES([long long],
458                     [pcre_have_long_long="1"],
459                     [pcre_have_long_long="0"])
460      AC_CHECK_TYPES([unsigned long long],
461                     [pcre_have_ulong_long="1"],
462                     [pcre_have_ulong_long="0"])
463    else
464      pcre_have_long_long="0"
465      pcre_have_ulong_long="0"
466    fi
467    AC_SUBST(pcre_have_long_long)
468    AC_SUBST(pcre_have_ulong_long)
469    
470  AC_LANG_POP  AC_LANG_POP
471  fi  fi
472  # Using AC_SUBST eliminates the need to include config.h in a public .h file  # Using AC_SUBST eliminates the need to include config.h in a public .h file
# Line 275  AC_SUBST(pcre_have_type_traits) Line 474  AC_SUBST(pcre_have_type_traits)
474  AC_SUBST(pcre_have_bits_type_traits)  AC_SUBST(pcre_have_bits_type_traits)
475    
476  # Conditional compilation  # Conditional compilation
477    AM_CONDITIONAL(WITH_PCRE8, test "x$enable_pcre8" = "xyes")
478    AM_CONDITIONAL(WITH_PCRE16, test "x$enable_pcre16" = "xyes")
479  AM_CONDITIONAL(WITH_PCRE_CPP, test "x$enable_cpp" = "xyes")  AM_CONDITIONAL(WITH_PCRE_CPP, test "x$enable_cpp" = "xyes")
480  AM_CONDITIONAL(WITH_REBUILD_CHARTABLES, test "x$enable_rebuild_chartables" = "xyes")  AM_CONDITIONAL(WITH_REBUILD_CHARTABLES, test "x$enable_rebuild_chartables" = "xyes")
481    AM_CONDITIONAL(WITH_JIT, test "x$enable_jit" = "xyes")
482    AM_CONDITIONAL(WITH_UTF, test "x$enable_utf" = "xyes")
483    
484  # Checks for typedefs, structures, and compiler characteristics.  # Checks for typedefs, structures, and compiler characteristics.
485    
486  AC_C_CONST  AC_C_CONST
487  AC_TYPE_SIZE_T  AC_TYPE_SIZE_T
488    
 AC_CHECK_TYPES([long long],  
                [pcre_have_long_long="1"],  
                [pcre_have_long_long="0"])  
 AC_CHECK_TYPES([unsigned long long],  
                [pcre_have_ulong_long="1"],  
                [pcre_have_ulong_long="0"])  
 AC_SUBST(pcre_have_long_long)  
 AC_SUBST(pcre_have_ulong_long)  
   
489  # Checks for library functions.  # Checks for library functions.
490    
491  AC_CHECK_FUNCS(bcopy memmove strerror strtoq strtoll)  AC_CHECK_FUNCS(bcopy memmove strerror)
492    
493    # Check for the availability of libz (aka zlib)
494    
495    AC_CHECK_HEADERS([zlib.h], [HAVE_ZLIB_H=1])
496    AC_CHECK_LIB([z], [gzopen], [HAVE_LIBZ=1])
497    
498    # Check for the availability of libbz2. Originally we just used AC_CHECK_LIB,
499    # as for libz. However, this had the following problem, diagnosed and fixed by
500    # a user:
501    #
502    #   - libbz2 uses the Pascal calling convention (WINAPI) for the functions
503    #     under Win32.
504    #   - The standard autoconf AC_CHECK_LIB fails to include "bzlib.h",
505    #     therefore missing the function definition.
506    #   - The compiler thus generates a "C" signature for the test function.
507    #   - The linker fails to find the "C" function.
508    #   - PCRE fails to configure if asked to do so against libbz2.
509    #
510    # Solution:
511    #
512    #   - Replace the AC_CHECK_LIB test with a custom test.
513    
514    AC_CHECK_HEADERS([bzlib.h], [HAVE_BZLIB_H=1])
515    # Original test
516    # AC_CHECK_LIB([bz2], [BZ2_bzopen], [HAVE_LIBBZ2=1])
517    #
518    # Custom test follows
519    
520    AC_MSG_CHECKING([for libbz2])
521    OLD_LIBS="$LIBS"
522    LIBS="$LIBS -lbz2"
523    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
524    #ifdef HAVE_BZLIB_H
525    #include <bzlib.h>
526    #endif]],
527    [[return (int)BZ2_bzopen("conftest", "rb");]])],
528    [AC_MSG_RESULT([yes]);HAVE_LIBBZ2=1; break;],
529    AC_MSG_RESULT([no]))
530    LIBS="$OLD_LIBS"
531    
532    # Check for the availabiity of libreadline
533    
534    AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_H=1])
535    AC_CHECK_HEADERS([readline/history.h], [HAVE_HISTORY_H=1])
536    AC_CHECK_LIB([readline], [readline], [HAVE_LIB_READLINE=1])
537    
538  # This facilitates -ansi builds under Linux  # This facilitates -ansi builds under Linux
539  dnl AC_DEFINE([_GNU_SOURCE], [], [Enable GNU extensions in glibc])  dnl AC_DEFINE([_GNU_SOURCE], [], [Enable GNU extensions in glibc])
540    
541    PCRE_STATIC_CFLAG=""
542  if test "x$enable_shared" = "xno" ; then  if test "x$enable_shared" = "xno" ; then
543    AC_DEFINE([PCRE_STATIC], [1], [    AC_DEFINE([PCRE_STATIC], [1], [
544      Define if linking statically (TODO: make nice with Libtool)])      Define if linking statically (TODO: make nice with Libtool)])
545      PCRE_STATIC_CFLAG="-DPCRE_STATIC"
546  fi  fi
547    AC_SUBST(PCRE_STATIC_CFLAG)
548    
549  # Here is where pcre specific defines are handled  # Here is where pcre specific defines are handled
550    
551  if test "$enable_utf8" = "yes"; then  if test "$enable_pcre8" = "yes"; then
552    AC_DEFINE([SUPPORT_UTF8], [], [    AC_DEFINE([SUPPORT_PCRE8], [], [
553      Define to enable support for the UTF-8 Unicode encoding.])      Define to enable the 8 bit PCRE library.])
554    fi
555    
556    if test "$enable_pcre16" = "yes"; then
557      AC_DEFINE([SUPPORT_PCRE16], [], [
558        Define to enable the 16 bit PCRE library.])
559    fi
560    
561    if test "$enable_jit" = "yes"; then
562      AC_DEFINE([SUPPORT_JIT], [], [
563        Define to enable support for Just-In-Time compiling.])
564    else
565      enable_pcregrep_jit="no"
566    fi
567    
568    if test "$enable_pcregrep_jit" = "yes"; then
569      AC_DEFINE([SUPPORT_PCREGREP_JIT], [], [
570        Define to enable JIT support in pcregrep.])
571    fi
572    
573    if test "$enable_utf" = "yes"; then
574      AC_DEFINE([SUPPORT_UTF], [], [
575        Define to enable support for the UTF-8/16 Unicode encoding. This
576        will work even in an EBCDIC environment, but it is incompatible
577        with the EBCDIC macro. That is, PCRE can support *either* EBCDIC
578        code *or* ASCII/UTF-8/16, but not both at once.])
579  fi  fi
580    
581  if test "$enable_unicode_properties" = "yes"; then  if test "$enable_unicode_properties" = "yes"; then
582    AC_DEFINE([SUPPORT_UCP], [], [    AC_DEFINE([SUPPORT_UCP], [], [
583      Define to enable support for Unicode properties])      Define to enable support for Unicode properties.])
584  fi  fi
585    
586  if test "$enable_stack_for_recursion" = "no"; then  if test "$enable_stack_for_recursion" = "no"; then
# Line 329  if test "$enable_stack_for_recursion" = Line 596  if test "$enable_stack_for_recursion" =
596      (use --disable-stack-for-recursion).])      (use --disable-stack-for-recursion).])
597  fi  fi
598    
599    if test "$enable_pcregrep_libz" = "yes"; then
600      AC_DEFINE([SUPPORT_LIBZ], [], [
601        Define to allow pcregrep to be linked with libz, so that it is
602        able to handle .gz files.])
603    fi
604    
605    if test "$enable_pcregrep_libbz2" = "yes"; then
606      AC_DEFINE([SUPPORT_LIBBZ2], [], [
607        Define to allow pcregrep to be linked with libbz2, so that it is
608        able to handle .bz2 files.])
609    fi
610    
611    if test $with_pcregrep_bufsize -lt 8192 ; then
612      with_pcregrep_bufsize="8192"
613    fi
614    
615    AC_DEFINE_UNQUOTED([PCREGREP_BUFSIZE], [$with_pcregrep_bufsize], [
616      The value of PCREGREP_BUFSIZE determines the size of buffer used by
617      pcregrep to hold parts of the file it is searching. On systems that
618      support it, "configure" can be used to override the default, which is
619      8192. This is also the minimum value. The actual amount of memory used by
620      pcregrep is three times this number, because it allows for the buffering of
621      "before" and "after" lines.])
622    
623    if test "$enable_pcretest_libreadline" = "yes"; then
624      AC_DEFINE([SUPPORT_LIBREADLINE], [], [
625        Define to allow pcretest to be linked with libreadline.])
626    fi
627    
628  AC_DEFINE_UNQUOTED([NEWLINE], [$ac_pcre_newline_value], [  AC_DEFINE_UNQUOTED([NEWLINE], [$ac_pcre_newline_value], [
629    The value of NEWLINE determines the newline character sequence. On    The value of NEWLINE determines the newline character sequence. On
630    systems that support it, "configure" can be used to override the    systems that support it, "configure" can be used to override the
# Line 412  if test "$enable_ebcdic" = "yes"; then Line 708  if test "$enable_ebcdic" = "yes"; then
708    AC_DEFINE_UNQUOTED([EBCDIC], [], [    AC_DEFINE_UNQUOTED([EBCDIC], [], [
709      If you are compiling for a system that uses EBCDIC instead of ASCII      If you are compiling for a system that uses EBCDIC instead of ASCII
710      character codes, define this macro as 1. On systems that can use      character codes, define this macro as 1. On systems that can use
711      "configure", this can be done via --enable-ebcdic.])      "configure", this can be done via --enable-ebcdic. PCRE will then
712        assume that all input strings are in EBCDIC. If you do not define
713        this macro, PCRE will assume input strings are ASCII or UTF-8/16
714        Unicode. It is not possible to build a version of PCRE that
715        supports both EBCDIC and UTF-8/16.])
716  fi  fi
717    
718  # Platform specific issues  # Platform specific issues
# Line 430  esac Line 730  esac
730  # The extra LDFLAGS for each particular library  # The extra LDFLAGS for each particular library
731  # (Note: The libpcre*_version bits are m4 variables, assigned above)  # (Note: The libpcre*_version bits are m4 variables, assigned above)
732    
733  EXTRA_LIBPCRE_LDFLAGS="$NO_UNDEFINED -version-info libpcre_version"  EXTRA_LIBPCRE_LDFLAGS="$EXTRA_LIBPCRE_LDFLAGS \
734                           $NO_UNDEFINED -version-info libpcre_version"
735    
736    EXTRA_LIBPCRE16_LDFLAGS="$EXTRA_LIBPCRE16_LDFLAGS \
737                           $NO_UNDEFINED -version-info libpcre16_version"
738    
739  EXTRA_LIBPCREPOSIX_LDFLAGS="$NO_UNDEFINED -version-info libpcreposix_version"  EXTRA_LIBPCREPOSIX_LDFLAGS="$EXTRA_LIBPCREPOSIX_LDFLAGS \
740                                $NO_UNDEFINED -version-info libpcreposix_version"
741    
742  EXTRA_LIBPCRECPP_LDFLAGS="$NO_UNDEFINED $EXPORT_ALL_SYMBOLS -version-info libpcrecpp_version"  EXTRA_LIBPCRECPP_LDFLAGS="$EXTRA_LIBPCRECPP_LDFLAGS \
743                              $NO_UNDEFINED -version-info libpcrecpp_version \
744                              $EXPORT_ALL_SYMBOLS"
745    
746  AC_SUBST(EXTRA_LIBPCRE_LDFLAGS)  AC_SUBST(EXTRA_LIBPCRE_LDFLAGS)
747    AC_SUBST(EXTRA_LIBPCRE16_LDFLAGS)
748  AC_SUBST(EXTRA_LIBPCREPOSIX_LDFLAGS)  AC_SUBST(EXTRA_LIBPCREPOSIX_LDFLAGS)
749  AC_SUBST(EXTRA_LIBPCRECPP_LDFLAGS)  AC_SUBST(EXTRA_LIBPCRECPP_LDFLAGS)
750    
751  # When we run 'make distcheck', use these arguments.  # When we run 'make distcheck', use these arguments.
752  DISTCHECK_CONFIGURE_FLAGS="--enable-cpp --enable-unicode-properties"  DISTCHECK_CONFIGURE_FLAGS="--enable-pcre16 --enable-jit --enable-cpp --enable-unicode-properties"
753  AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)  AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
754    
755    # Check that, if --enable-pcregrep-libz or --enable-pcregrep-libbz2 is
756    # specified, the relevant library is available.
757    
758    if test "$enable_pcregrep_libz" = "yes"; then
759      if test "$HAVE_ZLIB_H" != "1"; then
760        echo "** Cannot --enable-pcregrep-libz because zlib.h was not found"
761        exit 1
762      fi
763      if test "$HAVE_LIBZ" != "1"; then
764        echo "** Cannot --enable-pcregrep-libz because libz was not found"
765        exit 1
766      fi
767      LIBZ="-lz"
768    fi
769    AC_SUBST(LIBZ)
770    
771    if test "$enable_pcregrep_libbz2" = "yes"; then
772      if test "$HAVE_BZLIB_H" != "1"; then
773        echo "** Cannot --enable-pcregrep-libbz2 because bzlib.h was not found"
774        exit 1
775      fi
776      if test "$HAVE_LIBBZ2" != "1"; then
777        echo "** Cannot --enable-pcregrep-libbz2 because libbz2 was not found"
778        exit 1
779      fi
780      LIBBZ2="-lbz2"
781    fi
782    AC_SUBST(LIBBZ2)
783    
784    # Similarly for --enable-pcretest-readline
785    
786    if test "$enable_pcretest_libreadline" = "yes"; then
787      if test "$HAVE_READLINE_H" != "1"; then
788        echo "** Cannot --enable-pcretest-readline because readline/readline.h was not found."
789        exit 1
790      fi
791      if test "$HAVE_HISTORY_H" != "1"; then
792        echo "** Cannot --enable-pcretest-readline because readline/history.h was not found."
793        exit 1
794      fi
795      LIBREADLINE="-lreadline"
796    fi
797    AC_SUBST(LIBREADLINE)
798    
799  # Produce these files, in addition to config.h.  # Produce these files, in addition to config.h.
800  AC_CONFIG_FILES(  AC_CONFIG_FILES(
801          Makefile          Makefile
802          libpcre.pc          libpcre.pc
803            libpcre16.pc
804            libpcreposix.pc
805          libpcrecpp.pc          libpcrecpp.pc
806          pcre-config          pcre-config
807          pcre.h          pcre.h
# Line 466  AC_OUTPUT Line 820  AC_OUTPUT
820    
821  # Print out a nice little message after configure is run displaying your  # Print out a nice little message after configure is run displaying your
822  # chosen options.  # chosen options.
823  #  
824  cat <<EOF  cat <<EOF
825    
826  $PACKAGE-$VERSION configuration summary:  $PACKAGE-$VERSION configuration summary:
827    
828      Install prefix ........... : ${prefix}      Install prefix .................. : ${prefix}
829      C preprocessor ........... : ${CPP}      C preprocessor .................. : ${CPP}
830      C compiler ............... : ${CC}      C compiler ...................... : ${CC}
831      C++ preprocessor ......... : ${CXXCPP}      C++ preprocessor ................ : ${CXXCPP}
832      C++ compiler ............. : ${CXX}      C++ compiler .................... : ${CXX}
833      Linker ................... : ${LD}      Linker .......................... : ${LD}
834      C preprocessor flags ..... : ${CPPFLAGS}      C preprocessor flags ............ : ${CPPFLAGS}
835      C compiler flags ......... : ${CFLAGS}      C compiler flags ................ : ${CFLAGS}
836      C++ compiler flags ....... : ${CXXFLAGS}      C++ compiler flags .............. : ${CXXFLAGS}
837      Linker flags ............. : ${LDFLAGS}      Linker flags .................... : ${LDFLAGS}
838      Extra libraries .......... : ${LIBS}      Extra libraries ................. : ${LIBS}
839    
840      Build C++ library ........ : ${enable_cpp}      Build 8 bit pcre library ........ : ${enable_pcre8}
841      Enable UTF-8 support ..... : ${enable_utf8}      Build 16 bit pcre library ....... : ${enable_pcre16}
842      Unicode properties ....... : ${enable_unicode_properties}      Build C++ library ............... : ${enable_cpp}
843      Newline char/sequence .... : ${enable_newline}      Enable JIT compiling support .... : ${enable_jit}
844      \R matches only ANYCRLF .. : ${enable_bsr_anycrlf}      Enable UTF-8/16 support ......... : ${enable_utf}
845      EBCDIC coding ............ : ${enable_ebcdic}      Unicode properties .............. : ${enable_unicode_properties}
846      Rebuild char tables ...... : ${enable_rebuild_chartables}      Newline char/sequence ........... : ${enable_newline}
847      Use stack recursion ...... : ${enable_stack_for_recursion}      \R matches only ANYCRLF ......... : ${enable_bsr_anycrlf}
848      POSIX mem threshold ...... : ${with_posix_malloc_threshold}      EBCDIC coding ................... : ${enable_ebcdic}
849      Internal link size ....... : ${with_link_size}      Rebuild char tables ............. : ${enable_rebuild_chartables}
850      Match limit .............. : ${with_match_limit}      Use stack recursion ............. : ${enable_stack_for_recursion}
851      Match limit recursion .... : ${with_match_limit_recursion}      POSIX mem threshold ............. : ${with_posix_malloc_threshold}
852      Build shared libs ........ : ${enable_shared}      Internal link size .............. : ${with_link_size}
853      Build static libs ........ : ${enable_static}      Match limit ..................... : ${with_match_limit}
854        Match limit recursion ........... : ${with_match_limit_recursion}
855        Build shared libs ............... : ${enable_shared}
856        Build static libs ............... : ${enable_static}
857        Use JIT in pcregrep ............. : ${enable_pcregrep_jit}
858        Buffer size for pcregrep ........ : ${with_pcregrep_bufsize}
859        Link pcregrep with libz ......... : ${enable_pcregrep_libz}
860        Link pcregrep with libbz2 ....... : ${enable_pcregrep_libbz2}
861        Link pcretest with libreadline .. : ${enable_pcretest_libreadline}
862    
863  EOF  EOF
864    

Legend:
Removed from v.247  
changed lines
  Added in v.885

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12