mirror of https://github.com/python/cpython
Use CXX in LINKCC if CXX is used to build main() and the system requires
to link a C++ main using the C++ compiler. Fixes #472007.
This commit is contained in:
parent
316141b333
commit
b7da67a873
24
configure.in
24
configure.in
|
@ -254,20 +254,36 @@ DLLLIBRARY=''
|
||||||
LDLIBRARYDIR=''
|
LDLIBRARYDIR=''
|
||||||
|
|
||||||
# LINKCC is the command that links the python executable -- default is $(CC).
|
# LINKCC is the command that links the python executable -- default is $(CC).
|
||||||
|
# If CXX is set, and if it is needed to link a main function that was
|
||||||
|
# compiled with CXX, LINKCC is CXX instead. Always using CXX is undesirable:
|
||||||
|
# python might then depend on the C++ runtime
|
||||||
# This is altered for AIX in order to build the export list before
|
# This is altered for AIX in order to build the export list before
|
||||||
# linking.
|
# linking.
|
||||||
AC_SUBST(LINKCC)
|
AC_SUBST(LINKCC)
|
||||||
AC_MSG_CHECKING(LINKCC)
|
AC_MSG_CHECKING(LINKCC)
|
||||||
if test -z "$LINKCC"
|
if test -z "$LINKCC"
|
||||||
then
|
then
|
||||||
|
if test -z "$CXX"; then
|
||||||
|
LINKCC="\$(PURIFY) \$(CC)"
|
||||||
|
else
|
||||||
|
echo 'int main(){return 0;}' > conftest.$ac_ext
|
||||||
|
$CXX -c conftest.$ac_ext 2>&5
|
||||||
|
if $CC -o conftest$ac_exeext conftest.$ac_objext 2>&5 \
|
||||||
|
&& test -s conftest$ac_exeext && ./conftest$ac_exeext
|
||||||
|
then
|
||||||
|
LINKCC="\$(PURIFY) \$(CC)"
|
||||||
|
else
|
||||||
|
LINKCC="\$(PURIFY) \$(CXX)"
|
||||||
|
fi
|
||||||
|
rm -fr conftest*
|
||||||
|
fi
|
||||||
case $ac_sys_system in
|
case $ac_sys_system in
|
||||||
AIX*)
|
AIX*)
|
||||||
LINKCC="\$(srcdir)/Modules/makexp_aix Modules/python.exp \"\" \$(LIBRARY); \$(PURIFY) \$(CC)";;
|
LINKCC="\$(srcdir)/Modules/makexp_aix Modules/python.exp \"\" \$(LIBRARY); $(LINKCC)";;
|
||||||
dgux*)
|
dgux*)
|
||||||
LINKCC="LD_RUN_PATH=$libdir \$(PURIFY) \$(CC)";;
|
LINKCC="LD_RUN_PATH=$libdir $(LINKCC)";;
|
||||||
Monterey64*)
|
Monterey64*)
|
||||||
LINKCC="\$(PURIFY) \$(CC) -L/usr/lib/ia64l64";;
|
LINKCC="$(LINKCC) -L/usr/lib/ia64l64";;
|
||||||
*) LINKCC="\$(PURIFY) \$(CC)";;
|
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
AC_MSG_RESULT($LINKCC)
|
AC_MSG_RESULT($LINKCC)
|
||||||
|
|
Loading…
Reference in New Issue