3 # Written: Nov 1994 Wayne Scott <wscott@ichips.intel.com>
5 # Updated: 1997-8 Jarkko Hietaniemi <jhi@iki.fi>
7 # Create the export list for perl.
8 # Needed by AIX to do dynamic linking.
10 # This simple program relies on global.sym and few other *.sym files
11 # and the *var*.h files being up to date with all of the global
12 # symbols that a dynamic link library might want to access.
14 # Most symbols have a Perl_ or PL_prefix because that's what embed.h
15 # sticks in front of them.
17 # AIX requires the list of external symbols (variables or functions)
18 # that are made available for another executable object file the import.
19 # The list is called the export file and it is a simple text file.
20 # The first line must be
22 # That is, hash-bang, pound-shout, however you want to call it.
23 # The remainder of the file are the names of the symbols, one per line.
24 # The file is then given to the system loader (cc/xlc command line)
29 if test -f config.sh; then TOP=.;
30 elif test -f ../config.sh; then TOP=..;
31 elif test -f ../../config.sh; then TOP=../..;
32 elif test -f ../../../config.sh; then TOP=../../..;
33 elif test -f ../../../../config.sh; then TOP=../../../..;
35 echo "Can't find config.sh."; exit 1
40 : This forces SH files to create target in same directory as SH file.
41 : This is so that make depend always knows where to find SH derivatives.
43 */*) cd `expr X$0 : 'X\(.*\)/'` ;;
46 echo "Extracting perl.exp"
51 # No compat3 since 5.004_50.
52 # No interp.sym since 5.005_03.
53 # perlio.sym will added later if needed.
55 syms="global.sym pp.sym"
58 sed -n '/^[A-Za-z]/ s/^/PL_/p' globvar.sym >> perl.exp
60 sed -n 's/^PERLVAR.*(G\([^[,]*\).*/PL_\1/p' perlvars.h >> perl.exp
61 sed -n 's/^PERLVAR.*(I\([^[,]*\).*/PL_\1/p' intrpvar.h >> perl.exp
62 sed -n 's/^PERLVAR.*(T\([^[,]*\).*/PL_\1/p' thrdvar.h >> perl.exp
65 # If we use the PerlIO abstraction layer, add its symbols.
68 if [ "X$useperlio" = "Xdefine" ]
70 grep '^[A-Za-z]' perlio.sym >> perl.exp
74 # Extra globals not included above (including a few that might
75 # not actually be defined, but there's no harm in that).
81 # The shebang line nicely sorts as the first one.
82 sort -o perl.exp -u perl.exp