/[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 912 by ph10, Sun Feb 12 16:53:39 2012 UTC revision 1019 by ph10, Mon Aug 27 13:15:02 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, [31])  m4_define(pcre_minor, [32])
13  m4_define(pcre_prerelease, [-RC1])  m4_define(pcre_prerelease, [-RC1])
14  m4_define(pcre_date, [2012-02-012])  m4_define(pcre_date, [2012-08-08])
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:0:0])  m4_define(libpcre_version, [1:1:0])
21  m4_define(libpcre16_version, [0:0:0])  m4_define(libpcre16_version, [0:1:0])
22  m4_define(libpcreposix_version, [0:0:0])  m4_define(libpcreposix_version, [0:1:0])
23  m4_define(libpcrecpp_version, [0:0:0])  m4_define(libpcrecpp_version, [0:0:0])
24    
25  AC_PREREQ(2.57)  AC_PREREQ(2.57)
# Line 233  AC_ARG_WITH(pcregrep-bufsize, Line 233  AC_ARG_WITH(pcregrep-bufsize,
233                               [pcregrep buffer size (default=20480)]),                               [pcregrep buffer size (default=20480)]),
234                , with_pcregrep_bufsize=20480)                , with_pcregrep_bufsize=20480)
235    
236    # Handle --enable-pcretest-libedit
237    AC_ARG_ENABLE(pcretest-libedit,
238                  AS_HELP_STRING([--enable-pcretest-libedit],
239                                 [link pcretest with libedit]),
240                  , enable_pcretest_libedit=no)
241    
242  # Handle --enable-pcretest-libreadline  # Handle --enable-pcretest-libreadline
243  AC_ARG_ENABLE(pcretest-libreadline,  AC_ARG_ENABLE(pcretest-libreadline,
244                AS_HELP_STRING([--enable-pcretest-libreadline],                AS_HELP_STRING([--enable-pcretest-libreadline],
# Line 534  LIBS="$OLD_LIBS" Line 540  LIBS="$OLD_LIBS"
540    
541  # Check for the availabiity of libreadline  # Check for the availabiity of libreadline
542    
543  AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_H=1])  if test "$enable_pcretest_libreadline" = "yes"; then
544  AC_CHECK_HEADERS([readline/history.h], [HAVE_HISTORY_H=1])   AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_H=1])
545  AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lreadline"],   AC_CHECK_HEADERS([readline/history.h], [HAVE_HISTORY_H=1])
546    [unset ac_cv_lib_readline_readline;   AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lreadline"],
547     AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-ltinfo"],     [unset ac_cv_lib_readline_readline;
548      [unset ac_cv_lib_readline_readline;      AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-ltinfo"],
549       AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lcurses"],       [unset ac_cv_lib_readline_readline;
550        [unset ac_cv_lib_readline_readline;        AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lcurses"],
551         AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lncurses"],         [unset ac_cv_lib_readline_readline;
552          [unset ac_cv_lib_readline_readline;          AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lncurses"],
553           AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lncursesw"],           [unset ac_cv_lib_readline_readline;
554            [unset ac_cv_lib_readline_readline;            AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lncursesw"],
555             AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-ltermcap"],             [unset ac_cv_lib_readline_readline;
556              [LIBREADLINE=""],              AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-ltermcap"],
557              [-ltermcap])],               [LIBREADLINE=""],
558            [-lncursesw])],               [-ltermcap])],
559          [-lncurses])],             [-lncursesw])],
560        [-lcurses])],           [-lncurses])],
561      [-ltinfo])])         [-lcurses])],
562  AC_SUBST(LIBREADLINE)       [-ltinfo])])
563  if test -n "$LIBREADLINE"; then   AC_SUBST(LIBREADLINE)
564    if test "$LIBREADLINE" != "-lreadline"; then   if test -n "$LIBREADLINE"; then
565      echo "-lreadline needs $LIBREADLINE"     if test "$LIBREADLINE" != "-lreadline"; then
566      LIBREADLINE="-lreadline $LIBREADLINE"       echo "-lreadline needs $LIBREADLINE"
567    fi       LIBREADLINE="-lreadline $LIBREADLINE"
568       fi
569     fi
570    fi
571    
572    
573    # Check for the availability of libedit. Different distributions put its
574    # headers in different places. Try to cover the most common ones.
575    
576    if test "$enable_pcretest_libedit" = "yes"; then
577      AC_CHECK_HEADERS([editline/readline.h], [HAVE_EDITLINE_READLINE_H=1],
578        [AC_CHECK_HEADERS([edit/readline/readline.h], [HAVE_READLINE_READLINE_H=1],
579          [AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_READLINE_H=1])])])
580      AC_CHECK_LIB([edit], [readline], [LIBEDIT="-ledit"])
581  fi  fi
582    
583  # This facilitates -ansi builds under Linux  # This facilitates -ansi builds under Linux
# Line 567  dnl AC_DEFINE([_GNU_SOURCE], [], [Enable Line 586  dnl AC_DEFINE([_GNU_SOURCE], [], [Enable
586  PCRE_STATIC_CFLAG=""  PCRE_STATIC_CFLAG=""
587  if test "x$enable_shared" = "xno" ; then  if test "x$enable_shared" = "xno" ; then
588    AC_DEFINE([PCRE_STATIC], [1], [    AC_DEFINE([PCRE_STATIC], [1], [
589      Define if linking statically (TODO: make nice with Libtool)])      Define to any value if linking statically (TODO: make nice with Libtool)])
590    PCRE_STATIC_CFLAG="-DPCRE_STATIC"    PCRE_STATIC_CFLAG="-DPCRE_STATIC"
591  fi  fi
592  AC_SUBST(PCRE_STATIC_CFLAG)  AC_SUBST(PCRE_STATIC_CFLAG)
# Line 576  AC_SUBST(PCRE_STATIC_CFLAG) Line 595  AC_SUBST(PCRE_STATIC_CFLAG)
595    
596  if test "$enable_pcre8" = "yes"; then  if test "$enable_pcre8" = "yes"; then
597    AC_DEFINE([SUPPORT_PCRE8], [], [    AC_DEFINE([SUPPORT_PCRE8], [], [
598      Define to enable the 8 bit PCRE library.])      Define to any value to enable the 8 bit PCRE library.])
599  fi  fi
600    
601  if test "$enable_pcre16" = "yes"; then  if test "$enable_pcre16" = "yes"; then
602    AC_DEFINE([SUPPORT_PCRE16], [], [    AC_DEFINE([SUPPORT_PCRE16], [], [
603      Define to enable the 16 bit PCRE library.])      Define to any value to enable the 16 bit PCRE library.])
604  fi  fi
605    
606  if test "$enable_jit" = "yes"; then  if test "$enable_jit" = "yes"; then
607      AX_PTHREAD([], [AC_MSG_ERROR([JIT support requires pthreads])])
608      CC="$PTHREAD_CC"
609      CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
610      LIBS="$PTHREAD_LIBS $LIBS"
611    AC_DEFINE([SUPPORT_JIT], [], [    AC_DEFINE([SUPPORT_JIT], [], [
612      Define to enable support for Just-In-Time compiling.])      Define to any value to enable support for Just-In-Time compiling.])
613  else  else
614    enable_pcregrep_jit="no"    enable_pcregrep_jit="no"
615  fi  fi
616    
617  if test "$enable_pcregrep_jit" = "yes"; then  if test "$enable_pcregrep_jit" = "yes"; then
618    AC_DEFINE([SUPPORT_PCREGREP_JIT], [], [    AC_DEFINE([SUPPORT_PCREGREP_JIT], [], [
619      Define to enable JIT support in pcregrep.])      Define to any value to enable JIT support in pcregrep.])
620  fi  fi
621    
622  if test "$enable_utf" = "yes"; then  if test "$enable_utf" = "yes"; then
623    AC_DEFINE([SUPPORT_UTF], [], [    AC_DEFINE([SUPPORT_UTF], [], [
624      Define to enable support for the UTF-8/16 Unicode encoding. This      Define to any value to enable support for the UTF-8/16 Unicode encoding.
625      will work even in an EBCDIC environment, but it is incompatible      This will work even in an EBCDIC environment, but it is incompatible
626      with the EBCDIC macro. That is, PCRE can support *either* EBCDIC      with the EBCDIC macro. That is, PCRE can support *either* EBCDIC
627      code *or* ASCII/UTF-8/16, but not both at once.])      code *or* ASCII/UTF-8/16, but not both at once.])
628  fi  fi
629    
630  if test "$enable_unicode_properties" = "yes"; then  if test "$enable_unicode_properties" = "yes"; then
631    AC_DEFINE([SUPPORT_UCP], [], [    AC_DEFINE([SUPPORT_UCP], [], [
632      Define to enable support for Unicode properties.])      Define to any value to enable support for Unicode properties.])
633  fi  fi
634    
635  if test "$enable_stack_for_recursion" = "no"; then  if test "$enable_stack_for_recursion" = "no"; then
636    AC_DEFINE([NO_RECURSE], [], [    AC_DEFINE([NO_RECURSE], [], [
637      PCRE uses recursive function calls to handle backtracking while      PCRE uses recursive function calls to handle backtracking while
638      matching. This can sometimes be a problem on systems that have      matching. This can sometimes be a problem on systems that have
639      stacks of limited size. Define NO_RECURSE to get a version that      stacks of limited size. Define NO_RECURSE to any value to get a
640      doesn't use recursion in the match() function; instead it creates      version that doesn't use recursion in the match() function; instead
641      its own stack by steam using pcre_recurse_malloc() to obtain memory      it creates its own stack by steam using pcre_recurse_malloc() to obtain
642      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
643      just above the match() function. On systems that support it,      just above the match() function. On systems that support it, "configure"
644      "configure" can be used to set this in the Makefile      can be used to set this in the Makefile (use
645      (use --disable-stack-for-recursion).])      --disable-stack-for-recursion).])
646  fi  fi
647    
648  if test "$enable_pcregrep_libz" = "yes"; then  if test "$enable_pcregrep_libz" = "yes"; then
649    AC_DEFINE([SUPPORT_LIBZ], [], [    AC_DEFINE([SUPPORT_LIBZ], [], [
650      Define to allow pcregrep to be linked with libz, so that it is      Define to any value to allow pcregrep to be linked with libz, so that it is
651      able to handle .gz files.])      able to handle .gz files.])
652  fi  fi
653    
654  if test "$enable_pcregrep_libbz2" = "yes"; then  if test "$enable_pcregrep_libbz2" = "yes"; then
655    AC_DEFINE([SUPPORT_LIBBZ2], [], [    AC_DEFINE([SUPPORT_LIBBZ2], [], [
656      Define to allow pcregrep to be linked with libbz2, so that it is      Define to any value to allow pcregrep to be linked with libbz2, so that it
657      able to handle .bz2 files.])      is able to handle .bz2 files.])
658  fi  fi
659    
660  if test $with_pcregrep_bufsize -lt 8192 ; then  if test $with_pcregrep_bufsize -lt 8192 ; then
# Line 642  AC_DEFINE_UNQUOTED([PCREGREP_BUFSIZE], [ Line 665  AC_DEFINE_UNQUOTED([PCREGREP_BUFSIZE], [
665    The value of PCREGREP_BUFSIZE determines the size of buffer used by    The value of PCREGREP_BUFSIZE determines the size of buffer used by
666    pcregrep to hold parts of the file it is searching. On systems that    pcregrep to hold parts of the file it is searching. On systems that
667    support it, "configure" can be used to override the default, which is    support it, "configure" can be used to override the default, which is
668    8192. This is also the minimum value. The actual amount of memory used by    20K. This is also the minimum value. The actual amount of memory used by
669    pcregrep is three times this number, because it allows for the buffering of    pcregrep is three times this number, because it allows for the buffering of
670    "before" and "after" lines.])    "before" and "after" lines.])
671    
672  if test "$enable_pcretest_libreadline" = "yes"; then  if test "$enable_pcretest_libedit" = "yes"; then
673      AC_DEFINE([SUPPORT_LIBEDIT], [], [
674        Define to any value to allow pcretest to be linked with libedit.])
675      LIBREADLINE="$LIBEDIT"
676    elif test "$enable_pcretest_libreadline" = "yes"; then
677    AC_DEFINE([SUPPORT_LIBREADLINE], [], [    AC_DEFINE([SUPPORT_LIBREADLINE], [], [
678      Define to allow pcretest to be linked with libreadline.])      Define to any value to allow pcretest to be linked with libreadline.])
679  fi  fi
680    
681  AC_DEFINE_UNQUOTED([NEWLINE], [$ac_pcre_newline_value], [  AC_DEFINE_UNQUOTED([NEWLINE], [$ac_pcre_newline_value], [
# Line 660  AC_DEFINE_UNQUOTED([NEWLINE], [$ac_pcre_ Line 687  AC_DEFINE_UNQUOTED([NEWLINE], [$ac_pcre_
687  if test "$enable_bsr_anycrlf" = "yes"; then  if test "$enable_bsr_anycrlf" = "yes"; then
688    AC_DEFINE([BSR_ANYCRLF], [], [    AC_DEFINE([BSR_ANYCRLF], [], [
689      By default, the \R escape sequence matches any Unicode line ending      By default, the \R escape sequence matches any Unicode line ending
690      character or sequence of characters. If BSR_ANYCRLF is defined, this is      character or sequence of characters. If BSR_ANYCRLF is defined (to any
691      changed so that backslash-R matches only CR, LF, or CRLF. The build-      value), this is changed so that backslash-R matches only CR, LF, or CRLF.
692      time default can be overridden by the user of PCRE at runtime. On      The build-time default can be overridden by the user of PCRE at runtime.
693      systems that support it, "configure" can be used to override the      On systems that support it, "configure" can be used to override the
694      default.])      default.])
695  fi  fi
696    
# Line 722  AH_VERBATIM([PCRE_EXP_DEFN], [ Line 749  AH_VERBATIM([PCRE_EXP_DEFN], [
749  /* If you are compiling for a system other than a Unix-like system or  /* If you are compiling for a system other than a Unix-like system or
750     Win32, and it needs some magic to be inserted before the definition     Win32, and it needs some magic to be inserted before the definition
751     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
752     contain the relevant magic. If you do not define this macro, it     contain the relevant magic. If you do not define this macro, a suitable
753     defaults to "extern" for a C compiler and "extern C" for a C++      __declspec value is used for Windows systems; in other environments
754     compiler on non-Win32 systems. This macro apears at the start of     "extern" is used for a C compiler and "extern C" for a C++ compiler.
755     every exported function that is part of the external API. It does     This macro apears at the start of every exported function that is part
756     not appear on functions that are "external" in the C sense, but     of the external API. It does not appear on functions that are "external"
757     which are internal to the library. */     in the C sense, but which are internal to the library. */
758  #undef PCRE_EXP_DEFN])  #undef PCRE_EXP_DEFN])
759    
760  if test "$enable_ebcdic" = "yes"; then  if test "$enable_ebcdic" = "yes"; then
761    AC_DEFINE_UNQUOTED([EBCDIC], [], [    AC_DEFINE_UNQUOTED([EBCDIC], [], [
762      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
763      character codes, define this macro as 1. On systems that can use      character codes, define this macro to any value. On systems that can
764      "configure", this can be done via --enable-ebcdic. PCRE will then      use "configure", this can be done via --enable-ebcdic. PCRE will then
765      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
766      this macro, PCRE will assume input strings are ASCII or UTF-8/16      this macro, PCRE will assume input strings are ASCII or UTF-8/16
767      Unicode. It is not possible to build a version of PCRE that      Unicode. It is not possible to build a version of PCRE that
# Line 810  AC_SUBST(LIBBZ2) Line 837  AC_SUBST(LIBBZ2)
837    
838  # Similarly for --enable-pcretest-readline  # Similarly for --enable-pcretest-readline
839    
840    if test "$enable_pcretest_libedit" = "yes"; then
841      if test "$enable_pcretest_libreadline" = "yes"; then
842        echo "** Cannot use both --enable-pcretest-libedit and --enable-pcretest-readline"
843        exit 1
844      fi
845      if test "$HAVE_EDITLINE_READLINE_H" != "1" -a \
846              "$HAVE_READLINE_READLINE_H" != "1"; then
847        echo "** Cannot --enable-pcretest-libedit because neither editline/readline.h"
848        echo "** nor readline/readline.h was found."
849        exit 1
850      fi
851      if test -z "$LIBEDIT"; then
852        echo "** Cannot --enable-pcretest-libedit because libedit library was not found."
853        exit 1
854      fi
855    fi
856    
857  if test "$enable_pcretest_libreadline" = "yes"; then  if test "$enable_pcretest_libreadline" = "yes"; then
858    if test "$HAVE_READLINE_H" != "1"; then    if test "$HAVE_READLINE_H" != "1"; then
859      echo "** Cannot --enable-pcretest-readline because readline/readline.h was not found."      echo "** Cannot --enable-pcretest-readline because readline/readline.h was not found."
# Line 887  $PACKAGE-$VERSION configuration summary: Line 931  $PACKAGE-$VERSION configuration summary:
931      Buffer size for pcregrep ........ : ${with_pcregrep_bufsize}      Buffer size for pcregrep ........ : ${with_pcregrep_bufsize}
932      Link pcregrep with libz ......... : ${enable_pcregrep_libz}      Link pcregrep with libz ......... : ${enable_pcregrep_libz}
933      Link pcregrep with libbz2 ....... : ${enable_pcregrep_libbz2}      Link pcregrep with libbz2 ....... : ${enable_pcregrep_libbz2}
934        Link pcretest with libedit ...... : ${enable_pcretest_libedit}
935      Link pcretest with libreadline .. : ${enable_pcretest_libreadline}      Link pcretest with libreadline .. : ${enable_pcretest_libreadline}
936    
937  EOF  EOF

Legend:
Removed from v.912  
changed lines
  Added in v.1019

  ViewVC Help
Powered by ViewVC 1.1.5