diff options
author | Guido van Rossum <guido@python.org> | 1996-08-08 19:06:31 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1996-08-08 19:06:31 (GMT) |
commit | a93b504a23ac24cd574253fabdd97eac622d4fef (patch) | |
tree | e4ca6182cfbd1a4b219a164bf1a56be4fd5d56ee /Modules/defmakexp_aix | |
parent | b6b43e00f8ba7ffd142795d2ed2e340e4a897a95 (diff) | |
download | cpython-a93b504a23ac24cd574253fabdd97eac622d4fef.zip cpython-a93b504a23ac24cd574253fabdd97eac622d4fef.tar.gz cpython-a93b504a23ac24cd574253fabdd97eac622d4fef.tar.bz2 |
Latest AIX changes from Vlad
Diffstat (limited to 'Modules/defmakexp_aix')
-rwxr-xr-x | Modules/defmakexp_aix | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/Modules/defmakexp_aix b/Modules/defmakexp_aix new file mode 100755 index 0000000..23895d2 --- /dev/null +++ b/Modules/defmakexp_aix @@ -0,0 +1,106 @@ +#! /bin/sh +# +# ============================================================================ +# FILE: defmakexp_aix +# TYPE: standalone executable +# SYSTEM: AIX, Solaris +# +# DESCRIPTION: This script creates the default export list file "python.exp" +# for AIX platforms which has to be included in the Modules +# directory of the python source tree. +# It contains all global symbols defined in the following files: +# a) main.o config.o getpath.o +# b) libModules.a libPython.a libObjects.a libParser.a +# +# The script should be run after a new unpack, configure & make +# of the python release, without any options nor changes to +# Modules/Setup.in (i.e. a default static build). +# +# USAGE: defmakexp_aix [path] +# +# where [path] points to the Python source root directory. +# ============================================================================ +# + + +# +# Check for AIX or Solaris +# +if (test `uname -s` != "AIX") && + (test `uname -s` != "IRIX") && + (test `uname -s` != "SunOS" || test `uname -r | cut -d. -f1` != "5"); then + echo "*** Make sure you are running AIX or Solaris" + exit 1 +fi + +if test "$*" = ""; then + echo "Usage: defmakexp_aix [path to python's source root directory]" + exit 1 +fi + +# +# Variables +# +ROOTDIR=$1 +MODSDIR=$ROOTDIR/Modules +PYTHDIR=$ROOTDIR/Python +OBJSDIR=$ROOTDIR/Objects +PARSDIR=$ROOTDIR/Parser + +OBJFILES="$MODSDIR/main.o $MODSDIR/config.o $MODSDIR/getpath.o" +LIBFILES="$MODSDIR/libModules.a $OBJSDIR/libObjects.a $PARSDIR/libParser.a" +LIBFILES="$LIBFILES $PYTHDIR/libPython.a" +ALLFILES="$OBJFILES $LIBFILES" + +# +# Check for object and library files +# +for i in $ALLFILES; do + echo "checking for $i" + if test ! -f $i; then echo "*** Cannot find $i"; exit 1; fi +done + +# +# Setup the header of Modules/python.exp +# +pyexp=$MODSDIR/python.exp +echo "making export list $pyexp" +echo "#!" > $pyexp +echo "*" >> $pyexp +echo "* ========================================================= " >> $pyexp +echo "* This is the default export list of the python executable. " >> $pyexp +echo "* This file is used for the AIX platform ONLY. It provides " >> $pyexp +echo "* a list of all variables in the python executable that are " >> $pyexp +echo "* "exported" -- that is, which may be used by any extension " >> $pyexp +echo "* modules that are created. This file should be used as an " >> $pyexp +echo "* AIX "import" file when creating extension modules on that " >> $pyexp +echo "* platform. " >> $pyexp +echo "* " >> $pyexp +echo "* This file was generated from the default configuration of " >> $pyexp +echo "* the distribution (that is, from a build in which NONE of " >> $pyexp +echo "* the python Modules were built as shared libraries). " >> $pyexp +echo "* " >> $pyexp +echo "* THIS FILE IS OVERWRITTEN anytime the python executable is " >> $pyexp +echo "* re-built using a Modules/Setup file that was customized " >> $pyexp +echo "* to call for the building of some or all python Modules as " >> $pyexp +echo "* shared libraries and with the definition of LINKCC having " >> $pyexp +echo "* been uncommented. A new python.exp will be generated by " >> $pyexp +echo "* such a build; it will list ONLY the global symbols which " >> $pyexp +echo "* are defined in the statically-bound modules and libraries." >> $pyexp +echo "* ========================================================= " >> $pyexp +echo "*" >> $pyexp + +# +# Make the export list +# +if test `uname -s` = "AIX"; then + nmflags='-Bex' +else + nmflags='-p' +fi +: ${nm=nm} +$nm $nmflags $ALLFILES \ +| sed -e '/ [^BDT] /d' -e '/\./d' -e 's/.* [BDT] //' \ +| sort | uniq >> $pyexp + +echo "done" |