This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate win32 branch into mainline.
[perl5.git] / perl_exp.SH
CommitLineData
a0d0e21e 1#!/bin/sh
71be2cbc 2#
75f92628 3# Written: Nov 1994 Wayne Scott (wscott@ichips.intel.com)
71be2cbc 4#
a0d0e21e
LW
5# Create the export list for perl.
6# Needed by AIX to do dynamic linking.
71be2cbc 7#
1553ab04
TB
8# This simple program relys on 'global.sym' and other *.sym files
9# being up to date with all of the global symbols that a dynamic
10# link library might want to access.
71be2cbc 11#
12# Most symbols have a Perl_ prefix because that's what embed.h sticks
13# in front of them. Variations depend on binary compatibility with
14# Perl 5.003.
15#
a0d0e21e 16
71be2cbc 17case $CONFIG in
18'')
19 if test -f config.sh; then TOP=.;
20 elif test -f ../config.sh; then TOP=..;
21 elif test -f ../../config.sh; then TOP=../..;
22 elif test -f ../../../config.sh; then TOP=../../..;
23 elif test -f ../../../../config.sh; then TOP=../../../..;
24 else
25 echo "Can't find config.sh."; exit 1
26 fi
27 . $TOP/config.sh
28 ;;
29esac
30: This forces SH files to create target in same directory as SH file.
31: This is so that make depend always knows where to find SH derivatives.
32case "$0" in
33*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
34esac
bbb28fc1 35
a0d0e21e
LW
36echo "Extracting perl.exp"
37
acf072ce 38rm -f perl.exp
a0d0e21e
LW
39echo "#!" > perl.exp
40
5f05dabc 41case "$bincompat3" in
42y*)
a3e802d2
CS
43 global=/tmp/exp$$g
44 interp=/tmp/exp$$i
45 compat3=/tmp/exp$$c
46 grep '^[A-Za-z]' global.sym | sort >$global
47 grep '^[A-Za-z]' interp.sym | sort >$interp
48 grep '^[A-Za-z]' compat3.sym | sort >$compat3
49 comm -23 $global $compat3 | sed 's/^/Perl_/' >> perl.exp
50 comm -12 $interp $compat3 | sed 's/^/Perl_/' >> perl.exp
51 comm -12 $global $compat3 >> perl.exp
52 comm -23 $interp $compat3 >> perl.exp
53 rm -f $global $interp $compat3
5f05dabc 54 ;;
55*)
56 sed -n '/^[A-Za-z]/ s/^/Perl_/p' global.sym interp.sym >> perl.exp
f2b22898
JH
57 expperlvars=/tmp/exp$$pv
58 expthrdvar=/tmp/exp$$tv
59 sed -n 's/^PERLVARI*(G\([^,]*\).*/Perl_\1/p' perlvars.h >> $expperlvars
60 sed -n 's/^PERLVARI*(T\([^,]*\).*/Perl_\1/p' thrdvar.h >> $expthrdvar
61 # The shebang line nicely sorts as the first one.
62 sort -o perl.exp -u perl.exp $expperlvars $expthrdvar
63 rm -f $expperlvars $expthrdvar
5f05dabc 64 ;;
65esac
75f92628 66
1553ab04
TB
67#
68# If we use the PerlIO abstraction layer, add its symbols
69#
70
71if [ $useperlio = "define" ]
72then
73 grep '^[A-Za-z]' perlio.sym >> perl.exp
74fi
75
71be2cbc 76#
77# Extra globals not included above (including a few that might
78# not actually be defined, but there's no harm in that).
79#
80
a0d0e21e 81cat <<END >> perl.exp
55497cff 82perl_init_i18nl10n
bbce6d69 83perl_init_i18nl14n
84perl_new_collate
85perl_new_ctype
ff68c719 86perl_new_numeric
36477c24 87perl_set_numeric_local
88perl_set_numeric_standard
a0d0e21e
LW
89perl_alloc
90perl_construct
91perl_destruct
92perl_free
93perl_parse
94perl_run
95perl_get_sv
96perl_get_av
97perl_get_hv
98perl_get_cv
99perl_call_argv
100perl_call_pv
101perl_call_method
102perl_call_sv
6b8afdaf
CS
103perl_eval_pv
104perl_eval_sv
105perl_require_pv
71be2cbc 106Mymalloc
107Mycalloc
108Myremalloc
109Myfree
110Perl_malloc
111Perl_calloc
112Perl_realloc
113Perl_free
a0d0e21e 114END