/[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 1110 by chpe, Tue Oct 16 15:57:02 2012 UTC revision 1320 by ph10, Wed May 1 16:39:35 2013 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, [32])  m4_define(pcre_minor, [33])
13  m4_define(pcre_prerelease, [-RC1])  m4_define(pcre_prerelease, [-RC1])
14  m4_define(pcre_date, [2012-08-08])  m4_define(pcre_date, [2013-04-28])
15    
16  # NOTE: The CMakeLists.txt file searches for the above variables in the first  # 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.  # 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, [1:1:0])  m4_define(libpcre_version, [3:1:2])
21  m4_define(libpcre16_version, [0:1:0])  m4_define(libpcre16_version, [2:1:2])
22  m4_define(libpcre32_version, [0:1:0])  m4_define(libpcre32_version, [0:1:0])
23  m4_define(libpcreposix_version, [0:1:0])  m4_define(libpcreposix_version, [0:2:0])
24  m4_define(libpcrecpp_version, [0:0:0])  m4_define(libpcrecpp_version, [0:0:0])
25    
26  AC_PREREQ(2.57)  AC_PREREQ(2.57)
# Line 30  AM_INIT_AUTOMAKE([dist-bzip2 dist-zip]) Line 30  AM_INIT_AUTOMAKE([dist-bzip2 dist-zip])
30  m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])  m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
31  AC_CONFIG_HEADERS(config.h)  AC_CONFIG_HEADERS(config.h)
32    
33    # This is a new thing required to stop a warning from automake 1.12
34    m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
35    
36  # This was added at the suggestion of libtoolize (03-Jan-10)  # This was added at the suggestion of libtoolize (03-Jan-10)
37  AC_CONFIG_MACRO_DIR([m4])  AC_CONFIG_MACRO_DIR([m4])
38    
# Line 48  remember_set_CXXFLAGS="$CXXFLAGS" Line 51  remember_set_CXXFLAGS="$CXXFLAGS"
51    
52  AC_PROG_CC  AC_PROG_CC
53  AC_PROG_CXX  AC_PROG_CXX
54    AM_PROG_CC_C_O
55    
56  if test "x$remember_set_CFLAGS" = "x"  if test "x$remember_set_CFLAGS" = "x"
57  then  then
# Line 85  AC_LIBTOOL_WIN32_DLL Line 89  AC_LIBTOOL_WIN32_DLL
89  LT_INIT  LT_INIT
90  AC_PROG_LN_S  AC_PROG_LN_S
91    
92    # Check for GCC visibility feature
93    
94    PCRE_VISIBILITY
95    
96    # Versioning
97    
98  PCRE_MAJOR="pcre_major"  PCRE_MAJOR="pcre_major"
99  PCRE_MINOR="pcre_minor"  PCRE_MINOR="pcre_minor"
100  PCRE_PRERELEASE="pcre_prerelease"  PCRE_PRERELEASE="pcre_prerelease"
# Line 284  AC_ARG_WITH(match-limit-recursion, Line 294  AC_ARG_WITH(match-limit-recursion,
294                             [default limit on internal recursion (default=MATCH_LIMIT)]),                             [default limit on internal recursion (default=MATCH_LIMIT)]),
295              , with_match_limit_recursion=MATCH_LIMIT)              , with_match_limit_recursion=MATCH_LIMIT)
296    
297    # Handle --enable-valgrind
298    AC_ARG_ENABLE(valgrind,
299                  AS_HELP_STRING([--enable-valgrind],
300                                 [valgrind support]),
301                  , enable_valgrind=no)
302    
303    # Enable code coverage reports using gcov
304    AC_ARG_ENABLE(coverage,
305                  AS_HELP_STRING([--enable-coverage],
306                                 [enable code coverage reports using gcov]),
307                  , enable_coverage=no)
308    
309  # Copy enable_utf8 value to enable_utf for compatibility reasons  # Copy enable_utf8 value to enable_utf for compatibility reasons
310  if test "x$enable_utf8" != "xunset"  if test "x$enable_utf8" != "xunset"
311  then  then
# Line 349  then Line 371  then
371    fi    fi
372  fi  fi
373    
374  # Convert the newline identifier into the appropriate integer value. The first  # Convert the newline identifier into the appropriate integer value. The first
375  # three are ASCII values 0x0a, 0x0d, and 0x0d0a, but if EBCDIC is enabled, they  # three are ASCII values 0x0a, 0x0d, and 0x0d0a, but if EBCDIC is enabled, they
376  # are changed below.  # are changed below.
377    
# Line 367  esac Line 389  esac
389  # --enable-ebcdic-nl25 implies --enable-ebcdic  # --enable-ebcdic-nl25 implies --enable-ebcdic
390  if test "x$enable_ebcdic_nl25" = "xyes"; then  if test "x$enable_ebcdic_nl25" = "xyes"; then
391    enable_ebcdic=yes    enable_ebcdic=yes
392  fi  fi
393    
394  # 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,
395  # and the newline value is adjusted appropriately (CR is still 13, but LF is  # and the newline value is adjusted appropriately (CR is still 13, but LF is
# Line 386  if test "x$enable_ebcdic" = "xyes"; then Line 408  if test "x$enable_ebcdic" = "xyes"; then
408      case "$ac_pcre_newline_value" in      case "$ac_pcre_newline_value" in
409        10)   ac_pcre_newline_value=21 ;;        10)   ac_pcre_newline_value=21 ;;
410        3338) ac_pcre_newline_value=3349 ;;        3338) ac_pcre_newline_value=3349 ;;
411      esac      esac
412    else    else
413      case "$ac_pcre_newline_value" in      case "$ac_pcre_newline_value" in
414        10)   ac_pcre_newline_value=37 ;;        10)   ac_pcre_newline_value=37 ;;
415        3338) ac_pcre_newline_value=3365 ;;        3338) ac_pcre_newline_value=3365 ;;
416      esac      esac
417    fi    fi
418  fi  fi
419    
420  # Check argument to --with-link-size  # Check argument to --with-link-size
# Line 408  AH_TOP([ Line 430  AH_TOP([
430  can cope with, allowing it to run on SunOS4 and other "close to standard"  can cope with, allowing it to run on SunOS4 and other "close to standard"
431  systems.  systems.
432    
433  In environments that support the facilities, config.h.in is converted by  In environments that support the GNU autotools, config.h.in is converted into
434  "configure", or config-cmake.h.in is converted by CMake, into config.h. If you  config.h by the "configure" script. In environments that use CMake,
435  are going to build PCRE "by hand" without using "configure" or CMake, you  config-cmake.in is converted into config.h. If you are going to build PCRE "by
436  should copy the distributed config.h.generic to config.h, and then edit the  hand" without using "configure" or CMake, you should copy the distributed
437  macro definitions to be the way you need them. You must then add  config.h.generic to config.h, and edit the macro definitions to be the way you
438  -DHAVE_CONFIG_H to all of your compile commands, so that config.h is included  need them. You must then add -DHAVE_CONFIG_H to all of your compile commands,
439  at the start of every source.  so that config.h is included at the start of every source.
440    
441  Alternatively, you can avoid editing by using -D on the compiler command line  Alternatively, you can avoid editing by using -D on the compiler command line
442  to set the macro values. In this case, you do not have to set -DHAVE_CONFIG_H.  to set the macro values. In this case, you do not have to set -DHAVE_CONFIG_H,
443    but if you do, default values will be taken from config.h for non-boolean
444  PCRE uses memmove() if HAVE_MEMMOVE is set to 1; otherwise it uses bcopy() if  macros that are not defined on the command line.
445  HAVE_BCOPY is set to 1. If your system has neither bcopy() nor memmove(), set  
446  them both to 0; an emulation function will be used. */])  Boolean macros such as HAVE_STDLIB_H and SUPPORT_PCRE8 should either be defined
447    (conventionally to 1) for TRUE, and not defined at all for FALSE. All such
448    macros are listed as a commented #undef in config.h.generic. Macros such as
449    MATCH_LIMIT, whose actual value is relevant, have defaults defined, but are
450    surrounded by #ifndef/#endif lines so that the value can be overridden by -D.
451    
452    PCRE uses memmove() if HAVE_MEMMOVE is defined; otherwise it uses bcopy() if
453    HAVE_BCOPY is defined. If your system has neither bcopy() nor memmove(), make
454    sure both macros are undefined; an emulation function will then be used. */])
455    
456  # Checks for header files.  # Checks for header files.
457  AC_HEADER_STDC  AC_HEADER_STDC
# Line 430  AC_CHECK_HEADERS(limits.h sys/types.h sy Line 460  AC_CHECK_HEADERS(limits.h sys/types.h sy
460  # The files below are C++ header files.  # The files below are C++ header files.
461  pcre_have_type_traits="0"  pcre_have_type_traits="0"
462  pcre_have_bits_type_traits="0"  pcre_have_bits_type_traits="0"
463    
464    if test "x$enable_cpp" = "xyes" -a -z "$CXX"; then
465       AC_MSG_ERROR([You need a C++ compiler for C++ support.])
466    fi
467    
468  if test "x$enable_cpp" = "xyes" -a -n "$CXX"  if test "x$enable_cpp" = "xyes" -a -n "$CXX"
469  then  then
470  AC_LANG_PUSH(C++)  AC_LANG_PUSH(C++)
# Line 525  AM_CONDITIONAL(WITH_PCRE_CPP, test "x$en Line 560  AM_CONDITIONAL(WITH_PCRE_CPP, test "x$en
560  AM_CONDITIONAL(WITH_REBUILD_CHARTABLES, test "x$enable_rebuild_chartables" = "xyes")  AM_CONDITIONAL(WITH_REBUILD_CHARTABLES, test "x$enable_rebuild_chartables" = "xyes")
561  AM_CONDITIONAL(WITH_JIT, test "x$enable_jit" = "xyes")  AM_CONDITIONAL(WITH_JIT, test "x$enable_jit" = "xyes")
562  AM_CONDITIONAL(WITH_UTF, test "x$enable_utf" = "xyes")  AM_CONDITIONAL(WITH_UTF, test "x$enable_utf" = "xyes")
563    AM_CONDITIONAL(WITH_VALGRIND, test "x$enable_valgrind" = "xyes")
564    
565  # Checks for typedefs, structures, and compiler characteristics.  # Checks for typedefs, structures, and compiler characteristics.
566    
# Line 677  if test "$enable_stack_for_recursion" = Line 713  if test "$enable_stack_for_recursion" =
713    AC_DEFINE([NO_RECURSE], [], [    AC_DEFINE([NO_RECURSE], [], [
714      PCRE uses recursive function calls to handle backtracking while      PCRE uses recursive function calls to handle backtracking while
715      matching. This can sometimes be a problem on systems that have      matching. This can sometimes be a problem on systems that have
716      stacks of limited size. Define NO_RECURSE to any value to get a      stacks of limited size. Define NO_RECURSE to any value to get a
717      version that doesn't use recursion in the match() function; instead      version that doesn't use recursion in the match() function; instead
718      it creates its own stack by steam using pcre_recurse_malloc() to obtain      it creates its own stack by steam using pcre_recurse_malloc() to obtain
719      memory from the heap. For more detail, see the comments and other stuff      memory from the heap. For more detail, see the comments and other stuff
720      just above the match() function.])      just above the match() function.])
# Line 728  if test "$enable_bsr_anycrlf" = "yes"; t Line 764  if test "$enable_bsr_anycrlf" = "yes"; t
764    AC_DEFINE([BSR_ANYCRLF], [], [    AC_DEFINE([BSR_ANYCRLF], [], [
765      By default, the \R escape sequence matches any Unicode line ending      By default, the \R escape sequence matches any Unicode line ending
766      character or sequence of characters. If BSR_ANYCRLF is defined (to any      character or sequence of characters. If BSR_ANYCRLF is defined (to any
767      value), this is changed so that backslash-R matches only CR, LF, or CRLF.      value), this is changed so that backslash-R matches only CR, LF, or CRLF.
768      The build-time default can be overridden by the user of PCRE at runtime.])      The build-time default can be overridden by the user of PCRE at runtime.])
769  fi  fi
770    
# Line 783  AH_VERBATIM([PCRE_EXP_DEFN], [ Line 819  AH_VERBATIM([PCRE_EXP_DEFN], [
819     Win32, and it needs some magic to be inserted before the definition     Win32, and it needs some magic to be inserted before the definition
820     of a function that is exported by the library, define this macro to     of a function that is exported by the library, define this macro to
821     contain the relevant magic. If you do not define this macro, a suitable     contain the relevant magic. If you do not define this macro, a suitable
822      __declspec value is used for Windows systems; in other environments      __declspec value is used for Windows systems; in other environments
823     "extern" is used for a C compiler and "extern C" for a C++ compiler.     "extern" is used for a C compiler and "extern C" for a C++ compiler.
824     This macro apears at the start of every exported function that is part     This macro apears at the start of every exported function that is part
825     of the external API. It does not appear on functions that are "external"     of the external API. It does not appear on functions that are "external"
826     in the C sense, but which are internal to the library. */     in the C sense, but which are internal to the library. */
827  #undef PCRE_EXP_DEFN])  #undef PCRE_EXP_DEFN])
828    
# Line 809  if test "$enable_ebcdic_nl25" = "yes"; t Line 845  if test "$enable_ebcdic_nl25" = "yes"; t
845      that LF does in an ASCII/Unicode environment. The value must also be set in      that LF does in an ASCII/Unicode environment. The value must also be set in
846      the NEWLINE macro below. On systems that can use "configure" or CMake to      the NEWLINE macro below. On systems that can use "configure" or CMake to
847      set EBCDIC_NL25, the adjustment of NEWLINE is automatic.])      set EBCDIC_NL25, the adjustment of NEWLINE is automatic.])
848  fi  fi
849    
850    if test "$enable_valgrind" = "yes"; then
851      AC_DEFINE_UNQUOTED([SUPPORT_VALGRIND], [], [
852         Define to any value for valgrind support to find invalid memory reads.])
853    fi
854    
855  # Platform specific issues  # Platform specific issues
856  NO_UNDEFINED=  NO_UNDEFINED=
# Line 916  if test "$enable_pcretest_libreadline" = Line 957  if test "$enable_pcretest_libreadline" =
957    fi    fi
958  fi  fi
959    
960    # Check for valgrind
961    
962    if test "$enable_valgrind" = "yes"; then
963      m4_ifdef([PKG_CHECK_MODULES],
964               [PKG_CHECK_MODULES([VALGRIND],[valgrind])],
965               [AC_MSG_ERROR([pkg-config not supported])])
966    fi
967    
968    # test code coverage reporting
969    if test "$enable_coverage" = "yes"; then
970      if test "x$GCC" != "xyes"; then
971        AC_MSG_ERROR([Code coverage reports can only be generated when using GCC])
972      fi
973    
974      # ccache is incompatible with gcov
975      AC_PATH_PROG([SHTOOL],[shtool],[false])
976      case `$SHTOOL path $CC` in
977        *ccache*) cc_ccache=yes;;
978        *) cc_ccache=no;;
979      esac
980    
981      if test "$cc_ccache" = "yes"; then
982        if test -z "$CCACHE_DISABLE" -o "$CCACHE_DISABLE" != "1"; then
983          AC_MSG_ERROR([must export CCACHE_DISABLE=1 to disable ccache for code coverage])
984        fi
985      fi
986    
987      AC_ARG_VAR([LCOV],[the ltp lcov program])
988      AC_PATH_PROG([LCOV],[lcov],[false])
989      if test "x$LCOV" = "xfalse"; then
990        AC_MSG_ERROR([lcov not found])
991      fi
992    
993      AC_ARG_VAR([GENHTML],[the ltp genhtml program])
994      AC_PATH_PROG([GENHTML],[genhtml],[false])
995      if test "x$GENHTML" = "xfalse"; then
996        AC_MSG_ERROR([genhtml not found])
997      fi
998    
999      AC_DEFINE([SUPPORT_GCOV],[1], [
1000        Define to allow pcretest and pcregrep to be linked with gcov, so that they
1001        are able to generate code coverage reports.])
1002    
1003      # And add flags needed for gcov
1004      GCOV_CFLAGS="-O0 -ggdb3 -fprofile-arcs -ftest-coverage"
1005      GCOV_CXXFLAGS="-O0 -ggdb3 -fprofile-arcs -ftest-coverage"
1006      GCOV_LIBS="-lgcov"
1007      AC_SUBST([GCOV_CFLAGS])
1008      AC_SUBST([GCOV_CXXFLAGS])
1009      AC_SUBST([GCOV_LIBS])
1010    fi # enable_coverage
1011    
1012    AM_CONDITIONAL([WITH_GCOV],[test "x$enable_coverage" = "xyes"])
1013    
1014  # Produce these files, in addition to config.h.  # Produce these files, in addition to config.h.
1015  AC_CONFIG_FILES(  AC_CONFIG_FILES(
1016          Makefile          Makefile
# Line 947  if test "$enable_ebcdic_nl25" = "yes"; t Line 1042  if test "$enable_ebcdic_nl25" = "yes"; t
1042    ebcdic_nl_code=0x25    ebcdic_nl_code=0x25
1043  elif test "$enable_ebcdic" = "yes"; then  elif test "$enable_ebcdic" = "yes"; then
1044    ebcdic_nl_code=0x15    ebcdic_nl_code=0x15
1045  fi  fi
1046    
1047  cat <<EOF  cat <<EOF
1048    
# Line 960  $PACKAGE-$VERSION configuration summary: Line 1055  $PACKAGE-$VERSION configuration summary:
1055      C++ compiler .................... : ${CXX}      C++ compiler .................... : ${CXX}
1056      Linker .......................... : ${LD}      Linker .......................... : ${LD}
1057      C preprocessor flags ............ : ${CPPFLAGS}      C preprocessor flags ............ : ${CPPFLAGS}
1058      C compiler flags ................ : ${CFLAGS}      C compiler flags ................ : ${CFLAGS} ${VISIBILITY_CFLAGS}
1059      C++ compiler flags .............. : ${CXXFLAGS}      C++ compiler flags .............. : ${CXXFLAGS} ${VISIBILITY_CXXFLAGS}
1060      Linker flags .................... : ${LDFLAGS}      Linker flags .................... : ${LDFLAGS}
1061      Extra libraries ................. : ${LIBS}      Extra libraries ................. : ${LIBS}
1062    
# Line 975  $PACKAGE-$VERSION configuration summary: Line 1070  $PACKAGE-$VERSION configuration summary:
1070      Newline char/sequence ........... : ${enable_newline}      Newline char/sequence ........... : ${enable_newline}
1071      \R matches only ANYCRLF ......... : ${enable_bsr_anycrlf}      \R matches only ANYCRLF ......... : ${enable_bsr_anycrlf}
1072      EBCDIC coding ................... : ${enable_ebcdic}      EBCDIC coding ................... : ${enable_ebcdic}
1073      EBCDIC code for NL .............. : ${ebcdic_nl_code}      EBCDIC code for NL .............. : ${ebcdic_nl_code}
1074      Rebuild char tables ............. : ${enable_rebuild_chartables}      Rebuild char tables ............. : ${enable_rebuild_chartables}
1075      Use stack recursion ............. : ${enable_stack_for_recursion}      Use stack recursion ............. : ${enable_stack_for_recursion}
1076      POSIX mem threshold ............. : ${with_posix_malloc_threshold}      POSIX mem threshold ............. : ${with_posix_malloc_threshold}
# Line 990  $PACKAGE-$VERSION configuration summary: Line 1085  $PACKAGE-$VERSION configuration summary:
1085      Link pcregrep with libbz2 ....... : ${enable_pcregrep_libbz2}      Link pcregrep with libbz2 ....... : ${enable_pcregrep_libbz2}
1086      Link pcretest with libedit ...... : ${enable_pcretest_libedit}      Link pcretest with libedit ...... : ${enable_pcretest_libedit}
1087      Link pcretest with libreadline .. : ${enable_pcretest_libreadline}      Link pcretest with libreadline .. : ${enable_pcretest_libreadline}
1088        Valgrind support ................ : ${enable_valgrind}
1089        Code coverage ................... : ${enable_coverage}
1090    
1091  EOF  EOF
1092    

Legend:
Removed from v.1110  
changed lines
  Added in v.1320

  ViewVC Help
Powered by ViewVC 1.1.5