elif sys.platform == 'darwin':
# Don't use the default code below
return ext.libraries
+ elif sys.platform[:3] == 'aix':
+ # Don't use the default code below
+ return ext.libraries
else:
from distutils import sysconfig
if sysconfig.get_config_var('Py_ENABLE_SHARED'):
libpython$(VERSION).so: $(LIBRARY_OBJS)
if test $(INSTSONAME) != $(LDLIBRARY); then \
- $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
+ $(BLDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
$(LN) -f $(INSTSONAME) $@; \
else \
- $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
+ $(BLDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
fi
libpython$(VERSION).dylib: $(LIBRARY_OBJS)
distclean: clobber
-rm -f core Makefile Makefile.pre config.status \
Modules/Setup Modules/Setup.local Modules/Setup.config \
- Misc/python.pc
+ Modules/ld_so_aix Misc/python.pc
find $(srcdir) '(' -name '*.fdc' -o -name '*~' \
-o -name '[@,#]*' -o -name '*.old' \
-o -name '*.orig' -o -name '*.rej' \
Build
-----
+- Issue #941346: Improve the build process under AIX and allow Python to
+ be built as a shared library. Patch by Sébastien Sablé.
+
- Issue #4026: Make the fcntl extension build under AIX. Patch by Sébastien
Sablé.
shift
done
+if test "$objfile" = "libpython@VERSION@.so"; then
+ ldsocoremode="true"
+fi
if test -z "$objs"; then
echo "ld_so_aix: No input files; exiting."
exit 2
-elif test ! -r "$impfile"; then
+elif test ! -r "$impfile" -a -z "$ldsocoremode"; then
echo "ld_so_aix: Import file '$impfile' not found or not readable; exiting."
exit 2
fi
# Default entry symbol for Python modules = init[modulename]
# Can be overriden by providing a -e argument.
if test -z "$entry"; then
- entry=init`echo $filename | sed "s/module.*//"`
+ entry=PyInit_`echo $filename | sed "s/module.*//"`
fi
#echo "ld_so_aix: Debug info section"
#echo " -> object files: $objs"
#echo " -> CC arguments: $args"
-CCOPT="-Wl,-e$entry -Wl,-bE:$expfile -Wl,-bI:$impfile -Wl,-bhalt:4"
-CCOPT="$CCOPT -Wl,-bM:SRE -Wl,-T512 -Wl,-H512 -lm -o $objfile"
-# Note: to use dynamic libraries like libtcl8.4.so and libtk8.4.so
-# you may need to replace the second CCOPT line above with the following:
-# CCOPT="$CCOPT -Wl,-bM:SRE -Wl,-T512 -Wl,-H512 -brtl -bnortllib -lm -o $objfile"
+if test -z "$ldsocoremode"; then
+ CCOPT="-Wl,-e$entry -Wl,-bE:$expfile -Wl,-bI:$impfile -Wl,-bhalt:4"
+else
+ CCOPT="-Wl,-bnoentry -Wl,-bE:$expfile -Wl,-bhalt:4"
+fi
+CCOPT="$CCOPT -Wl,-bM:SRE -Wl,-T512 -Wl,-H512 -Wl,-brtl -Wl,-bnortllib -lm -o $objfile"
CCARGS="$args"
#! /bin/sh
-# From configure.in Revision: 84586 .
+# From configure.in Revision: 84675 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.65 for python 3.1.
#
BLDLIBRARY='-L. -lpython$(VERSION)'
RUNSHARED='DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}'
;;
+ AIX*)
+ LDLIBRARY='libpython$(VERSION).so'
+ RUNSHARED=LIBPATH=`pwd`:${LIBPATH}
+ ;;
esac
else # shared is disabled
then
case $ac_sys_system/$ac_sys_release in
AIX*)
- BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:Modules/python.exp"
+ BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:Modules/python.exp -L\$(srcdir)"
LDSHARED="\$(BINLIBDEST)/config/ld_so_aix \$(CC) -bI:\$(BINLIBDEST)/config/python.exp"
;;
IRIX/5*) LDSHARED="ld -shared";;
# generate output files
ac_config_files="$ac_config_files Makefile.pre Modules/Setup.config Misc/python.pc"
+ac_config_files="$ac_config_files Modules/ld_so_aix"
+
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
"Makefile.pre") CONFIG_FILES="$CONFIG_FILES Makefile.pre" ;;
"Modules/Setup.config") CONFIG_FILES="$CONFIG_FILES Modules/Setup.config" ;;
"Misc/python.pc") CONFIG_FILES="$CONFIG_FILES Misc/python.pc" ;;
+ "Modules/ld_so_aix") CONFIG_FILES="$CONFIG_FILES Modules/ld_so_aix" ;;
*) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
esac
+
+ case $ac_file$ac_mode in
+ "Modules/ld_so_aix":F) chmod +x Modules/ld_so_aix ;;
+
+ esac
done # for ac_tag
BLDLIBRARY='-L. -lpython$(VERSION)'
RUNSHARED='DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}'
;;
+ AIX*)
+ LDLIBRARY='libpython$(VERSION).so'
+ RUNSHARED=LIBPATH=`pwd`:${LIBPATH}
+ ;;
esac
else # shared is disabled
then
case $ac_sys_system/$ac_sys_release in
AIX*)
- BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:Modules/python.exp"
+ BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:Modules/python.exp -L\$(srcdir)"
LDSHARED="\$(BINLIBDEST)/config/ld_so_aix \$(CC) -bI:\$(BINLIBDEST)/config/python.exp"
;;
IRIX/5*) LDSHARED="ld -shared";;
# generate output files
AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc)
+AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix])
AC_OUTPUT
echo "creating Modules/Setup"