annotate Modules/makexp_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 53019e3a6d5a
children a2c1b3e17952
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3967
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
1 #!/bin/sh
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
2 #
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
3 # ===========================================================================
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
4 # FILE: makexp_aix
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
5 # TYPE: standalone executable
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
6 # SYSTEM: AIX 3.2.5 and AIX 4
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
7 #
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
8 # DESCRIPTION: This script creates an export list of ALL global symbols
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
9 # from a list of object or archive files.
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
10 #
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
11 # USAGE: makexp_aix <OutputFile> "<FirstLine>" <InputFile> ...
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
12 #
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
13 # where:
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
14 # <OutputFile> is the target export list filename.
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
15 # <FirstLine> is the path/file string to be appended
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
16 # after the "#!" symbols in the first line of the
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
17 # export file. Passing "" means deferred resolution.
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
18 # <InputFile> is an object (.o) or an archive file (.a).
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
19 #
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
20 # HISTORY:
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
21 # 1-Jul-1996 -- added header information
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
22 # Vladimir Marangozov
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
23 #
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
24 # 28-Jun-1996 -- initial code
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
25 # Vladimir Marangozov (Vladimir.Marangozov@imag.fr)
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
26 # ==========================================================================
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
27
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
28 # Variables
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
29 expFileName=$1
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
30 toAppendStr=$2
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
31 shift; shift;
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
32 inputFiles=$*
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
33 automsg="Generated automatically by makexp_aix"
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
34 notemsg="NOTE: lists _all_ global symbols defined in the above file(s)."
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
35 curwdir=`pwd`
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
36
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
37 # Create the export file and setup the header info
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
38 echo "#!"$toAppendStr > $expFileName
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
39 echo "*" >> $expFileName
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
40 echo "* $automsg (`date -u`)" >> $expFileName
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
41 echo "*" >> $expFileName
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
42 echo "* Base Directory: $curwdir" >> $expFileName
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
43 echo "* Input File(s) : $inputFiles" >> $expFileName
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
44 echo "*" >> $expFileName
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
45 echo "* $notemsg" >> $expFileName
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
46 echo "*" >> $expFileName
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
47
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
48 # Extract the symbol list using 'nm' which produces quite
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
49 # different output under AIX 4 than under AIX 3.2.5.
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
50 # The following handles both versions by using a common flagset.
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
51 # Here are some hidden tricks:
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
52 # 1. Use /usr/ccs/bin/nm. Relevant to AIX 3.2.5 which has
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
53 # another version under /usr/ucb/bin/nm.
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
54 # 2. Use the -B flag to have a standard BSD representation
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
55 # of the symbol list on both AIX 3.2.5 and AIX 4. The "-B"
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
56 # flag is missing in the AIX 3.2.5 online usage help of 'nm'.
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
57 # 3. Use the -x flag to have a hex representation of the symbol
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
58 # values. This fills the leading whitespaces on AIX 4,
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
59 # thus simplifying the sed statement.
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
60 # 4. Eliminate all entries except those with either "B", "D"
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
61 # or "T" key letters. We are interested only in the global
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
62 # (extern) BSS, DATA and TEXT symbols. With the same statement
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
63 # we eliminate object member lines relevant to AIX 4.
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
64 # 5. Eliminate entries containing a dot. We can have a dot only
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
65 # as a symbol prefix, but such symbols are undefined externs.
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
66 # 6. Eliminate everything including the key letter, so that we're
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
67 # left with just the symbol name.
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
68 #
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
69 /usr/ccs/bin/nm -Bex $inputFiles \
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
70 | sed -e '/ [^BDT] /d' -e '/\./d' -e 's/.* [BDT] //' \
53019e3a6d5a Re-install aix files (what happened?)
Guido van Rossum <guido@python.org>
parents:
diff changeset
71 | sort | uniq >> $expFileName