Issue #941346: Improve the build process under AIX and allow Python to
be built as a shared library. Patch by Sébastien Sablé.
This commit is contained in:
parent
dfa9b294fa
commit
8e6b407d6f
|
@ -748,6 +748,9 @@ class build_ext(Command):
|
||||||
elif sys.platform == 'darwin':
|
elif sys.platform == 'darwin':
|
||||||
# Don't use the default code below
|
# Don't use the default code below
|
||||||
return ext.libraries
|
return ext.libraries
|
||||||
|
elif sys.platform[:3] == 'aix':
|
||||||
|
# Don't use the default code below
|
||||||
|
return ext.libraries
|
||||||
else:
|
else:
|
||||||
from distutils import sysconfig
|
from distutils import sysconfig
|
||||||
if sysconfig.get_config_var('Py_ENABLE_SHARED'):
|
if sysconfig.get_config_var('Py_ENABLE_SHARED'):
|
||||||
|
|
|
@ -446,10 +446,10 @@ $(LIBRARY): $(LIBRARY_OBJS)
|
||||||
|
|
||||||
libpython$(VERSION).so: $(LIBRARY_OBJS)
|
libpython$(VERSION).so: $(LIBRARY_OBJS)
|
||||||
if test $(INSTSONAME) != $(LDLIBRARY); then \
|
if test $(INSTSONAME) != $(LDLIBRARY); then \
|
||||||
$(LDSHARED) $(PY_LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
|
$(BLDSHARED) $(PY_LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
|
||||||
$(LN) -f $(INSTSONAME) $@; \
|
$(LN) -f $(INSTSONAME) $@; \
|
||||||
else \
|
else \
|
||||||
$(LDSHARED) $(PY_LDFLAGS) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
|
$(BLDSHARED) $(PY_LDFLAGS) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
libpython$(VERSION).dylib: $(LIBRARY_OBJS)
|
libpython$(VERSION).dylib: $(LIBRARY_OBJS)
|
||||||
|
@ -1220,7 +1220,7 @@ distclean: clobber
|
||||||
done
|
done
|
||||||
-rm -f core Makefile Makefile.pre config.status \
|
-rm -f core Makefile Makefile.pre config.status \
|
||||||
Modules/Setup Modules/Setup.local Modules/Setup.config \
|
Modules/Setup Modules/Setup.local Modules/Setup.config \
|
||||||
Misc/python.pc
|
Modules/ld_so_aix Misc/python.pc
|
||||||
-rm -f python*-gdb.py
|
-rm -f python*-gdb.py
|
||||||
-rm -f pybuilddir.txt
|
-rm -f pybuilddir.txt
|
||||||
find $(srcdir) '(' -name '*.fdc' -o -name '*~' \
|
find $(srcdir) '(' -name '*.fdc' -o -name '*~' \
|
||||||
|
|
|
@ -102,6 +102,9 @@ Tools/Demos
|
||||||
Build
|
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
|
- Issue #4026: Make the fcntl extension build under AIX. Patch by Sébastien
|
||||||
Sablé.
|
Sablé.
|
||||||
|
|
||||||
|
|
|
@ -131,11 +131,14 @@ do
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if test "$objfile" = "libpython@VERSION@.so"; then
|
||||||
|
ldsocoremode="true"
|
||||||
|
fi
|
||||||
|
|
||||||
if test -z "$objs"; then
|
if test -z "$objs"; then
|
||||||
echo "ld_so_aix: No input files; exiting."
|
echo "ld_so_aix: No input files; exiting."
|
||||||
exit 2
|
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."
|
echo "ld_so_aix: Import file '$impfile' not found or not readable; exiting."
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
@ -155,7 +158,7 @@ fi
|
||||||
# Default entry symbol for Python modules = init[modulename]
|
# Default entry symbol for Python modules = init[modulename]
|
||||||
# Can be overriden by providing a -e argument.
|
# Can be overriden by providing a -e argument.
|
||||||
if test -z "$entry"; then
|
if test -z "$entry"; then
|
||||||
entry=init`echo $filename | sed "s/module.*//"`
|
entry=PyInit_`echo $filename | sed "s/module.*//"`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#echo "ld_so_aix: Debug info section"
|
#echo "ld_so_aix: Debug info section"
|
||||||
|
@ -166,11 +169,12 @@ fi
|
||||||
#echo " -> object files: $objs"
|
#echo " -> object files: $objs"
|
||||||
#echo " -> CC arguments: $args"
|
#echo " -> CC arguments: $args"
|
||||||
|
|
||||||
CCOPT="-Wl,-e$entry -Wl,-bE:$expfile -Wl,-bI:$impfile -Wl,-bhalt:4"
|
if test -z "$ldsocoremode"; then
|
||||||
CCOPT="$CCOPT -Wl,-bM:SRE -Wl,-T512 -Wl,-H512 -lm -o $objfile"
|
CCOPT="-Wl,-e$entry -Wl,-bE:$expfile -Wl,-bI:$impfile -Wl,-bhalt:4"
|
||||||
# Note: to use dynamic libraries like libtcl8.4.so and libtk8.4.so
|
else
|
||||||
# you may need to replace the second CCOPT line above with the following:
|
CCOPT="-Wl,-bnoentry -Wl,-bE:$expfile -Wl,-bhalt:4"
|
||||||
# CCOPT="$CCOPT -Wl,-bM:SRE -Wl,-T512 -Wl,-H512 -brtl -bnortllib -lm -o $objfile"
|
fi
|
||||||
|
CCOPT="$CCOPT -Wl,-bM:SRE -Wl,-T512 -Wl,-H512 -Wl,-brtl -Wl,-bnortllib -lm -o $objfile"
|
||||||
|
|
||||||
CCARGS="$args"
|
CCARGS="$args"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# From configure.in Revision: 84584 .
|
# From configure.in Revision: 84674 .
|
||||||
# Guess values for system-dependent variables and create Makefiles.
|
# Guess values for system-dependent variables and create Makefiles.
|
||||||
# Generated by GNU Autoconf 2.65 for python 3.2.
|
# Generated by GNU Autoconf 2.65 for python 3.2.
|
||||||
#
|
#
|
||||||
|
@ -4929,6 +4929,10 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>confdefs.h
|
||||||
BLDLIBRARY='-L. -lpython$(VERSION)'
|
BLDLIBRARY='-L. -lpython$(VERSION)'
|
||||||
RUNSHARED='DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}'
|
RUNSHARED='DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}'
|
||||||
;;
|
;;
|
||||||
|
AIX*)
|
||||||
|
LDLIBRARY='libpython$(VERSION).so'
|
||||||
|
RUNSHARED=LIBPATH=`pwd`:${LIBPATH}
|
||||||
|
;;
|
||||||
|
|
||||||
esac
|
esac
|
||||||
else # shared is disabled
|
else # shared is disabled
|
||||||
|
@ -7484,7 +7488,7 @@ if test -z "$LDSHARED"
|
||||||
then
|
then
|
||||||
case $ac_sys_system/$ac_sys_release in
|
case $ac_sys_system/$ac_sys_release in
|
||||||
AIX*)
|
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"
|
LDSHARED="\$(BINLIBDEST)/config/ld_so_aix \$(CC) -bI:\$(BINLIBDEST)/config/python.exp"
|
||||||
;;
|
;;
|
||||||
IRIX/5*) LDSHARED="ld -shared";;
|
IRIX/5*) LDSHARED="ld -shared";;
|
||||||
|
@ -13756,6 +13760,8 @@ $as_echo "done" >&6; }
|
||||||
# generate output files
|
# generate output files
|
||||||
ac_config_files="$ac_config_files Makefile.pre Modules/Setup.config Misc/python.pc"
|
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
|
cat >confcache <<\_ACEOF
|
||||||
# This file is a shell script that caches the results of configure
|
# This file is a shell script that caches the results of configure
|
||||||
# tests run on this system so they can be shared between configure
|
# tests run on this system so they can be shared between configure
|
||||||
|
@ -14448,6 +14454,7 @@ do
|
||||||
"Makefile.pre") CONFIG_FILES="$CONFIG_FILES Makefile.pre" ;;
|
"Makefile.pre") CONFIG_FILES="$CONFIG_FILES Makefile.pre" ;;
|
||||||
"Modules/Setup.config") CONFIG_FILES="$CONFIG_FILES Modules/Setup.config" ;;
|
"Modules/Setup.config") CONFIG_FILES="$CONFIG_FILES Modules/Setup.config" ;;
|
||||||
"Misc/python.pc") CONFIG_FILES="$CONFIG_FILES Misc/python.pc" ;;
|
"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;;
|
*) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
|
||||||
esac
|
esac
|
||||||
|
@ -14987,6 +14994,11 @@ $as_echo "$as_me: $ac_file is unchanged" >&6;}
|
||||||
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
case $ac_file$ac_mode in
|
||||||
|
"Modules/ld_so_aix":F) chmod +x Modules/ld_so_aix ;;
|
||||||
|
|
||||||
|
esac
|
||||||
done # for ac_tag
|
done # for ac_tag
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -766,6 +766,10 @@ if test $enable_shared = "yes"; then
|
||||||
BLDLIBRARY='-L. -lpython$(VERSION)'
|
BLDLIBRARY='-L. -lpython$(VERSION)'
|
||||||
RUNSHARED='DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}'
|
RUNSHARED='DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}'
|
||||||
;;
|
;;
|
||||||
|
AIX*)
|
||||||
|
LDLIBRARY='libpython$(VERSION).so'
|
||||||
|
RUNSHARED=LIBPATH=`pwd`:${LIBPATH}
|
||||||
|
;;
|
||||||
|
|
||||||
esac
|
esac
|
||||||
else # shared is disabled
|
else # shared is disabled
|
||||||
|
@ -1665,7 +1669,7 @@ if test -z "$LDSHARED"
|
||||||
then
|
then
|
||||||
case $ac_sys_system/$ac_sys_release in
|
case $ac_sys_system/$ac_sys_release in
|
||||||
AIX*)
|
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"
|
LDSHARED="\$(BINLIBDEST)/config/ld_so_aix \$(CC) -bI:\$(BINLIBDEST)/config/python.exp"
|
||||||
;;
|
;;
|
||||||
IRIX/5*) LDSHARED="ld -shared";;
|
IRIX/5*) LDSHARED="ld -shared";;
|
||||||
|
@ -4247,6 +4251,7 @@ AC_MSG_RESULT(done)
|
||||||
|
|
||||||
# generate output files
|
# generate output files
|
||||||
AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc)
|
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
|
AC_OUTPUT
|
||||||
|
|
||||||
echo "creating Modules/Setup"
|
echo "creating Modules/Setup"
|
||||||
|
|
Loading…
Reference in New Issue