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