| 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 This configure.in file has been hacked around quite a lot as a result of |
| 4 |
|
dnl patches that various people have sent to me (PH). Sometimes the information |
| 5 |
|
dnl I get is contradictory. I've tried to put in comments that explain things, |
| 6 |
|
dnl but in some cases the information is second-hand and I have no way of |
| 7 |
|
dnl verifying it. I am not an autoconf or libtool expert! |
| 8 |
|
|
| 9 |
dnl This is required at the start; the name is the name of a file |
dnl This is required at the start; the name is the name of a file |
| 10 |
dnl it should be seeing, to verify it is in the same directory. |
dnl it should be seeing, to verify it is in the same directory. |
| 11 |
|
|
| 27 |
dnl that many releases anyway. |
dnl that many releases anyway. |
| 28 |
|
|
| 29 |
PCRE_MAJOR=6 |
PCRE_MAJOR=6 |
| 30 |
PCRE_MINOR=2 |
PCRE_MINOR=3 |
| 31 |
PCRE_DATE=01-Aug-2005 |
PCRE_DATE=15-Aug-2005 |
| 32 |
PCRE_VERSION=${PCRE_MAJOR}.${PCRE_MINOR} |
PCRE_VERSION=${PCRE_MAJOR}.${PCRE_MINOR} |
| 33 |
|
|
| 34 |
dnl Default values for miscellaneous macros |
dnl Default values for miscellaneous macros |
| 42 |
PCRE_POSIXLIB_VERSION=0:0:0 |
PCRE_POSIXLIB_VERSION=0:0:0 |
| 43 |
PCRE_CPPLIB_VERSION=0:0:0 |
PCRE_CPPLIB_VERSION=0:0:0 |
| 44 |
|
|
| 45 |
|
dnl Handle --disable-cpp |
| 46 |
|
|
| 47 |
|
AC_ARG_ENABLE(cpp, |
| 48 |
|
[ --disable-cpp disable C++ support], |
| 49 |
|
want_cpp="$enableval", want_cpp=yes) |
| 50 |
|
|
| 51 |
dnl Checks for programs. |
dnl Checks for programs. |
| 52 |
|
|
| 53 |
AC_PROG_CC |
AC_PROG_CC |
| 54 |
|
|
| 55 |
dnl For the C++ wrapper libpcrecpp. |
dnl Test for C++ for the C++ wrapper libpcrecpp. It seems, however, that |
| 56 |
|
dnl AC_PROC_CXX will set $CXX to "g++" when no C++ compiler is installed, even |
| 57 |
|
dnl though that is completely bogus. (This may happen only on certain systems |
| 58 |
|
dnl with certain versions of autoconf, of course.) An attempt to include this |
| 59 |
|
dnl test inside a check for want_cpp was criticized by a libtool expert, who |
| 60 |
|
dnl tells me that it isn't allowed. |
| 61 |
|
|
| 62 |
AC_PROG_CXX |
AC_PROG_CXX |
| 63 |
|
|
| 77 |
dnl There is a macro called AC_PROG_CC_FOR_BUILD in the GNU archive for |
dnl There is a macro called AC_PROG_CC_FOR_BUILD in the GNU archive for |
| 78 |
dnl figuring this out automatically. Unfortunately, it does not work with the |
dnl figuring this out automatically. Unfortunately, it does not work with the |
| 79 |
dnl latest versions of autoconf. So for the moment, we just default to the |
dnl latest versions of autoconf. So for the moment, we just default to the |
| 80 |
dnl same values as the "main" compiler. People who are corss-compiling will |
dnl same values as the "main" compiler. People who are cross-compiling will |
| 81 |
dnl just have to adjust the Makefile by hand or set these values when they |
dnl just have to adjust the Makefile by hand or set these values when they |
| 82 |
dnl run "configure". |
dnl run "configure". |
| 83 |
|
|
| 94 |
AC_HEADER_STDC |
AC_HEADER_STDC |
| 95 |
AC_CHECK_HEADERS(limits.h) |
AC_CHECK_HEADERS(limits.h) |
| 96 |
|
|
| 97 |
dnl These are C++ header files |
dnl The files below are C++ header files. One person told me (PH) that |
| 98 |
|
dnl AC_LANG_CPLUSPLUS unsets CXX if it was explicitly set to something which |
| 99 |
|
dnl doesn't work. However, this doesn't always seem to be the case. |
| 100 |
|
|
| 101 |
|
if test "x$want_cpp" = "xyes" -a -n "$CXX" |
| 102 |
|
then |
| 103 |
AC_LANG_SAVE |
AC_LANG_SAVE |
| 104 |
AC_LANG_CPLUSPLUS |
AC_LANG_CPLUSPLUS |
| 105 |
dnl I could be more clever here, given I'm doing AC_SUBST with this |
|
| 106 |
dnl (eg set a var to be the name of the include file I want). But I'm not |
dnl We could be more clever here, given we're doing AC_SUBST with this |
| 107 |
|
dnl (eg set a var to be the name of the include file we want). But we're not |
| 108 |
dnl so it's easy to change back to 'regular' autoconf vars if we needed to. |
dnl so it's easy to change back to 'regular' autoconf vars if we needed to. |
| 109 |
AC_CHECK_HEADERS(string, [pcre_has_cpp_headers="1"], |
AC_CHECK_HEADERS(string, [pcre_have_cpp_headers="1"], |
| 110 |
[pcre_has_cpp_headers="0"]) |
[pcre_have_cpp_headers="0"]) |
| 111 |
AC_CHECK_HEADERS(bits/type_traits.h, [pcre_has_bits_type_traits="1"], |
AC_CHECK_HEADERS(bits/type_traits.h, [pcre_have_bits_type_traits="1"], |
| 112 |
[pcre_has_bits_type_traits="0"]) |
[pcre_have_bits_type_traits="0"]) |
| 113 |
AC_CHECK_HEADERS(type_traits.h, [pcre_has_type_traits="1"], |
AC_CHECK_HEADERS(type_traits.h, [pcre_have_type_traits="1"], |
| 114 |
[pcre_has_type_traits="0"]) |
[pcre_have_type_traits="0"]) |
| 115 |
dnl Using AC_SUBST eliminates the need to include config.h in a public .h file |
dnl Using AC_SUBST eliminates the need to include config.h in a public .h file |
| 116 |
AC_SUBST(pcre_has_bits_type_traits) |
AC_SUBST(pcre_have_bits_type_traits) |
| 117 |
AC_SUBST(pcre_has_type_traits) |
AC_SUBST(pcre_have_type_traits) |
| 118 |
AC_LANG_RESTORE |
AC_LANG_RESTORE |
| 119 |
|
fi |
| 120 |
|
|
| 121 |
dnl From the above, we now have enough info to know if C++ is fully installed |
dnl From the above, we now have enough info to know if C++ is fully installed |
| 122 |
if test -n "$ac_cv_prog_ac_ct_CXX" -a "$pcre_has_cpp_headers" = 1; then |
if test "x$want_cpp" = "xyes" -a -n "$CXX" -a "$pcre_have_cpp_headers" = 1; then |
| 123 |
MAYBE_CPP_TARGETS='$(CPP_TARGETS)' |
MAYBE_CPP_TARGETS='$(CPP_TARGETS)' |
| 124 |
|
HAVE_CPP= |
| 125 |
|
else |
| 126 |
|
MAYBE_CPP_TARGETS= |
| 127 |
|
HAVE_CPP="#" |
| 128 |
fi |
fi |
| 129 |
AC_SUBST(MAYBE_CPP_TARGETS) |
AC_SUBST(MAYBE_CPP_TARGETS) |
| 130 |
|
AC_SUBST(HAVE_CPP) |
| 131 |
|
|
| 132 |
dnl Checks for typedefs, structures, and compiler characteristics. |
dnl Checks for typedefs, structures, and compiler characteristics. |
| 133 |
|
|
| 134 |
AC_C_CONST |
AC_C_CONST |
| 135 |
AC_TYPE_SIZE_T |
AC_TYPE_SIZE_T |
| 136 |
|
|
| 137 |
AC_CHECK_TYPES([long long], [pcre_has_long_long="1"], [pcre_has_long_long="0"]) |
AC_CHECK_TYPES([long long], [pcre_have_long_long="1"], [pcre_have_long_long="0"]) |
| 138 |
AC_CHECK_TYPES([unsigned long long], [pcre_has_ulong_long="1"], [pcre_has_ulong_long="0"]) |
AC_CHECK_TYPES([unsigned long long], [pcre_have_ulong_long="1"], [pcre_have_ulong_long="0"]) |
| 139 |
AC_SUBST(pcre_has_long_long) |
AC_SUBST(pcre_have_long_long) |
| 140 |
AC_SUBST(pcre_has_ulong_long) |
AC_SUBST(pcre_have_ulong_long) |
| 141 |
|
|
| 142 |
dnl Checks for library functions. |
dnl Checks for library functions. |
| 143 |
|
|