diff options
author | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2010-01-03 16:05:13 +0000 |
---|---|---|
committer | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2010-01-03 16:05:13 +0000 |
commit | 1cc5f7a302c1d0e9e24e15c2c68d3f73f7353925 (patch) | |
tree | a358cb2234953d39a84044fc4eb2f09ba569cb47 | |
parent | 97d8dbe9650dfa099c504531c0f5977849199240 (diff) | |
download | pcre-1cc5f7a302c1d0e9e24e15c2c68d3f73f7353925.tar.gz |
Update configure.ac to solve libbz2 problem under Win32.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@478 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r-- | ChangeLog | 52 | ||||
-rw-r--r-- | configure.ac | 33 |
2 files changed, 62 insertions, 23 deletions
@@ -26,37 +26,47 @@ Version 8.01 11-Dec-09 assertion subpattern, including such a pattern used as a condition, unpredictable results occurred, instead of the error return PCRE_ERROR_DFA_UITEM. - + 5. The C++ GlobalReplace function was not working like Perl for the special situation when an empty string is matched. It now does the fancy magic - stuff that is necessary. - -6. In pcre_internal.h, obsolete includes to setjmp.h and stdarg.h have been + stuff that is necessary. + +6. In pcre_internal.h, obsolete includes to setjmp.h and stdarg.h have been removed. (These were left over from very, very early versions of PCRE.) - + 7. Some cosmetic changes to the code to make life easier when compiling it as part of something else: - - (a) Change DEBUG to PCRE_DEBUG. - - (b) In pcre_compile(), rename the member of the "branch_chain" structure - called "current" as "current_branch", to prevent a collision with the + + (a) Change DEBUG to PCRE_DEBUG. + + (b) In pcre_compile(), rename the member of the "branch_chain" structure + called "current" as "current_branch", to prevent a collision with the Linux macro when compiled as a kernel module. - - (c) In pcre_study(), rename the function set_bit() as set_table_bit(), to - prevent a collision with the Linux macro when compiled as a kernel + + (c) In pcre_study(), rename the function set_bit() as set_table_bit(), to + prevent a collision with the Linux macro when compiled as a kernel module. - + 8. In pcre_compile() there are some checks for integer overflows that used to cast potentially large values to (double). This has been changed to that - when building, a check for int64_t is made, and if it is found, it is used - instead, thus avoiding the use of floating point arithmetic. (There is no - other use of FP in PCRE.) If int64_t is not found, the fallback is to - double. - -9. Added two casts to avoid signed/unsigned warnings from VS Studio Express + when building, a check for int64_t is made, and if it is found, it is used + instead, thus avoiding the use of floating point arithmetic. (There is no + other use of FP in PCRE.) If int64_t is not found, the fallback is to + double. + +9. Added two casts to avoid signed/unsigned warnings from VS Studio Express 2005 (difference between two addresses compared to an unsigned value). - + +10. Change the standard AC_CHECK_LIB test for libbz2 in configure.ac to a + custom one, because of the following reported problem in Windows: + + - libbz2 uses the Pascal calling convention (WINAPI) for the functions + under Win32. + - The standard autoconf AC_CHECK_LIB fails to include "bzlib.h", + therefore missing the function definition. + - The compiler thus generates a "C" signature for the test function. + - The linker fails to find the "C" function. + - PCRE fails to configure if asked to do so against libbz2. Version 8.00 19-Oct-09 diff --git a/configure.ac b/configure.ac index 1765441..e864c2b 100644 --- a/configure.ac +++ b/configure.ac @@ -368,10 +368,39 @@ AC_CHECK_FUNCS(bcopy memmove strerror) AC_CHECK_HEADERS([zlib.h], [HAVE_ZLIB_H=1]) AC_CHECK_LIB([z], [gzopen], [HAVE_LIBZ=1]) -# Check for the availability of libbz2 +# Check for the availability of libbz2. Originally we just used AC_CHECK_LIB, +# as for libz. However, this had the following problem, diagnosed and fixed by +# a user: +# +# - libbz2 uses the Pascal calling convention (WINAPI) for the functions +# under Win32. +# - The standard autoconf AC_CHECK_LIB fails to include "bzlib.h", +# therefore missing the function definition. +# - The compiler thus generates a "C" signature for the test function. +# - The linker fails to find the "C" function. +# - PCRE fails to configure if asked to do so against libbz2. +# +# Solution: +# +# - Replace the AC_CHECK_LIB test with a custom test. AC_CHECK_HEADERS([bzlib.h], [HAVE_BZLIB_H=1]) -AC_CHECK_LIB([bz2], [BZ2_bzopen], [HAVE_LIBBZ2=1]) +# Original test +# AC_CHECK_LIB([bz2], [BZ2_bzopen], [HAVE_LIBBZ2=1]) +# +# Custom test follows + +AC_MSG_CHECKING([for libbz2]) +OLD_LIBS="$LIBS" +LIBS="$LIBS -lbz2" +AC_LINK_IFELSE( AC_LANG_PROGRAM([[ +#ifdef HAVE_BZLIB_H +#include <bzlib.h> +#endif]], +[[return (int)BZ2_bzopen("conftest", "rb");]]), +[AC_MSG_RESULT([yes]);HAVE_LIBBZ2=1; break;], +AC_MSG_RESULT([no])) +LIBS="$OLD_LIBS" # Check for the availabiity of libreadline |