Commit 5839e586 authored by Guido van Rossum's avatar Guido van Rossum

Checking in three Darwin-specific patches.

Tony Lownds: [ Patch #101816 ] Fixes shared modules on Mac OS X

    1. Mac OS X is recognized by the Next-ish host recognition code as
    "Darwin/1.2"

    2. When specifying just --with-dyld, modules can compile as shared

    3. --with-dyld and --with-next-framework, modules can compile as
    shared

    4. --with-suffix=.exe, and Lib/plat-darwin1.2 is being made, the regen
    script invokes python as python.exe

    [I had to reformat this patch a bit to make it work.  Please test!]

Dan Wolfe: [ Patch #101823 ] Fix Darwin POSIX Thread redefinition

    The patch below fixes the redefinition problem in Darwin with
    _POSIX_THREADS. I'm not sure if this is the correct long term fix but
    for now it fixes the problem and the fix is specific to Darwin.

Dan Wolfe: [ Patch #101824 ] On Darwin, remove unrecognized option
                             `-OPT:Olimit=0'

  After many, many, many compiles, I finally got itchy of this warning
  cluttering up the output... so I scratched (Darwin configs only) and
  it's gone! :-)
parent 32e20ff8
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -341,7 +341,10 @@ AC_TRY_RUN([int main() { return 0; }], ...@@ -341,7 +341,10 @@ AC_TRY_RUN([int main() { return 0; }],
CC="$ac_save_cc"]) CC="$ac_save_cc"])
AC_MSG_RESULT($ac_cv_opt_olimit_ok) AC_MSG_RESULT($ac_cv_opt_olimit_ok)
if test $ac_cv_opt_olimit_ok = yes; then if test $ac_cv_opt_olimit_ok = yes; then
OPT="$OPT -OPT:Olimit=0" case $ac_sys_system in
Darwin*) OPT="$OPT" ;;
*) OPT="$OPT -OPT:Olimit=0";;
esac
else else
AC_MSG_CHECKING(whether $CC accepts -Olimit 1500) AC_MSG_CHECKING(whether $CC accepts -Olimit 1500)
AC_CACHE_VAL(ac_cv_olimit_ok, AC_CACHE_VAL(ac_cv_olimit_ok,
...@@ -493,6 +496,9 @@ fi ...@@ -493,6 +496,9 @@ fi
# Minor variations in building a framework between NextStep versions 4 and 5 # Minor variations in building a framework between NextStep versions 4 and 5
AC_SUBST(LIBTOOL_CRUFT) AC_SUBST(LIBTOOL_CRUFT)
case $ac_sys_system/$ac_sys_release in case $ac_sys_system/$ac_sys_release in
Darwin/*)
ns_undef_sym='_environ'
LIBTOOL_CRUFT="-lcc_dynamic -arch_only ppc -U $ns_undef_sym" ;;
next/4*) next/4*)
ns_undef_sym='__environ' ns_undef_sym='__environ'
LIBTOOL_CRUFT="-U $ns_undef_sym" ;; LIBTOOL_CRUFT="-U $ns_undef_sym" ;;
...@@ -568,7 +574,11 @@ then ...@@ -568,7 +574,11 @@ then
DYNIX/ptx*) LDSHARED="ld -G";; DYNIX/ptx*) LDSHARED="ld -G";;
Darwin/*|next/*) Darwin/*|next/*)
if test "$ns_dyld" if test "$ns_dyld"
then LDSHARED='$(CC) $(LDFLAGS) -bundle -prebind' then
if test "$ac_sys_system" = Darwin
then LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined suppress'
else LDSHARED='$(CC) $(LDFLAGS) -bundle -prebind'
fi
else LDSHARED='$(CC) $(CFLAGS) -nostdlib -r'; else LDSHARED='$(CC) $(CFLAGS) -nostdlib -r';
fi fi
if test "$with_next_framework" ; then if test "$with_next_framework" ; then
...@@ -639,6 +649,7 @@ then ...@@ -639,6 +649,7 @@ then
# crt1.o) gets erroneously defined as common, which breaks dynamic # crt1.o) gets erroneously defined as common, which breaks dynamic
# loading of any modules which reference it in System.framework # loading of any modules which reference it in System.framework
next/4*|next/5*) LINKFORSHARED="-u __dummy -framework System" ;; next/4*|next/5*) LINKFORSHARED="-u __dummy -framework System" ;;
Darwin/*) LINKFORSHARED="-framework System" ;;
SCO_SV*) LINKFORSHARED="-Bdynamic -dy -Wl,-Bexport";; SCO_SV*) LINKFORSHARED="-Bdynamic -dy -Wl,-Bexport";;
ReliantUNIX*) LINKFORSHARED="-W1 -Blargedynsym";; ReliantUNIX*) LINKFORSHARED="-W1 -Blargedynsym";;
FreeBSD*|NetBSD*) FreeBSD*|NetBSD*)
...@@ -761,7 +772,10 @@ else ...@@ -761,7 +772,10 @@ else
LIBS="-lpthread $LIBS" LIBS="-lpthread $LIBS"
LIBOBJS="$LIBOBJS thread.o"],[ LIBOBJS="$LIBOBJS thread.o"],[
AC_CHECK_FUNC(pthread_detach, [AC_DEFINE(WITH_THREAD) AC_CHECK_FUNC(pthread_detach, [AC_DEFINE(WITH_THREAD)
AC_DEFINE(_POSIX_THREADS) case $ac_sys_system in
Darwin*) ;;
*) AC_DEFINE(_POSIX_THREADS);;
esac
LIBOBJS="$LIBOBJS thread.o"],[ LIBOBJS="$LIBOBJS thread.o"],[
AC_CHECK_HEADER(kernel/OS.h, [AC_DEFINE(WITH_THREAD) AC_CHECK_HEADER(kernel/OS.h, [AC_DEFINE(WITH_THREAD)
AC_DEFINE(BEOS_THREADS) AC_DEFINE(BEOS_THREADS)
...@@ -911,7 +925,7 @@ then ...@@ -911,7 +925,7 @@ then
AIX*) DYNLOADFILE="dynload_aix.o";; AIX*) DYNLOADFILE="dynload_aix.o";;
BeOS*) DYNLOADFILE="dynload_beos.o";; BeOS*) DYNLOADFILE="dynload_beos.o";;
hp*|HP*) DYNLOADFILE="dynload_hpux.o";; hp*|HP*) DYNLOADFILE="dynload_hpux.o";;
next/*) DYNLOADFILE="dynload_next.o";; Darwin/*|next/*) DYNLOADFILE="dynload_next.o";;
*) *)
# use dynload_shlib.c and dlopen() if we have it; otherwise stub # use dynload_shlib.c and dlopen() if we have it; otherwise stub
# out any dynamic loading # out any dynamic loading
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment