/[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 835 by ph10, Wed Dec 28 16:10:09 2011 UTC revision 896 by ph10, Fri Jan 20 12:22:48 2012 UTC
# Line 9  dnl The PCRE_PRERELEASE feature is for i Line 9  dnl The PCRE_PRERELEASE feature is for i
9  dnl be defined as -RC2, for example. For real releases, it should be empty.  dnl be defined as -RC2, for example. For real releases, it should be empty.
10    
11  m4_define(pcre_major, [8])  m4_define(pcre_major, [8])
12  m4_define(pcre_minor, [21])  m4_define(pcre_minor, [30])
13  m4_define(pcre_prerelease, [-RC1])  m4_define(pcre_prerelease, [-RC1])
14  m4_define(pcre_date, [2011-11-14])  m4_define(pcre_date, [2012-01-20])
15    
16    # NOTE: The CMakeLists.txt file searches for the above variables in the first
17    # 50 lines of this file. Please update that if the variables above are moved.
18    
19  # Libtool shared library interface versions (current:revision:age)  # Libtool shared library interface versions (current:revision:age)
20  m4_define(libpcre_version, [0:1:0])  m4_define(libpcre_version, [1:0:0])
21    m4_define(libpcre16_version, [0:0:0])
22  m4_define(libpcreposix_version, [0:0:0])  m4_define(libpcreposix_version, [0:0:0])
23  m4_define(libpcrecpp_version, [0:0:0])  m4_define(libpcrecpp_version, [0:0:0])
24    
# Line 22  AC_PREREQ(2.57) Line 26  AC_PREREQ(2.57)
26  AC_INIT(PCRE, pcre_major.pcre_minor[]pcre_prerelease, , pcre)  AC_INIT(PCRE, pcre_major.pcre_minor[]pcre_prerelease, , pcre)
27  AC_CONFIG_SRCDIR([pcre.h.in])  AC_CONFIG_SRCDIR([pcre.h.in])
28  AM_INIT_AUTOMAKE([dist-bzip2 dist-zip])  AM_INIT_AUTOMAKE([dist-bzip2 dist-zip])
29    m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
30  AC_CONFIG_HEADERS(config.h)  AC_CONFIG_HEADERS(config.h)
31    
32  # This was added at the suggestion of libtoolize (03-Jan-10)  # This was added at the suggestion of libtoolize (03-Jan-10)
# Line 104  then Line 109  then
109    htmldir='${docdir}/html'    htmldir='${docdir}/html'
110  fi  fi
111    
112    # Handle --disable-pcre8 (enabled by default)
113    AC_ARG_ENABLE(pcre8,
114                  AS_HELP_STRING([--disable-pcre8],
115                                 [disable 8 bit character support]),
116                  , enable_pcre8=unset)
117    AC_SUBST(enable_pcre8)
118    
119    # Handle --enable-pcre16 (disabled by default)
120    AC_ARG_ENABLE(pcre16,
121                  AS_HELP_STRING([--enable-pcre16],
122                                 [enable 16 bit character support]),
123                  , enable_pcre16=unset)
124    AC_SUBST(enable_pcre16)
125    
126  # Handle --disable-cpp. The substitution of enable_cpp is needed for use in  # Handle --disable-cpp. The substitution of enable_cpp is needed for use in
127  # pcre-config.  # pcre-config.
128  AC_ARG_ENABLE(cpp,  AC_ARG_ENABLE(cpp,
129                AS_HELP_STRING([--disable-cpp],                AS_HELP_STRING([--disable-cpp],
130                               [disable C++ support]),                               [disable C++ support]),
131                , enable_cpp=yes)                , enable_cpp=unset)
132  AC_SUBST(enable_cpp)  AC_SUBST(enable_cpp)
133    
134  # Handle --enable-jit (disabled by default)  # Handle --enable-jit (disabled by default)
# Line 133  AC_ARG_ENABLE(rebuild-chartables, Line 152  AC_ARG_ENABLE(rebuild-chartables,
152  # Handle --enable-utf8 (disabled by default)  # Handle --enable-utf8 (disabled by default)
153  AC_ARG_ENABLE(utf8,  AC_ARG_ENABLE(utf8,
154                AS_HELP_STRING([--enable-utf8],                AS_HELP_STRING([--enable-utf8],
155                               [enable UTF-8 support (incompatible with --enable-ebcdic)]),                               [another name for --enable-utf. Kept only for compatibility reasons]),
156                , enable_utf8=unset)                , enable_utf8=unset)
157    
158    # Handle --enable-utf (disabled by default)
159    AC_ARG_ENABLE(utf,
160                  AS_HELP_STRING([--enable-utf],
161                                 [enable UTF-8/16 support (incompatible with --enable-ebcdic)]),
162                  , enable_utf=unset)
163    
164  # Handle --enable-unicode-properties  # Handle --enable-unicode-properties
165  AC_ARG_ENABLE(unicode-properties,  AC_ARG_ENABLE(unicode-properties,
166                AS_HELP_STRING([--enable-unicode-properties],                AS_HELP_STRING([--enable-unicode-properties],
167                               [enable Unicode properties support (implies --enable-utf8)]),                               [enable Unicode properties support (implies --enable-utf)]),
168                , enable_unicode_properties=no)                , enable_unicode_properties=no)
169    
170  # Handle --enable-newline=NL  # Handle --enable-newline=NL
# Line 181  AC_ARG_ENABLE(bsr-anycrlf, Line 206  AC_ARG_ENABLE(bsr-anycrlf,
206  # Handle --enable-ebcdic  # Handle --enable-ebcdic
207  AC_ARG_ENABLE(ebcdic,  AC_ARG_ENABLE(ebcdic,
208                AS_HELP_STRING([--enable-ebcdic],                AS_HELP_STRING([--enable-ebcdic],
209                               [assume EBCDIC coding rather than ASCII; incompatible with --enable-utf8; use 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]),
210                , enable_ebcdic=no)                , enable_ebcdic=no)
211    
212  # Handle --disable-stack-for-recursion  # Handle --disable-stack-for-recursion
# Line 245  AC_ARG_WITH(match-limit-recursion, Line 270  AC_ARG_WITH(match-limit-recursion,
270                             [default limit on internal recursion (default=MATCH_LIMIT)]),                             [default limit on internal recursion (default=MATCH_LIMIT)]),
271              , with_match_limit_recursion=MATCH_LIMIT)              , with_match_limit_recursion=MATCH_LIMIT)
272    
273  # Make sure that if enable_unicode_properties was set, that UTF-8 support  # Copy enable_utf8 value to enable_utf for compatibility reasons
274  # is enabled.  if test "x$enable_utf8" != "xunset"
275  #  then
276      if test "x$enable_utf" != "xunset"
277      then
278        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.])
279      fi
280      enable_utf=$enable_utf8
281    fi
282    
283    # Set the default value for pcre8
284    if test "x$enable_pcre8" = "xunset"
285    then
286      enable_pcre8=yes
287    fi
288    
289    # Set the default value for pcre16
290    if test "x$enable_pcre16" = "xunset"
291    then
292      enable_pcre16=no
293    fi
294    
295    # Make sure enable_pcre8 or enable_pcre16 was set
296    if test "x$enable_pcre8$enable_pcre16" = "xnono"
297    then
298      AC_MSG_ERROR([Either 8 or 16 bit (or both) pcre library must be enabled])
299    fi
300    
301    # Make sure that if enable_unicode_properties was set, that UTF support is enabled.
302  if test "x$enable_unicode_properties" = "xyes"  if test "x$enable_unicode_properties" = "xyes"
303  then  then
304    if test "x$enable_utf8" = "xno"    if test "x$enable_utf" = "xno"
305    then    then
306      AC_MSG_ERROR([support for Unicode properties requires UTF-8 support])      AC_MSG_ERROR([support for Unicode properties requires UTF-8/16 support])
307    fi    fi
308    enable_utf8=yes    enable_utf=yes
309  fi  fi
310    
311  if test "x$enable_utf8" = "xunset"  # enable_utf is disabled by default.
312    if test "x$enable_utf" = "xunset"
313  then  then
314    enable_utf8=no    enable_utf=no
315    fi
316    
317    # enable_cpp copies the value of enable_pcre8 by default
318    if test "x$enable_cpp" = "xunset"
319    then
320      enable_cpp=$enable_pcre8
321    fi
322    
323    # Make sure that if enable_cpp was set, that enable_pcre8 support is enabled
324    if test "x$enable_cpp" = "xyes"
325    then
326      if test "x$enable_pcre8" = "xno"
327      then
328        AC_MSG_ERROR([C++ library requires pcre library with 8 bit characters])
329      fi
330  fi  fi
331    
332  # 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.
333  # Also check that UTF-8 support is not requested, because PCRE cannot handle  # Also check that UTF support is not requested, because PCRE cannot handle
334  # EBCDIC and UTF-8 in the same build. To do so it would need to use different  # EBCDIC and UTF in the same build. To do so it would need to use different
335  # character constants depending on the mode.  # character constants depending on the mode.
336  #  #
337  if test "x$enable_ebcdic" = "xyes"  if test "x$enable_ebcdic" = "xyes"
338  then  then
339    enable_rebuild_chartables=yes    enable_rebuild_chartables=yes
340    if test "x$enable_utf8" = "xyes"    if test "x$enable_utf" = "xyes"
341    then    then
342      AC_MSG_ERROR([support for EBCDIC and UTF-8 cannot be enabled at the same time])      AC_MSG_ERROR([support for EBCDIC and UTF-8/16 cannot be enabled at the same time])
343    fi    fi
344  fi  fi
345    
# Line 410  AC_SUBST(pcre_have_type_traits) Line 477  AC_SUBST(pcre_have_type_traits)
477  AC_SUBST(pcre_have_bits_type_traits)  AC_SUBST(pcre_have_bits_type_traits)
478    
479  # Conditional compilation  # Conditional compilation
480    AM_CONDITIONAL(WITH_PCRE8, test "x$enable_pcre8" = "xyes")
481    AM_CONDITIONAL(WITH_PCRE16, test "x$enable_pcre16" = "xyes")
482  AM_CONDITIONAL(WITH_PCRE_CPP, test "x$enable_cpp" = "xyes")  AM_CONDITIONAL(WITH_PCRE_CPP, test "x$enable_cpp" = "xyes")
483  AM_CONDITIONAL(WITH_REBUILD_CHARTABLES, test "x$enable_rebuild_chartables" = "xyes")  AM_CONDITIONAL(WITH_REBUILD_CHARTABLES, test "x$enable_rebuild_chartables" = "xyes")
484  AM_CONDITIONAL(WITH_JIT, test "x$enable_jit" = "xyes")  AM_CONDITIONAL(WITH_JIT, test "x$enable_jit" = "xyes")
485  AM_CONDITIONAL(WITH_UTF8, test "x$enable_utf8" = "xyes")  AM_CONDITIONAL(WITH_UTF, test "x$enable_utf" = "xyes")
486    
487  # Checks for typedefs, structures, and compiler characteristics.  # Checks for typedefs, structures, and compiler characteristics.
488    
# Line 467  LIBS="$OLD_LIBS" Line 536  LIBS="$OLD_LIBS"
536    
537  AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_H=1])  AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_H=1])
538  AC_CHECK_HEADERS([readline/history.h], [HAVE_HISTORY_H=1])  AC_CHECK_HEADERS([readline/history.h], [HAVE_HISTORY_H=1])
539  AC_CHECK_LIB([readline], [readline], [HAVE_LIB_READLINE=1])  AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lreadline"],
540      [unset ac_cv_lib_readline_readline;
541       AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-ltinfo"],
542        [unset ac_cv_lib_readline_readline;
543         AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lcurses"],
544          [unset ac_cv_lib_readline_readline;
545           AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lncurses"],
546            [unset ac_cv_lib_readline_readline;
547             AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lncursesw"],
548              [unset ac_cv_lib_readline_readline;
549               AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-ltermcap"],
550                [LIBREADLINE=""],
551                [-ltermcap])],
552              [-lncursesw])],
553            [-lncurses])],
554          [-lcurses])],
555        [-ltinfo])])
556    AC_SUBST(LIBREADLINE)
557    if test -n "$LIBREADLINE"; then
558      if test "$LIBREADLINE" != "-lreadline"; then
559        echo "-lreadline needs $LIBREADLINE"
560        LIBREADLINE="-lreadline $LIBREADLINE"
561      fi
562    fi
563    
564  # This facilitates -ansi builds under Linux  # This facilitates -ansi builds under Linux
565  dnl AC_DEFINE([_GNU_SOURCE], [], [Enable GNU extensions in glibc])  dnl AC_DEFINE([_GNU_SOURCE], [], [Enable GNU extensions in glibc])
# Line 482  AC_SUBST(PCRE_STATIC_CFLAG) Line 574  AC_SUBST(PCRE_STATIC_CFLAG)
574    
575  # Here is where pcre specific defines are handled  # Here is where pcre specific defines are handled
576    
577    if test "$enable_pcre8" = "yes"; then
578      AC_DEFINE([SUPPORT_PCRE8], [], [
579        Define to enable the 8 bit PCRE library.])
580    fi
581    
582    if test "$enable_pcre16" = "yes"; then
583      AC_DEFINE([SUPPORT_PCRE16], [], [
584        Define to enable the 16 bit PCRE library.])
585    fi
586    
587  if test "$enable_jit" = "yes"; then  if test "$enable_jit" = "yes"; then
588    AC_DEFINE([SUPPORT_JIT], [], [    AC_DEFINE([SUPPORT_JIT], [], [
589      Define to enable support for Just-In-Time compiling.])      Define to enable support for Just-In-Time compiling.])
# Line 494  if test "$enable_pcregrep_jit" = "yes"; Line 596  if test "$enable_pcregrep_jit" = "yes";
596      Define to enable JIT support in pcregrep.])      Define to enable JIT support in pcregrep.])
597  fi  fi
598    
599  if test "$enable_utf8" = "yes"; then  if test "$enable_utf" = "yes"; then
600    AC_DEFINE([SUPPORT_UTF8], [], [    AC_DEFINE([SUPPORT_UTF], [], [
601      Define to enable support for the UTF-8 Unicode encoding. This will      Define to enable support for the UTF-8/16 Unicode encoding. This
602      work even in an EBCDIC environment, but it is incompatible with      will work even in an EBCDIC environment, but it is incompatible
603      the EBCDIC macro. That is, PCRE can support *either* EBCDIC code      with the EBCDIC macro. That is, PCRE can support *either* EBCDIC
604      *or* ASCII/UTF-8, but not both at once.])      code *or* ASCII/UTF-8/16, but not both at once.])
605  fi  fi
606    
607  if test "$enable_unicode_properties" = "yes"; then  if test "$enable_unicode_properties" = "yes"; then
# Line 634  if test "$enable_ebcdic" = "yes"; then Line 736  if test "$enable_ebcdic" = "yes"; then
736      character codes, define this macro as 1. On systems that can use      character codes, define this macro as 1. On systems that can use
737      "configure", this can be done via --enable-ebcdic. PCRE will then      "configure", this can be done via --enable-ebcdic. PCRE will then
738      assume that all input strings are in EBCDIC. If you do not define      assume that all input strings are in EBCDIC. If you do not define
739      this macro, PCRE will assume input strings are ASCII or UTF-8 Unicode.      this macro, PCRE will assume input strings are ASCII or UTF-8/16
740      It is not possible to build a version of PCRE that supports both      Unicode. It is not possible to build a version of PCRE that
741      EBCDIC and UTF-8.])      supports both EBCDIC and UTF-8/16.])
742  fi  fi
743    
744  # Platform specific issues  # Platform specific issues
# Line 657  esac Line 759  esac
759  EXTRA_LIBPCRE_LDFLAGS="$EXTRA_LIBPCRE_LDFLAGS \  EXTRA_LIBPCRE_LDFLAGS="$EXTRA_LIBPCRE_LDFLAGS \
760                         $NO_UNDEFINED -version-info libpcre_version"                         $NO_UNDEFINED -version-info libpcre_version"
761    
762    EXTRA_LIBPCRE16_LDFLAGS="$EXTRA_LIBPCRE16_LDFLAGS \
763                           $NO_UNDEFINED -version-info libpcre16_version"
764    
765  EXTRA_LIBPCREPOSIX_LDFLAGS="$EXTRA_LIBPCREPOSIX_LDFLAGS \  EXTRA_LIBPCREPOSIX_LDFLAGS="$EXTRA_LIBPCREPOSIX_LDFLAGS \
766                              $NO_UNDEFINED -version-info libpcreposix_version"                              $NO_UNDEFINED -version-info libpcreposix_version"
767    
# Line 665  EXTRA_LIBPCRECPP_LDFLAGS="$EXTRA_LIBPCRE Line 770  EXTRA_LIBPCRECPP_LDFLAGS="$EXTRA_LIBPCRE
770                            $EXPORT_ALL_SYMBOLS"                            $EXPORT_ALL_SYMBOLS"
771    
772  AC_SUBST(EXTRA_LIBPCRE_LDFLAGS)  AC_SUBST(EXTRA_LIBPCRE_LDFLAGS)
773    AC_SUBST(EXTRA_LIBPCRE16_LDFLAGS)
774  AC_SUBST(EXTRA_LIBPCREPOSIX_LDFLAGS)  AC_SUBST(EXTRA_LIBPCREPOSIX_LDFLAGS)
775  AC_SUBST(EXTRA_LIBPCRECPP_LDFLAGS)  AC_SUBST(EXTRA_LIBPCRECPP_LDFLAGS)
776    
777  # When we run 'make distcheck', use these arguments.  # When we run 'make distcheck', use these arguments.
778  DISTCHECK_CONFIGURE_FLAGS="--enable-jit --enable-cpp --enable-unicode-properties"  DISTCHECK_CONFIGURE_FLAGS="--enable-pcre16 --enable-jit --enable-cpp --enable-unicode-properties"
779  AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)  AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
780    
781  # Check that, if --enable-pcregrep-libz or --enable-pcregrep-libbz2 is  # Check that, if --enable-pcregrep-libz or --enable-pcregrep-libbz2 is
# Line 712  if test "$enable_pcretest_libreadline" = Line 818  if test "$enable_pcretest_libreadline" =
818      echo "** Cannot --enable-pcretest-readline because readline/history.h was not found."      echo "** Cannot --enable-pcretest-readline because readline/history.h was not found."
819      exit 1      exit 1
820    fi    fi
821    LIBREADLINE="-lreadline"    if test -z "$LIBREADLINE"; then
822        echo "** Cannot --enable-pcretest-readline because readline library was not found."
823        exit 1
824      fi
825  fi  fi
 AC_SUBST(LIBREADLINE)  
826    
827  # Produce these files, in addition to config.h.  # Produce these files, in addition to config.h.
828  AC_CONFIG_FILES(  AC_CONFIG_FILES(
829          Makefile          Makefile
830          libpcre.pc          libpcre.pc
831          libpcreposix.pc          libpcre16.pc
832            libpcreposix.pc
833          libpcrecpp.pc          libpcrecpp.pc
834          pcre-config          pcre-config
835          pcre.h          pcre.h
# Line 756  $PACKAGE-$VERSION configuration summary: Line 865  $PACKAGE-$VERSION configuration summary:
865      Linker flags .................... : ${LDFLAGS}      Linker flags .................... : ${LDFLAGS}
866      Extra libraries ................. : ${LIBS}      Extra libraries ................. : ${LIBS}
867    
868        Build 8 bit pcre library ........ : ${enable_pcre8}
869        Build 16 bit pcre library ....... : ${enable_pcre16}
870      Build C++ library ............... : ${enable_cpp}      Build C++ library ............... : ${enable_cpp}
871      Enable JIT compiling support .... : ${enable_jit}      Enable JIT compiling support .... : ${enable_jit}
872      Enable UTF-8 support ............ : ${enable_utf8}      Enable UTF-8/16 support ......... : ${enable_utf}
873      Unicode properties .............. : ${enable_unicode_properties}      Unicode properties .............. : ${enable_unicode_properties}
874      Newline char/sequence ........... : ${enable_newline}      Newline char/sequence ........... : ${enable_newline}
875      \R matches only ANYCRLF ......... : ${enable_bsr_anycrlf}      \R matches only ANYCRLF ......... : ${enable_bsr_anycrlf}

Legend:
Removed from v.835  
changed lines
  Added in v.896

  ViewVC Help
Powered by ViewVC 1.1.5