This patch solves the problem Skip was seeing with zlib, this patch ensures that

configure uses similar compiler flags as setup.py when doing the zlib test.

Without this patch configure would use the first shared library on the linker
path, with this patch it uses the first shared or static library on that path
just like setup.py.
This commit is contained in:
Ronald Oussoren 2006-07-06 10:13:35 +00:00
parent b979b35f70
commit f875264278
2 changed files with 46 additions and 4 deletions

24
configure vendored
View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# From configure.in Revision: . # From configure.in Revision: 47023 .
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59 for python 2.5. # Generated by GNU Autoconf 2.59 for python 2.5.
# #
@ -722,13 +722,13 @@ echo X"$0" |
/^X\(\/\).*/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; }
s/.*/./; q'` s/.*/./; q'`
srcdir=$ac_confdir srcdir=$ac_confdir
if test ! -r "$srcdir/$ac_unique_file"; then if test ! -r $srcdir/$ac_unique_file; then
srcdir=.. srcdir=..
fi fi
else else
ac_srcdir_defaulted=no ac_srcdir_defaulted=no
fi fi
if test ! -r "$srcdir/$ac_unique_file"; then if test ! -r $srcdir/$ac_unique_file; then
if test "$ac_srcdir_defaulted" = yes; then if test "$ac_srcdir_defaulted" = yes; then
{ echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
{ (exit 1); exit 1; }; } { (exit 1); exit 1; }; }
@ -737,7 +737,7 @@ if test ! -r "$srcdir/$ac_unique_file"; then
{ (exit 1); exit 1; }; } { (exit 1); exit 1; }; }
fi fi
fi fi
(cd $srcdir && test -r "./$ac_unique_file") 2>/dev/null || (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
{ echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
{ (exit 1); exit 1; }; } { (exit 1); exit 1; }; }
srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
@ -14980,6 +14980,15 @@ fi
fi fi
case $ac_sys_system/$ac_sys_release in
Darwin/*)
_CUR_CFLAGS="${CFLAGS}"
_CUR_LDFLAGS="${LDFLAGS}"
CFLAGS="${CFLAGS} -Wl,-search_paths_first"
LDFLAGS="${LDFLAGS} -Wl,-search_paths_first -L/usr/local/lib"
;;
esac
echo "$as_me:$LINENO: checking for inflateCopy in -lz" >&5 echo "$as_me:$LINENO: checking for inflateCopy in -lz" >&5
echo $ECHO_N "checking for inflateCopy in -lz... $ECHO_C" >&6 echo $ECHO_N "checking for inflateCopy in -lz... $ECHO_C" >&6
if test "${ac_cv_lib_z_inflateCopy+set}" = set; then if test "${ac_cv_lib_z_inflateCopy+set}" = set; then
@ -15053,6 +15062,13 @@ _ACEOF
fi fi
case $ac_sys_system/$ac_sys_release in
Darwin/*)
CFLAGS="${_CUR_CFLAGS}"
LDFLAGS="${_CUR_LDFLAGS}"
;;
esac
echo "$as_me:$LINENO: checking for hstrerror" >&5 echo "$as_me:$LINENO: checking for hstrerror" >&5
echo $ECHO_N "checking for hstrerror... $ECHO_C" >&6 echo $ECHO_N "checking for hstrerror... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF cat >conftest.$ac_ext <<_ACEOF

View File

@ -2352,8 +2352,34 @@ AC_CHECK_LIB(c, inet_aton, [$ac_cv_prog_TRUE],
) )
dnl Check if system zlib has *Copy() functions dnl Check if system zlib has *Copy() functions
dnl
dnl On MacOSX the linker will search for dylibs on the entire linker path
dnl before searching for static libraries. setup.py adds -Wl,-search_paths_first
dnl to revert to a more traditional unix behaviour and make it possible to
dnl override the system libz with a local static library of libz. Temporarily
dnl add that flag to our CFLAGS as well to ensure that we check the version
dnl of libz that will be used by setup.py.
dnl The -L/usr/local/lib is needed as wel to get the same compilation
dnl environment as setup.py (and leaving it out can cause configure to use the
dnl wrong version of the library)
case $ac_sys_system/$ac_sys_release in
Darwin/*)
_CUR_CFLAGS="${CFLAGS}"
_CUR_LDFLAGS="${LDFLAGS}"
CFLAGS="${CFLAGS} -Wl,-search_paths_first"
LDFLAGS="${LDFLAGS} -Wl,-search_paths_first -L/usr/local/lib"
;;
esac
AC_CHECK_LIB(z, inflateCopy, AC_DEFINE(HAVE_ZLIB_COPY, 1, Define if the zlib library has inflateCopy)) AC_CHECK_LIB(z, inflateCopy, AC_DEFINE(HAVE_ZLIB_COPY, 1, Define if the zlib library has inflateCopy))
case $ac_sys_system/$ac_sys_release in
Darwin/*)
CFLAGS="${_CUR_CFLAGS}"
LDFLAGS="${_CUR_LDFLAGS}"
;;
esac
AC_MSG_CHECKING(for hstrerror) AC_MSG_CHECKING(for hstrerror)
AC_TRY_LINK([ AC_TRY_LINK([
#include "confdefs.h" #include "confdefs.h"