Issue #1222585: Added LDCXXSHARED for C++ support

This commit is contained in:
Tarek Ziadé 2010-04-03 08:37:59 +00:00
parent dd2fedcd1c
commit 0000295fe3
3 changed files with 53 additions and 15 deletions

View File

@ -107,6 +107,7 @@ LIBP= $(LIBDIR)/python$(VERSION)
SO= @SO@ SO= @SO@
LDSHARED= @LDSHARED@ LDSHARED= @LDSHARED@
BLDSHARED= @BLDSHARED@ BLDSHARED= @BLDSHARED@
LDCXXSHARED= @LDCXXSHARED@
DESTSHARED= $(BINLIBDEST)/lib-dynload DESTSHARED= $(BINLIBDEST)/lib-dynload
# Executable suffix (.exe on Windows and Mac OS X) # Executable suffix (.exe on Windows and Mac OS X)

View File

@ -12,6 +12,8 @@ What's New in Python 2.7 beta 1?
Core and Builtins Core and Builtins
----------------- -----------------
- Issue #1222585: Added LDCXXSHARED for C++ support. Patch by Arfrever.
- Raise a TypeError when trying to delete a T_STRING_INPLACE struct member. - Raise a TypeError when trying to delete a T_STRING_INPLACE struct member.
- Issue #7994: Issue a PendingDeprecationWarning if object.__format__ - Issue #7994: Issue a PendingDeprecationWarning if object.__format__

View File

@ -1719,6 +1719,7 @@ esac
# Set info about shared libraries. # Set info about shared libraries.
AC_SUBST(SO) AC_SUBST(SO)
AC_SUBST(LDSHARED) AC_SUBST(LDSHARED)
AC_SUBST(LDCXXSHARED)
AC_SUBST(BLDSHARED) AC_SUBST(BLDSHARED)
AC_SUBST(CCSHARED) AC_SUBST(CCSHARED)
AC_SUBST(LINKFORSHARED) AC_SUBST(LINKFORSHARED)
@ -1771,36 +1772,47 @@ then
IRIX/5*) LDSHARED="ld -shared";; IRIX/5*) LDSHARED="ld -shared";;
IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";; IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";;
SunOS/5*) SunOS/5*)
if test "$GCC" = "yes" if test "$GCC" = "yes" ; then
then LDSHARED='$(CC) -shared' LDSHARED='$(CC) -shared'
else LDSHARED='$(CC) -G'; LDCXXSHARED='$(CXX) -shared'
else
LDSHARED='$(CC) -G'
LDCXXSHARED='$(CXX) -G'
fi ;; fi ;;
hp*|HP*) hp*|HP*)
if test "$GCC" = "yes" if test "$GCC" = "yes" ; then
then LDSHARED='$(CC) -shared' LDSHARED='$(CC) -shared'
else LDSHARED='ld -b'; LDCXXSHARED='$(CXX) -shared'
else
LDSHARED='ld -b'
fi ;; fi ;;
OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";; OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";;
Darwin/1.3*) Darwin/1.3*)
LDSHARED='$(CC) $(LDFLAGS) -bundle' LDSHARED='$(CC) $(LDFLAGS) -bundle'
LDCXXSHARED='$(CXX) $(LDFLAGS) -bundle'
if test "$enable_framework" ; then if test "$enable_framework" ; then
# Link against the framework. All externals should be defined. # Link against the framework. All externals should be defined.
BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
LDCXXSHARED="$LDCXXSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
else else
# No framework. Ignore undefined symbols, assuming they come from Python # No framework. Ignore undefined symbols, assuming they come from Python
LDSHARED="$LDSHARED -undefined suppress" LDSHARED="$LDSHARED -undefined suppress"
LDCXXSHARED="$LDCXXSHARED -undefined suppress"
fi ;; fi ;;
Darwin/1.4*|Darwin/5.*|Darwin/6.*) Darwin/1.4*|Darwin/5.*|Darwin/6.*)
LDSHARED='$(CC) $(LDFLAGS) -bundle' LDSHARED='$(CC) $(LDFLAGS) -bundle'
LDCXXSHARED='$(CXX) $(LDFLAGS) -bundle'
if test "$enable_framework" ; then if test "$enable_framework" ; then
# Link against the framework. All externals should be defined. # Link against the framework. All externals should be defined.
BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
LDCXXSHARED="$LDCXXSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
else else
# No framework, use the Python app as bundle-loader # No framework, use the Python app as bundle-loader
BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)' BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)'
LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)' LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
LDCXXSHARED="$LDCXXSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
fi ;; fi ;;
Darwin/*) Darwin/*)
# Use -undefined dynamic_lookup whenever possible (10.3 and later). # Use -undefined dynamic_lookup whenever possible (10.3 and later).
@ -1812,26 +1824,35 @@ then
LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}" LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
fi fi
LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup' LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup'
LDCXXSHARED='$(CXX) $(LDFLAGS) -bundle -undefined dynamic_lookup'
BLDSHARED="$LDSHARED" BLDSHARED="$LDSHARED"
else else
LDSHARED='$(CC) $(LDFLAGS) -bundle' LDSHARED='$(CC) $(LDFLAGS) -bundle'
LDCXXSHARED='$(CXX) $(LDFLAGS) -bundle'
if test "$enable_framework" ; then if test "$enable_framework" ; then
# Link against the framework. All externals should be defined. # Link against the framework. All externals should be defined.
BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
LDCXXSHARED="$LDCXXSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
else else
# No framework, use the Python app as bundle-loader # No framework, use the Python app as bundle-loader
BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)' BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)'
LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)' LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
LDCXXSHARED="$LDCXXSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
fi fi
fi fi
;; ;;
Linux*|GNU*|QNX*) LDSHARED='$(CC) -shared';; Linux*|GNU*|QNX*)
BSD/OS*/4*) LDSHARED="gcc -shared";; LDSHARED='$(CC) -shared'
LDCXXSHARED='$(CXX) -shared';;
BSD/OS*/4*)
LDSHARED="gcc -shared"
LDCXXSHARED="g++ -shared";;
FreeBSD*) FreeBSD*)
if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]] if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
then then
LDSHARED='$(CC) -shared ${LDFLAGS}' LDSHARED='$(CC) -shared ${LDFLAGS}'
LDCXXSHARED='$(CXX) -shared ${LDFLAGS}'
else else
LDSHARED="ld -Bshareable ${LDFLAGS}" LDSHARED="ld -Bshareable ${LDFLAGS}"
fi;; fi;;
@ -1839,6 +1860,7 @@ then
if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]] if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
then then
LDSHARED='$(CC) -shared $(CCSHARED) ${LDFLAGS}' LDSHARED='$(CC) -shared $(CCSHARED) ${LDFLAGS}'
LDCXXSHARED='$(CXX) -shared $(CCSHARED) ${LDFLAGS}'
else else
case `uname -r` in case `uname -r` in
[[01]].* | 2.[[0-7]] | 2.[[0-7]].*) [[01]].* | 2.[[0-7]] | 2.[[0-7]].*)
@ -1846,22 +1868,35 @@ then
;; ;;
*) *)
LDSHARED='$(CC) -shared $(CCSHARED) ${LDFLAGS}' LDSHARED='$(CC) -shared $(CCSHARED) ${LDFLAGS}'
LDCXXSHARED='$(CXX) -shared $(CCSHARED) ${LDFLAGS}'
;; ;;
esac esac
fi;; fi;;
NetBSD*|DragonFly*) LDSHARED="cc -shared ${LDFLAGS}";; NetBSD*|DragonFly*)
LDSHARED="cc -shared ${LDFLAGS}"
LDCXXSHARED="c++ -shared ${LDFLAGS}";;
OpenUNIX*|UnixWare*) OpenUNIX*|UnixWare*)
if test "$GCC" = "yes" if test "$GCC" = "yes" ; then
then LDSHARED='$(CC) -shared' LDSHARED='$(CC) -shared'
else LDSHARED='$(CC) -G' LDCXXSHARED='$(CXX) -shared'
else
LDSHARED='$(CC) -G'
LDCXXSHARED='$(CXX) -G'
fi;; fi;;
SCO_SV*) LDSHARED='$(CC) -Wl,-G,-Bexport';; SCO_SV*)
CYGWIN*) LDSHARED="gcc -shared -Wl,--enable-auto-image-base";; LDSHARED='$(CC) -Wl,-G,-Bexport'
atheos*) LDSHARED="gcc -shared";; LDCXXSHARED='$(CXX) -Wl,-G,-Bexport';;
CYGWIN*)
LDSHARED="gcc -shared -Wl,--enable-auto-image-base"
LDCXXSHARED="g++ -shared -Wl,--enable-auto-image-base";;
atheos*)
LDSHARED="gcc -shared"
LDCXXSHARED="g++ -shared";;
*) LDSHARED="ld";; *) LDSHARED="ld";;
esac esac
fi fi
AC_MSG_RESULT($LDSHARED) AC_MSG_RESULT($LDSHARED)
LDCXXSHARED=${LDCXXSHARED-$LDSHARED}
BLDSHARED=${BLDSHARED-$LDSHARED} BLDSHARED=${BLDSHARED-$LDSHARED}
# CCSHARED are the C *flags* used to create objects to go into a shared # CCSHARED are the C *flags* used to create objects to go into a shared
# library (module) -- this is only needed for a few systems # library (module) -- this is only needed for a few systems