]> granicus.if.org Git - python/commitdiff
This patch solves the problem Skip was seeing with zlib, this patch ensures that
authorRonald Oussoren <ronaldoussoren@mac.com>
Thu, 6 Jul 2006 10:13:35 +0000 (10:13 +0000)
committerRonald Oussoren <ronaldoussoren@mac.com>
Thu, 6 Jul 2006 10:13:35 +0000 (10:13 +0000)
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.

configure
configure.in

index 7098f5f5ec43b4e6b2d121c1c66fc229461b2c2c..f7f99eb041288f76c35d333e4b5ffb1a539a2b29 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: .
+# From configure.in Revision: 47023 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.59 for python 2.5.
 #
@@ -722,13 +722,13 @@ echo X"$0" |
          /^X\(\/\).*/{ s//\1/; q; }
          s/.*/./; q'`
   srcdir=$ac_confdir
-  if test ! -r "$srcdir/$ac_unique_file"; then
+  if test ! -r $srcdir/$ac_unique_file; then
     srcdir=..
   fi
 else
   ac_srcdir_defaulted=no
 fi
-if test ! -r "$srcdir/$ac_unique_file"; then
+if test ! -r $srcdir/$ac_unique_file; then
   if test "$ac_srcdir_defaulted" = yes; then
     { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
    { (exit 1); exit 1; }; }
@@ -737,7 +737,7 @@ if test ! -r "$srcdir/$ac_unique_file"; then
    { (exit 1); exit 1; }; }
   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
    { (exit 1); exit 1; }; }
 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
 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 $ECHO_N "checking for inflateCopy in -lz... $ECHO_C" >&6
 if test "${ac_cv_lib_z_inflateCopy+set}" = set; then
@@ -15053,6 +15062,13 @@ _ACEOF
 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 $ECHO_N "checking for hstrerror... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
index 9ab576d3d58714952da3c4f3d7abd6cfb48ebead..29242cf246dd1a541a5f8d53981d0fe7ec6e4765 100644 (file)
@@ -2352,8 +2352,34 @@ AC_CHECK_LIB(c, inet_aton, [$ac_cv_prog_TRUE],
 )
 
 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))
 
+case $ac_sys_system/$ac_sys_release in
+Darwin/*) 
+       CFLAGS="${_CUR_CFLAGS}"
+       LDFLAGS="${_CUR_LDFLAGS}"
+       ;;
+esac
+
 AC_MSG_CHECKING(for hstrerror)
 AC_TRY_LINK([
 #include "confdefs.h"