changeset: 86985:b1e83805bc2d user: Michael Haubenwallner date: Thu Nov 07 16:32:54 2013 +0100 files: Makefile.pre.in configure.ac description: Fix parallel build on AIX with Modules/python.exp * Modules/python.exp becomes a separate make-target * EXPORTSYMS configure variable holds its name on AIX, empty otherways * LINKCC does not create it itself any more * any make-target using $(LINKFORSHARED) must depend on $(EXPORTSYMS) * Dropping support for AIX 4.1 and earlier. diff --git a/Makefile.pre.in b/Makefile.pre.in --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -131,6 +131,8 @@ BLDSHARED= @BLDSHARED@ $(PY_LDFLAGS) LDCXXSHARED= @LDCXXSHARED@ DESTSHARED= $(BINLIBDEST)/lib-dynload +# list of exported symbols for AIX +EXPORTSYMS= @EXPORTSYMS@ # Executable suffix (.exe on Windows and Mac OS X) EXE= @EXEEXT@ @@ -517,7 +519,7 @@ $(MAKE) coverage-lcov # Build the interpreter -$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) +$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) $(EXPORTSYMS) $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) platform: $(BUILDPYTHON) pybuilddir.txt @@ -572,6 +574,10 @@ libpython$(VERSION).sl: $(LIBRARY_OBJS) $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST) +# list of exported symbols for AIX +Modules/python.exp: $(LIBRARY) + $(srcdir)/Modules/makexp_aix $@ . $? + # Copy up the gdb python hooks into a position where they can be automatically # loaded by gdb during Lib/test/test_gdb.py # @@ -643,7 +649,7 @@ echo "-----------------------------------------------"; \ fi -Modules/_testembed: Modules/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) +Modules/_testembed: Modules/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) $(EXPORTSYMS) $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) ############################################################################ diff --git a/configure.ac b/configure.ac --- a/configure.ac +++ b/configure.ac @@ -816,21 +816,12 @@ # 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 -# linking. AC_SUBST(LINKCC) AC_MSG_CHECKING(LINKCC) if test -z "$LINKCC" then LINKCC='$(PURIFY) $(MAINCC)' case $ac_sys_system in - AIX*) - exp_extra="\"\"" - if test $ac_sys_release -ge 5 -o \ - $ac_sys_release -eq 4 -a `uname -r` -ge 2 ; then - exp_extra="." - fi - LINKCC="\$(srcdir)/Modules/makexp_aix Modules/python.exp $exp_extra \$(LIBRARY); $LINKCC";; QNX*) # qcc must be used because the other compilers do not # support -N. @@ -839,6 +830,20 @@ fi AC_MSG_RESULT($LINKCC) +# EXPORTSYMS holds the list of exported symbols for AIX. +AC_SUBST(EXPORTSYMS) +AC_MSG_CHECKING(EXPORTSYMS) +case $ac_sys_system in +AIX*) + if test -z "$EXPORTSYMS"; then + EXPORTSYMS="Modules/python.exp" + fi + ;; +*) + EXPORTSYMS= ;; +esac +AC_MSG_RESULT($EXPORTSYMS) + # GNULD is set to "yes" if the GNU linker is used. If this goes wrong # make sure we default having it set to "no": this is used by # distutils.unixccompiler to know if it should add --enable-new-dtags @@ -2106,6 +2111,7 @@ AC_MSG_RESULT($CCSHARED) # LINKFORSHARED are the flags passed to the $(CC) command that links # the python executable -- this is only needed for a few systems +# Make-targets using $(LINKFORSHARED) need to depend on $(EXPORTSYMS) for AIX. AC_MSG_CHECKING(LINKFORSHARED) if test -z "$LINKFORSHARED" then