annotate Modules/defmakexp_aix @ 5817:48b94de85bf3 legacy-trunk

Extensive changes by AMK.
author Guido van Rossum <guido@python.org>
date Thu, 17 Jul 1997 16:29:42 +0000
parents ad88a000521f
children 87517e8ea519
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3969
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
1 #! /bin/sh
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
2 #
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
3 # ============================================================================
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
4 # FILE: defmakexp_aix
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
5 # TYPE: standalone executable
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
6 # SYSTEM: AIX, Solaris
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
7 #
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
8 # DESCRIPTION: This script creates the default export list file "python.exp"
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
9 # for AIX platforms which has to be included in the Modules
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
10 # directory of the python source tree.
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
11 # It contains all global symbols defined in the following files:
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
12 # a) main.o config.o getpath.o
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
13 # b) libModules.a libPython.a libObjects.a libParser.a
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
14 #
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
15 # The script should be run after a new unpack, configure & make
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
16 # of the python release, without any options nor changes to
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
17 # Modules/Setup.in (i.e. a default static build).
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
18 #
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
19 # USAGE: defmakexp_aix [path]
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
20 #
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
21 # where [path] points to the Python source root directory.
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
22 # ============================================================================
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
23 #
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
24
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
25
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
26 #
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
27 # Check for AIX or Solaris
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
28 #
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
29 if (test `uname -s` != "AIX") &&
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
30 (test `uname -s` != "IRIX") &&
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
31 (test `uname -s` != "SunOS" || test `uname -r | cut -d. -f1` != "5"); then
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
32 echo "*** Make sure you are running AIX or Solaris"
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
33 exit 1
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
34 fi
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
35
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
36 if test "$*" = ""; then
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
37 echo "Usage: defmakexp_aix [path to python's source root directory]"
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
38 exit 1
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
39 fi
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
40
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
41 #
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
42 # Variables
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
43 #
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
44 ROOTDIR=$1
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
45 MODSDIR=$ROOTDIR/Modules
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
46 PYTHDIR=$ROOTDIR/Python
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
47 OBJSDIR=$ROOTDIR/Objects
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
48 PARSDIR=$ROOTDIR/Parser
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
49
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
50 OBJFILES="$MODSDIR/main.o $MODSDIR/config.o $MODSDIR/getpath.o"
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
51 LIBFILES="$MODSDIR/libModules.a $OBJSDIR/libObjects.a $PARSDIR/libParser.a"
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
52 LIBFILES="$LIBFILES $PYTHDIR/libPython.a"
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
53 ALLFILES="$OBJFILES $LIBFILES"
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
54
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
55 #
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
56 # Check for object and library files
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
57 #
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
58 for i in $ALLFILES; do
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
59 echo "checking for $i"
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
60 if test ! -f $i; then echo "*** Cannot find $i"; exit 1; fi
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
61 done
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
62
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
63 #
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
64 # Setup the header of Modules/python.exp
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
65 #
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
66 pyexp=$MODSDIR/python.exp
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
67 echo "making export list $pyexp"
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
68 echo "#!" > $pyexp
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
69 echo "*" >> $pyexp
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
70 echo "* ========================================================= " >> $pyexp
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
71 echo "* This is the default export list of the python executable. " >> $pyexp
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
72 echo "* This file is used for the AIX platform ONLY. It provides " >> $pyexp
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
73 echo "* a list of all variables in the python executable that are " >> $pyexp
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
74 echo "* "exported" -- that is, which may be used by any extension " >> $pyexp
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
75 echo "* modules that are created. This file should be used as an " >> $pyexp
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
76 echo "* AIX "import" file when creating extension modules on that " >> $pyexp
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
77 echo "* platform. " >> $pyexp
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
78 echo "* " >> $pyexp
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
79 echo "* This file was generated from the default configuration of " >> $pyexp
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
80 echo "* the distribution (that is, from a build in which NONE of " >> $pyexp
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
81 echo "* the python Modules were built as shared libraries). " >> $pyexp
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
82 echo "* " >> $pyexp
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
83 echo "* THIS FILE IS OVERWRITTEN anytime the python executable is " >> $pyexp
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
84 echo "* re-built using a Modules/Setup file that was customized " >> $pyexp
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
85 echo "* to call for the building of some or all python Modules as " >> $pyexp
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
86 echo "* shared libraries and with the definition of LINKCC having " >> $pyexp
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
87 echo "* been uncommented. A new python.exp will be generated by " >> $pyexp
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
88 echo "* such a build; it will list ONLY the global symbols which " >> $pyexp
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
89 echo "* are defined in the statically-bound modules and libraries." >> $pyexp
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
90 echo "* ========================================================= " >> $pyexp
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
91 echo "*" >> $pyexp
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
92
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
93 #
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
94 # Make the export list
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
95 #
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
96 if test `uname -s` = "AIX"; then
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
97 nmflags='-Bex'
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
98 else
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
99 nmflags='-p'
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
100 fi
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
101 : ${nm=nm}
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
102 $nm $nmflags $ALLFILES \
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
103 | sed -e '/ [^BDT] /d' -e '/\./d' -e 's/.* [BDT] //' \
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
104 | sort | uniq >> $pyexp
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
105
ad88a000521f Latest AIX changes from Vlad
Guido van Rossum <guido@python.org>
parents:
diff changeset
106 echo "done"