| 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, [30]) |
m4_define(pcre_minor, [31]) |
| 13 |
m4_define(pcre_prerelease, [-PT1]) |
m4_define(pcre_prerelease, [-RC1]) |
| 14 |
m4_define(pcre_date, [2012-01-01]) |
m4_define(pcre_date, [2012-06-01]) |
| 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. |
| 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], |
| 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], [HAVE_LIB_READLINE=1]) |
AC_CHECK_HEADERS([readline/history.h], [HAVE_HISTORY_H=1]) |
| 546 |
|
AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lreadline"], |
| 547 |
|
[unset ac_cv_lib_readline_readline; |
| 548 |
|
AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-ltinfo"], |
| 549 |
|
[unset ac_cv_lib_readline_readline; |
| 550 |
|
AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lcurses"], |
| 551 |
|
[unset ac_cv_lib_readline_readline; |
| 552 |
|
AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lncurses"], |
| 553 |
|
[unset ac_cv_lib_readline_readline; |
| 554 |
|
AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lncursesw"], |
| 555 |
|
[unset ac_cv_lib_readline_readline; |
| 556 |
|
AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-ltermcap"], |
| 557 |
|
[LIBREADLINE=""], |
| 558 |
|
[-ltermcap])], |
| 559 |
|
[-lncursesw])], |
| 560 |
|
[-lncurses])], |
| 561 |
|
[-lcurses])], |
| 562 |
|
[-ltinfo])]) |
| 563 |
|
AC_SUBST(LIBREADLINE) |
| 564 |
|
if test -n "$LIBREADLINE"; then |
| 565 |
|
if test "$LIBREADLINE" != "-lreadline"; then |
| 566 |
|
echo "-lreadline needs $LIBREADLINE" |
| 567 |
|
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 |
| 582 |
|
|
| 583 |
# This facilitates -ansi builds under Linux |
# This facilitates -ansi builds under Linux |
| 584 |
dnl AC_DEFINE([_GNU_SOURCE], [], [Enable GNU extensions in glibc]) |
dnl AC_DEFINE([_GNU_SOURCE], [], [Enable GNU extensions in glibc]) |
| 665 |
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 |
| 666 |
"before" and "after" lines.]) |
"before" and "after" lines.]) |
| 667 |
|
|
| 668 |
if test "$enable_pcretest_libreadline" = "yes"; then |
if test "$enable_pcretest_libedit" = "yes"; then |
| 669 |
|
AC_DEFINE([SUPPORT_LIBEDIT], [], [ |
| 670 |
|
Define to allow pcretest to be linked with libedit.]) |
| 671 |
|
LIBREADLINE="$LIBEDIT" |
| 672 |
|
elif test "$enable_pcretest_libreadline" = "yes"; then |
| 673 |
AC_DEFINE([SUPPORT_LIBREADLINE], [], [ |
AC_DEFINE([SUPPORT_LIBREADLINE], [], [ |
| 674 |
Define to allow pcretest to be linked with libreadline.]) |
Define to allow pcretest to be linked with libreadline.]) |
| 675 |
fi |
fi |
| 797 |
AC_SUBST(EXTRA_LIBPCREPOSIX_LDFLAGS) |
AC_SUBST(EXTRA_LIBPCREPOSIX_LDFLAGS) |
| 798 |
AC_SUBST(EXTRA_LIBPCRECPP_LDFLAGS) |
AC_SUBST(EXTRA_LIBPCRECPP_LDFLAGS) |
| 799 |
|
|
| 800 |
# When we run 'make distcheck', use these arguments. |
# When we run 'make distcheck', use these arguments. Turning off compiler |
| 801 |
DISTCHECK_CONFIGURE_FLAGS="--enable-pcre16 --enable-jit --enable-cpp --enable-unicode-properties" |
# optimization makes it run faster. |
| 802 |
|
DISTCHECK_CONFIGURE_FLAGS="CFLAGS='' CXXFLAGS='' --enable-pcre16 --enable-jit --enable-cpp --enable-unicode-properties" |
| 803 |
AC_SUBST(DISTCHECK_CONFIGURE_FLAGS) |
AC_SUBST(DISTCHECK_CONFIGURE_FLAGS) |
| 804 |
|
|
| 805 |
# Check that, if --enable-pcregrep-libz or --enable-pcregrep-libbz2 is |
# Check that, if --enable-pcregrep-libz or --enable-pcregrep-libbz2 is |
| 833 |
|
|
| 834 |
# Similarly for --enable-pcretest-readline |
# Similarly for --enable-pcretest-readline |
| 835 |
|
|
| 836 |
|
if test "$enable_pcretest_libedit" = "yes"; then |
| 837 |
|
if test "$enable_pcretest_libreadline" = "yes"; then |
| 838 |
|
echo "** Cannot use both --enable-pcretest-libedit and --enable-pcretest-readline" |
| 839 |
|
exit 1 |
| 840 |
|
fi |
| 841 |
|
if test "$HAVE_EDITLINE_READLINE_H" != "1" -a \ |
| 842 |
|
"$HAVE_READLINE_READLINE_H" != "1"; then |
| 843 |
|
echo "** Cannot --enable-pcretest-libedit because neither editline/readline.h" |
| 844 |
|
echo "** nor readline/readline.h was found." |
| 845 |
|
exit 1 |
| 846 |
|
fi |
| 847 |
|
if test -z "$LIBEDIT"; then |
| 848 |
|
echo "** Cannot --enable-pcretest-libedit because libedit library was not found." |
| 849 |
|
exit 1 |
| 850 |
|
fi |
| 851 |
|
fi |
| 852 |
|
|
| 853 |
if test "$enable_pcretest_libreadline" = "yes"; then |
if test "$enable_pcretest_libreadline" = "yes"; then |
| 854 |
if test "$HAVE_READLINE_H" != "1"; then |
if test "$HAVE_READLINE_H" != "1"; then |
| 855 |
echo "** Cannot --enable-pcretest-readline because readline/readline.h was not found." |
echo "** Cannot --enable-pcretest-readline because readline/readline.h was not found." |
| 859 |
echo "** Cannot --enable-pcretest-readline because readline/history.h was not found." |
echo "** Cannot --enable-pcretest-readline because readline/history.h was not found." |
| 860 |
exit 1 |
exit 1 |
| 861 |
fi |
fi |
| 862 |
LIBREADLINE="-lreadline" |
if test -z "$LIBREADLINE"; then |
| 863 |
|
echo "** Cannot --enable-pcretest-readline because readline library was not found." |
| 864 |
|
exit 1 |
| 865 |
|
fi |
| 866 |
fi |
fi |
|
AC_SUBST(LIBREADLINE) |
|
| 867 |
|
|
| 868 |
# Produce these files, in addition to config.h. |
# Produce these files, in addition to config.h. |
| 869 |
AC_CONFIG_FILES( |
AC_CONFIG_FILES( |
| 927 |
Buffer size for pcregrep ........ : ${with_pcregrep_bufsize} |
Buffer size for pcregrep ........ : ${with_pcregrep_bufsize} |
| 928 |
Link pcregrep with libz ......... : ${enable_pcregrep_libz} |
Link pcregrep with libz ......... : ${enable_pcregrep_libz} |
| 929 |
Link pcregrep with libbz2 ....... : ${enable_pcregrep_libbz2} |
Link pcregrep with libbz2 ....... : ${enable_pcregrep_libbz2} |
| 930 |
|
Link pcretest with libedit ...... : ${enable_pcretest_libedit} |
| 931 |
Link pcretest with libreadline .. : ${enable_pcretest_libreadline} |
Link pcretest with libreadline .. : ${enable_pcretest_libreadline} |
| 932 |
|
|
| 933 |
EOF |
EOF |