- Issue #7658: Ensure that the new pythonw executable works on OSX 10.4

- Issue #7714: Use ``gcc -dumpversion`` to detect the version of GCC on
  MacOSX.

- Make configure look for util.h as well as libutil.h. The former
  is the header file that on OSX contains the defition of openpty.

  (Needed to compile for OSX 10.4 on OSX 10.6)

- Use the correct definition of CC to compile the pythonw executable
This commit is contained in:
Ronald Oussoren 2010-01-17 16:25:57 +00:00
parent 60ba2c8bf8
commit a55af9a9db
8 changed files with 250 additions and 110 deletions

View file

@ -627,7 +627,7 @@ extern char * _getpty(int *, int, mode_t, int);
#endif #endif
#if defined(HAVE_OPENPTY) || defined(HAVE_FORKPTY) #if defined(HAVE_OPENPTY) || defined(HAVE_FORKPTY)
#if !defined(HAVE_PTY_H) && !defined(HAVE_LIBUTIL_H) #if !defined(HAVE_PTY_H) && !defined(HAVE_LIBUTIL_H) && !defined(HAVE_UTIL_H)
/* BSDI does not supply a prototype for the 'openpty' and 'forkpty' /* BSDI does not supply a prototype for the 'openpty' and 'forkpty'
functions, even though they are included in libutil. */ functions, even though they are included in libutil. */
#include <termios.h> #include <termios.h>

View file

@ -16,6 +16,7 @@ FRAMEWORKUNIXTOOLSPREFIX=@FRAMEWORKUNIXTOOLSPREFIX@
PYTHONFRAMEWORK=@PYTHONFRAMEWORK@ PYTHONFRAMEWORK=@PYTHONFRAMEWORK@
PYTHONFRAMEWORKIDENTIFIER=@PYTHONFRAMEWORKIDENTIFIER@ PYTHONFRAMEWORKIDENTIFIER=@PYTHONFRAMEWORKIDENTIFIER@
LIPO_32BIT_FLAGS=@LIPO_32BIT_FLAGS@ LIPO_32BIT_FLAGS=@LIPO_32BIT_FLAGS@
CC=@CC@
# These are normally glimpsed from the previous set # These are normally glimpsed from the previous set

View file

@ -6,16 +6,26 @@
* *
* This program uses posix_spawn rather than plain execv because we need * This program uses posix_spawn rather than plain execv because we need
* slightly more control over how the "real" interpreter is executed. * slightly more control over how the "real" interpreter is executed.
*
* On OSX 10.4 (and earlier) this falls back to using exec because the
* posix_spawnv functions aren't available there.
*/ */
#pragma weak_import posix_spawnattr_init
#pragma weak_import posix_spawnattr_setbinpref_np
#pragma weak_import posix_spawnattr_setflags
#pragma weak_import posix_spawn
#include <Python.h>
#include <unistd.h> #include <unistd.h>
#ifdef HAVE_SPAWN_H
#include <spawn.h> #include <spawn.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#include <err.h> #include <err.h>
#include <dlfcn.h> #include <dlfcn.h>
#include <stdlib.h> #include <stdlib.h>
#include <Python.h>
extern char** environ; extern char** environ;
@ -74,6 +84,7 @@ static char* get_python_path(void)
return g_path; return g_path;
} }
#ifdef HAVE_SPAWN_H
static void static void
setup_spawnattr(posix_spawnattr_t* spawnattr) setup_spawnattr(posix_spawnattr_t* spawnattr)
{ {
@ -132,16 +143,28 @@ setup_spawnattr(posix_spawnattr_t* spawnattr)
/* NOTREACHTED */ /* NOTREACHTED */
} }
} }
#endif
int int
main(int argc, char **argv) { main(int argc, char **argv) {
posix_spawnattr_t spawnattr = NULL;
char* exec_path = get_python_path(); char* exec_path = get_python_path();
#ifdef HAVE_SPAWN_H
setup_spawnattr(&spawnattr); /* We're weak-linking to posix-spawnv to ensure that
posix_spawn(NULL, exec_path, NULL, * an executable build on 10.5 can work on 10.4.
&spawnattr, argv, environ); */
err(1, "posix_spawn: %s", argv[0]); if (posix_spawn != NULL) {
posix_spawnattr_t spawnattr = NULL;
setup_spawnattr(&spawnattr);
posix_spawn(NULL, exec_path, NULL,
&spawnattr, argv, environ);
err(1, "posix_spawn: %s", argv[0]);
}
#endif
execve(exec_path, argv, environ);
err(1, "execve: %s", argv[0]);
/* NOTREACHED */ /* NOTREACHED */
} }

View file

@ -66,10 +66,14 @@ Library
Extension extra options may change the output without changing the .c Extension extra options may change the output without changing the .c
file). Initial patch by Collin Winter. file). Initial patch by Collin Winter.
Build Build
----- -----
- Issue #7658: Ensure that the new pythonw executable works on OSX 10.4
- Issue #7714: Use ``gcc -dumpversion`` to detect the version of GCC on
MacOSX.
- Issue #7661: Allow ctypes to be built from a non-ASCII directory path. - Issue #7661: Allow ctypes to be built from a non-ASCII directory path.
Patch by Florent Xicluna. Patch by Florent Xicluna.

View file

@ -3667,6 +3667,10 @@ posix_fork(PyObject *self, PyObject *noargs)
#else #else
#ifdef HAVE_LIBUTIL_H #ifdef HAVE_LIBUTIL_H
#include <libutil.h> #include <libutil.h>
#else
#ifdef HAVE_UTIL_H
#include <util.h>
#endif /* HAVE_UTIL_H */
#endif /* HAVE_LIBUTIL_H */ #endif /* HAVE_LIBUTIL_H */
#endif /* HAVE_PTY_H */ #endif /* HAVE_PTY_H */
#ifdef HAVE_STROPTS_H #ifdef HAVE_STROPTS_H

175
configure vendored
View file

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# From configure.in Revision: 77193 . # From configure.in Revision: 77212 .
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for python 2.7. # Generated by GNU Autoconf 2.61 for python 2.7.
# #
@ -2142,6 +2142,8 @@ _ACEOF
# has no effect, don't bother defining them # has no effect, don't bother defining them
Darwin/[6789].*) Darwin/[6789].*)
define_xopen_source=no;; define_xopen_source=no;;
Darwin/1[0-9].*)
define_xopen_source=no;;
# On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but # On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but
# used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined # used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined
# or has another value. By not (re)defining it, the defaults come in place. # or has another value. By not (re)defining it, the defaults come in place.
@ -3861,7 +3863,7 @@ else
{ echo "$as_me:$LINENO: result: no" >&5 { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; } echo "${ECHO_T}no" >&6; }
fi fi
rm -f conftest* rm -f -r conftest*
@ -4685,48 +4687,21 @@ echo "${ECHO_T}$ac_cv_no_strict_aliasing_ok" >&6; }
Darwin*) Darwin*)
# -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd
# used to be here, but non-Apple gcc doesn't accept them. # used to be here, but non-Apple gcc doesn't accept them.
if test "${CC}" = gcc
then
if test "${enable_universalsdk}"; then { echo "$as_me:$LINENO: checking which compiler should be used" >&5
UNIVERSAL_ARCH_FLAGS="" echo $ECHO_N "checking which compiler should be used... $ECHO_C" >&6; }
if test "$UNIVERSAL_ARCHS" = "32-bit" ; then case "${UNIVERSALSDK}" in
UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386" */MacOSX10.4u.sdk)
ARCH_RUN_32BIT="" # Build using 10.4 SDK, force usage of gcc when the
LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386" # compiler is gcc, otherwise the user will get very
# confusing error messages when building on OSX 10.6
elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then CC=gcc-4.0
UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64" CPP=cpp-4.0
LIPO_32BIT_FLAGS="" ;;
ARCH_RUN_32BIT="true" esac
{ echo "$as_me:$LINENO: result: $CC" >&5
elif test "$UNIVERSAL_ARCHS" = "all" ; then echo "${ECHO_T}$CC" >&6; }
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
ARCH_RUN_32BIT="arch -i386 -ppc"
elif test "$UNIVERSAL_ARCHS" = "intel" ; then
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64"
LIPO_32BIT_FLAGS="-extract i386"
ARCH_RUN_32BIT="arch -i386"
elif test "$UNIVERSAL_ARCHS" = "3-way" ; then
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64"
LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
ARCH_RUN_32BIT="arch -i386 -ppc7400"
else
{ { echo "$as_me:$LINENO: error: proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way" >&5
echo "$as_me: error: proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way" >&2;}
{ (exit 1); exit 1; }; }
fi
BASECFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${BASECFLAGS}"
tgt=`sw_vers -productVersion | sed 's/\(10\.[0-9]*\).*/\1/'`
if test "${UNIVERSALSDK}" != "/" -a "${tgt}" '>' '10.4' ; then
CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}"
fi
fi fi
# Calculate the right deployment target for this build. # Calculate the right deployment target for this build.
@ -4770,6 +4745,84 @@ echo "$as_me: error: proper usage is --with-universal-arch=32-bit|64-bit|all|int
export MACOSX_DEPLOYMENT_TARGET export MACOSX_DEPLOYMENT_TARGET
EXPORT_MACOSX_DEPLOYMENT_TARGET='' EXPORT_MACOSX_DEPLOYMENT_TARGET=''
if test "${enable_universalsdk}"; then
UNIVERSAL_ARCH_FLAGS=""
if test "$UNIVERSAL_ARCHS" = "32-bit" ; then
UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
ARCH_RUN_32BIT=""
LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
# You have to use different flags on various versions of
# OSX to extract PPC code from an universal binary, basically
# '-arch ppc' on OSX 10.4 and '-arch ppc7400' on anything
# newer.
# Because '-arch pp7400' works on OSX 10.5 or higher this
# test is only present in the '32-bit' branch, all other
# branches require OSX 10.5 to compile.
{ echo "$as_me:$LINENO: checking lipo flag for extracting ppc code" >&5
echo $ECHO_N "checking lipo flag for extracting ppc code... $ECHO_C" >&6; }
FN="test.$$"
cat >${FN}.c <<-EOF
int main() { return 0; }
EOF
${CC} ${CFLAGS} -arch ppc -arch i386 -o ${FN} ${FN}.c -isysroot ${UNIVERSALSDK}
if test $? != 0 ; then
rm ${FN} ${FN}.c
{ echo "$as_me:$LINENO: result: failed, assumee -extract ppc7400" >&5
echo "${ECHO_T}failed, assumee -extract ppc7400" >&6; }
else
lipo -extract -output "${FN}.out" -arch ppc7400 "${FN}" 2>/dev/null
if test $? != 0 ; then
LIPO_32BIT_FLAGS="-extract ppc -extract i386"
{ echo "$as_me:$LINENO: result: \"'-extract ppc'\"" >&5
echo "${ECHO_T}\"'-extract ppc'\"" >&6; }
else
{ echo "$as_me:$LINENO: result: \"'-extract ppc7400'\"" >&5
echo "${ECHO_T}\"'-extract ppc7400'\"" >&6; }
fi
rm -f ${FN} ${FN}.c ${FN}.out
fi
elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then
UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
LIPO_32BIT_FLAGS=""
ARCH_RUN_32BIT="true"
elif test "$UNIVERSAL_ARCHS" = "all" ; then
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
ARCH_RUN_32BIT="arch -i386 -ppc"
elif test "$UNIVERSAL_ARCHS" = "intel" ; then
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64"
LIPO_32BIT_FLAGS="-extract i386"
ARCH_RUN_32BIT="arch -i386"
elif test "$UNIVERSAL_ARCHS" = "3-way" ; then
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64"
LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
ARCH_RUN_32BIT="arch -i386 -ppc7400"
else
{ { echo "$as_me:$LINENO: error: proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way" >&5
echo "$as_me: error: proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way" >&2;}
{ (exit 1); exit 1; }; }
fi
BASECFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${BASECFLAGS}"
tgt=`sw_vers -productVersion | sed 's/\(10\.[0-9]*\).*/\1/'`
if test "${UNIVERSALSDK}" != "/" -a "${tgt}" '>' '10.4' ; then
CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}"
CPPFLAGS="-isysroot ${UNIVERSALSDK}"
fi
fi
;; ;;
OSF*) OSF*)
BASECFLAGS="$BASECFLAGS -mieee" BASECFLAGS="$BASECFLAGS -mieee"
@ -5414,7 +5467,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
else else
ac_cv_header_stdc=no ac_cv_header_stdc=no
fi fi
rm -f conftest* rm -f -r conftest*
fi fi
@ -5435,7 +5488,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
else else
ac_cv_header_stdc=no ac_cv_header_stdc=no
fi fi
rm -f conftest* rm -f -r conftest*
fi fi
@ -5640,6 +5693,8 @@ done
@ -5654,7 +5709,7 @@ sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \
sys/termio.h sys/time.h \ sys/termio.h sys/time.h \
sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \ sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \ sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
bluetooth/bluetooth.h linux/tipc.h bluetooth/bluetooth.h linux/tipc.h spawn.h util.h
do do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
@ -6533,7 +6588,7 @@ _ACEOF
fi fi
rm -f conftest* rm -f -r conftest*
{ echo "$as_me:$LINENO: result: $was_it_defined" >&5 { echo "$as_me:$LINENO: result: $was_it_defined" >&5
echo "${ECHO_T}$was_it_defined" >&6; } echo "${ECHO_T}$was_it_defined" >&6; }
@ -7063,7 +7118,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
else else
ac_cv_type_uid_t=no ac_cv_type_uid_t=no
fi fi
rm -f conftest* rm -f -r conftest*
fi fi
{ echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 { echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5
@ -14508,7 +14563,7 @@ case $ac_sys_system/$ac_sys_release in
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';; LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
Darwin/*) Darwin/*)
gcc_version=`gcc -v 2>&1 | grep version | cut -d\ -f3` gcc_version=`gcc -dumpversion`
if test ${gcc_version} '<' 4.0 if test ${gcc_version} '<' 4.0
then then
LIBTOOL_CRUFT="-lcc_dynamic" LIBTOOL_CRUFT="-lcc_dynamic"
@ -15850,7 +15905,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
else else
unistd_defines_pthreads=no unistd_defines_pthreads=no
fi fi
rm -f conftest* rm -f -r conftest*
{ echo "$as_me:$LINENO: result: $unistd_defines_pthreads" >&5 { echo "$as_me:$LINENO: result: $unistd_defines_pthreads" >&5
echo "${ECHO_T}$unistd_defines_pthreads" >&6; } echo "${ECHO_T}$unistd_defines_pthreads" >&6; }
@ -17464,7 +17519,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "yes" >/dev/null 2>&1; then $EGREP "yes" >/dev/null 2>&1; then
ipv6type=$i ipv6type=$i
fi fi
rm -f conftest* rm -f -r conftest*
;; ;;
kame) kame)
@ -17487,7 +17542,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
ipv6libdir=/usr/local/v6/lib ipv6libdir=/usr/local/v6/lib
ipv6trylibc=yes ipv6trylibc=yes
fi fi
rm -f conftest* rm -f -r conftest*
;; ;;
linux-glibc) linux-glibc)
@ -17508,7 +17563,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
ipv6type=$i; ipv6type=$i;
ipv6trylibc=yes ipv6trylibc=yes
fi fi
rm -f conftest* rm -f -r conftest*
;; ;;
linux-inet6) linux-inet6)
@ -17546,7 +17601,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
ipv6lib=inet6; ipv6lib=inet6;
ipv6libdir=/usr/local/v6/lib ipv6libdir=/usr/local/v6/lib
fi fi
rm -f conftest* rm -f -r conftest*
;; ;;
v6d) v6d)
@ -17569,7 +17624,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
ipv6libdir=/usr/local/v6/lib; ipv6libdir=/usr/local/v6/lib;
BASECFLAGS="-I/usr/local/v6/include $BASECFLAGS" BASECFLAGS="-I/usr/local/v6/include $BASECFLAGS"
fi fi
rm -f conftest* rm -f -r conftest*
;; ;;
zeta) zeta)
@ -17591,7 +17646,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
ipv6lib=inet6; ipv6lib=inet6;
ipv6libdir=/usr/local/v6/lib ipv6libdir=/usr/local/v6/lib
fi fi
rm -f conftest* rm -f -r conftest*
;; ;;
esac esac
@ -26134,7 +26189,7 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF _ACEOF
fi fi
rm -f conftest* rm -f -r conftest*
cat >conftest.$ac_ext <<_ACEOF cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */ /* confdefs.h. */
@ -26153,7 +26208,7 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF _ACEOF
fi fi
rm -f conftest* rm -f -r conftest*
fi fi
@ -26423,7 +26478,7 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF _ACEOF
fi fi
rm -f conftest* rm -f -r conftest*
fi fi

View file

@ -307,6 +307,8 @@ case $ac_sys_system/$ac_sys_release in
# has no effect, don't bother defining them # has no effect, don't bother defining them
Darwin/@<:@6789@:>@.*) Darwin/@<:@6789@:>@.*)
define_xopen_source=no;; define_xopen_source=no;;
Darwin/1@<:@0-9@:>@.*)
define_xopen_source=no;;
# On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but # On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but
# used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined # used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined
# or has another value. By not (re)defining it, the defaults come in place. # or has another value. By not (re)defining it, the defaults come in place.
@ -935,46 +937,19 @@ yes)
Darwin*) Darwin*)
# -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd
# used to be here, but non-Apple gcc doesn't accept them. # used to be here, but non-Apple gcc doesn't accept them.
if test "${CC}" = gcc
then
if test "${enable_universalsdk}"; then AC_MSG_CHECKING(which compiler should be used)
UNIVERSAL_ARCH_FLAGS="" case "${UNIVERSALSDK}" in
if test "$UNIVERSAL_ARCHS" = "32-bit" ; then */MacOSX10.4u.sdk)
UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386" # Build using 10.4 SDK, force usage of gcc when the
ARCH_RUN_32BIT="" # compiler is gcc, otherwise the user will get very
LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386" # confusing error messages when building on OSX 10.6
CC=gcc-4.0
elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then CPP=cpp-4.0
UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64" ;;
LIPO_32BIT_FLAGS="" esac
ARCH_RUN_32BIT="true" AC_MSG_RESULT($CC)
elif test "$UNIVERSAL_ARCHS" = "all" ; then
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
ARCH_RUN_32BIT="arch -i386 -ppc"
elif test "$UNIVERSAL_ARCHS" = "intel" ; then
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64"
LIPO_32BIT_FLAGS="-extract i386"
ARCH_RUN_32BIT="arch -i386"
elif test "$UNIVERSAL_ARCHS" = "3-way" ; then
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64"
LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
ARCH_RUN_32BIT="arch -i386 -ppc7400"
else
AC_MSG_ERROR([proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way])
fi
BASECFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${BASECFLAGS}"
tgt=`sw_vers -productVersion | sed 's/\(10\.[[0-9]]*\).*/\1/'`
if test "${UNIVERSALSDK}" != "/" -a "${tgt}" '>' '10.4' ; then
CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}"
fi
fi fi
# Calculate the right deployment target for this build. # Calculate the right deployment target for this build.
@ -1018,6 +993,78 @@ yes)
export MACOSX_DEPLOYMENT_TARGET export MACOSX_DEPLOYMENT_TARGET
EXPORT_MACOSX_DEPLOYMENT_TARGET='' EXPORT_MACOSX_DEPLOYMENT_TARGET=''
if test "${enable_universalsdk}"; then
UNIVERSAL_ARCH_FLAGS=""
if test "$UNIVERSAL_ARCHS" = "32-bit" ; then
UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
ARCH_RUN_32BIT=""
LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
# You have to use different flags on various versions of
# OSX to extract PPC code from an universal binary, basically
# '-arch ppc' on OSX 10.4 and '-arch ppc7400' on anything
# newer.
# Because '-arch pp7400' works on OSX 10.5 or higher this
# test is only present in the '32-bit' branch, all other
# branches require OSX 10.5 to compile.
AC_MSG_CHECKING(lipo flag for extracting ppc code)
FN="test.$$"
cat >${FN}.c <<-EOF
int main() { return 0; }
EOF
${CC} ${CFLAGS} -arch ppc -arch i386 -o ${FN} ${FN}.c -isysroot ${UNIVERSALSDK}
if test $? != 0 ; then
rm ${FN} ${FN}.c
AC_MSG_RESULT([failed, assumee -extract ppc7400])
else
lipo -extract -output "${FN}.out" -arch ppc7400 "${FN}" 2>/dev/null
if test $? != 0 ; then
LIPO_32BIT_FLAGS="-extract ppc -extract i386"
AC_MSG_RESULT("'-extract ppc'")
else
AC_MSG_RESULT("'-extract ppc7400'")
fi
rm -f ${FN} ${FN}.c ${FN}.out
fi
elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then
UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
LIPO_32BIT_FLAGS=""
ARCH_RUN_32BIT="true"
elif test "$UNIVERSAL_ARCHS" = "all" ; then
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
ARCH_RUN_32BIT="arch -i386 -ppc"
elif test "$UNIVERSAL_ARCHS" = "intel" ; then
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64"
LIPO_32BIT_FLAGS="-extract i386"
ARCH_RUN_32BIT="arch -i386"
elif test "$UNIVERSAL_ARCHS" = "3-way" ; then
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64"
LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
ARCH_RUN_32BIT="arch -i386 -ppc7400"
else
AC_MSG_ERROR([proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way])
fi
BASECFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${BASECFLAGS}"
tgt=`sw_vers -productVersion | sed 's/\(10\.[[0-9]]*\).*/\1/'`
if test "${UNIVERSALSDK}" != "/" -a "${tgt}" '>' '10.4' ; then
CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}"
CPPFLAGS="-isysroot ${UNIVERSALSDK}"
fi
fi
;; ;;
OSF*) OSF*)
BASECFLAGS="$BASECFLAGS -mieee" BASECFLAGS="$BASECFLAGS -mieee"
@ -1297,7 +1344,7 @@ sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \
sys/termio.h sys/time.h \ sys/termio.h sys/time.h \
sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \ sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \ sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
bluetooth/bluetooth.h linux/tipc.h) bluetooth/bluetooth.h linux/tipc.h spawn.h util.h)
AC_HEADER_DIRENT AC_HEADER_DIRENT
AC_HEADER_MAJOR AC_HEADER_MAJOR
@ -1557,7 +1604,7 @@ case $ac_sys_system/$ac_sys_release in
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';; LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
Darwin/*) Darwin/*)
gcc_version=`gcc -v 2>&1 | grep version | cut -d\ -f3` gcc_version=`gcc -dumpversion`
if test ${gcc_version} '<' 4.0 if test ${gcc_version} '<' 4.0
then then
LIBTOOL_CRUFT="-lcc_dynamic" LIBTOOL_CRUFT="-lcc_dynamic"

View file

@ -634,6 +634,9 @@
/* Define if you have the 'socketpair' function. */ /* Define if you have the 'socketpair' function. */
#undef HAVE_SOCKETPAIR #undef HAVE_SOCKETPAIR
/* Define to 1 if you have the <spawn.h> header file. */
#undef HAVE_SPAWN_H
/* Define if your compiler provides ssize_t */ /* Define if your compiler provides ssize_t */
#undef HAVE_SSIZE_T #undef HAVE_SSIZE_T
@ -849,6 +852,9 @@
Include/unicodeobject.h). */ Include/unicodeobject.h). */
#undef HAVE_USABLE_WCHAR_T #undef HAVE_USABLE_WCHAR_T
/* Define to 1 if you have the <util.h> header file. */
#undef HAVE_UTIL_H
/* Define to 1 if you have the `utimes' function. */ /* Define to 1 if you have the `utimes' function. */
#undef HAVE_UTIMES #undef HAVE_UTIMES