Commit | Line | Data |
a0d0e21e |
1 | #!/bin/sh |
71be2cbc |
2 | # |
8c3ad6a1 |
3 | # Written: Nov 1994 Wayne Scott <wscott@ichips.intel.com> |
4 | # |
5 | # Updated: 1997-8 Jarkko Hietaniemi <jhi@iki.fi> |
71be2cbc |
6 | # |
a0d0e21e |
7 | # Create the export list for perl. |
8 | # Needed by AIX to do dynamic linking. |
71be2cbc |
9 | # |
22c35a8c |
10 | # This simple program relies on global.sym and few other *.sym files |
8c3ad6a1 |
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. |
71be2cbc |
13 | # |
8c3ad6a1 |
14 | # Most symbols have a Perl_ or PL_prefix because that's what embed.h |
15 | # sticks in front of them. |
71be2cbc |
16 | # |
8c3ad6a1 |
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 |
21 | #! |
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) |
25 | # as -bE:export.file. |
a0d0e21e |
26 | |
71be2cbc |
27 | case $CONFIG in |
28 | '') |
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=../../../..; |
34 | else |
35 | echo "Can't find config.sh."; exit 1 |
36 | fi |
37 | . $TOP/config.sh |
38 | ;; |
39 | esac |
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. |
42 | case "$0" in |
43 | */*) cd `expr X$0 : 'X\(.*\)/'` ;; |
44 | esac |
bbb28fc1 |
45 | |
a0d0e21e |
46 | echo "Extracting perl.exp" |
47 | |
acf072ce |
48 | rm -f perl.exp |
a0d0e21e |
49 | echo "#!" > perl.exp |
50 | |
d502c9a3 |
51 | # No compat3 since 5.004_50. |
e4d5a464 |
52 | # No interp.sym since 5.005_03. |
53 | # perlio.sym will added later if needed. |
54 | |
22c35a8c |
55 | syms="global.sym pp.sym" |
bd656b61 |
56 | |
8c3ad6a1 |
57 | sed -n '/^[A-Za-z]/ s/^/Perl_/p' $syms >> perl.exp |
22c35a8c |
58 | sed -n '/^[A-Za-z]/ s/^/PL_/p' globvar.sym >> perl.exp |
bd656b61 |
59 | |
8c3ad6a1 |
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 |
75f92628 |
63 | |
1553ab04 |
64 | # |
e4d5a464 |
65 | # If we use the PerlIO abstraction layer, add its symbols. |
1553ab04 |
66 | # |
67 | |
5ff3f7a4 |
68 | if [ "X$useperlio" = "Xdefine" ] |
1553ab04 |
69 | then |
70 | grep '^[A-Za-z]' perlio.sym >> perl.exp |
71 | fi |
72 | |
71be2cbc |
73 | # |
74 | # Extra globals not included above (including a few that might |
75 | # not actually be defined, but there's no harm in that). |
76 | # |
77 | |
e4d5a464 |
78 | cat >>perl.exp <<END |
55497cff |
79 | perl_init_i18nl10n |
bbce6d69 |
80 | perl_init_i18nl14n |
81 | perl_new_collate |
82 | perl_new_ctype |
ff68c719 |
83 | perl_new_numeric |
36477c24 |
84 | perl_set_numeric_local |
85 | perl_set_numeric_standard |
a0d0e21e |
86 | perl_alloc |
87 | perl_construct |
88 | perl_destruct |
89 | perl_free |
90 | perl_parse |
91 | perl_run |
92 | perl_get_sv |
93 | perl_get_av |
94 | perl_get_hv |
95 | perl_get_cv |
96 | perl_call_argv |
97 | perl_call_pv |
98 | perl_call_method |
99 | perl_call_sv |
6b8afdaf |
100 | perl_eval_pv |
101 | perl_eval_sv |
102 | perl_require_pv |
e4d5a464 |
103 | END |
104 | |
105 | case "$ccflags" in |
106 | *-DHIDEMYMALLOC*) |
107 | cat >>perl.exp <<END |
71be2cbc |
108 | Mymalloc |
109 | Mycalloc |
110 | Myremalloc |
111 | Myfree |
e4d5a464 |
112 | END |
113 | ;; |
114 | esac |
115 | |
116 | case "$ccflags" in |
117 | *-DEMBEDMYMALLOC*) |
118 | cat >>perl.exp <<END |
71be2cbc |
119 | Perl_malloc |
120 | Perl_calloc |
121 | Perl_realloc |
122 | Perl_free |
a0d0e21e |
123 | END |
e4d5a464 |
124 | ;; |
125 | esac |
bd656b61 |
126 | |
127 | # The shebang line nicely sorts as the first one. |
128 | sort -o perl.exp -u perl.exp |
129 | |
130 | # eof |