This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Okay, here's your official unofficial closure leak patch
[perl5.git] / embed_h.sh
1 #!/bin/sh
2
3 rm -f embed.h
4 cat <<'END' >embed.h
5 /* This file is derived from global.sym and interp.sym */
6
7 /* (Doing namespace management portably in C is really gross.) */
8
9 #ifdef EMBED
10
11 /* globals we need to hide from the world */
12 END
13
14 sed <global.sym >>embed.h                                               \
15         -e 's/[         ]*#.*//'                                        \
16         -e '/^[         ]*$/d'                                          \
17         -e 's/\(.*\)/#define \1         Perl_\1/'                       \
18         -e 's/\(................        \)      /\1/'
19
20 cat <<'END' >> embed.h
21
22 #endif /* EMBED */
23
24 /* Put interpreter specific symbols into a struct? */
25
26 #ifdef MULTIPLICITY
27
28 END
29
30
31 sed <interp.sym >>embed.h                                               \
32         -e 's/[         ]*#.*//'                                        \
33         -e '/^[         ]*$/d'                                          \
34         -e 's/\(.*\)/#define \1         (curinterp->I\1)/'              \
35         -e 's/\(................        \)      /\1/'
36
37 cat <<'END' >> embed.h
38
39 #else   /* not multiple, so translate interpreter symbols the other way... */
40
41 END
42
43 sed <interp.sym >>embed.h                                               \
44         -e 's/[         ]*#.*//'                                        \
45         -e '/^[         ]*$/d'                                          \
46         -e 's/\(.*\)/#define I\1                \1/'                    \
47         -e 's/\(................        \)      /\1/'
48
49 cat <<'END' >> embed.h
50
51 #endif /* MULTIPLICITY */
52 END
53