3 # FOR BACKWARDS COMPATIBILITY WITH OLD VERSIONS OF PERL
5 # This script uses an old method of creating "embed.h". Use it
6 # if you need to maintain binary compatibility with older versions
7 # Perl with the EMBED feature enabled.
11 open(EM, ">embed.h") || die "Can't create embed.h: $!\n";
14 /* !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
15 This file is built by old_embed.pl from old_global.sym and interp.sym.
16 Any changes made here will be lost.
17 THIS FILE IS FOR BINARY COMPATIBILITY WITH OLD PERL VERSIONS.
18 Run "embed.pl" to get an up-to-date version.
21 /* (Doing namespace management portably in C is really gross.) */
23 /* EMBED has no run-time penalty, but helps keep the Perl namespace
24 from colliding with that used by other libraries pulled in
25 by extensions or by embedding perl. Allow a cc -DNO_EMBED
26 override, however, to keep binary compatability with previous
35 /* globals we need to hide from the world */
38 open(GL, "<old_global.sym") || die "Can't open old_global.sym: $!\n";
41 s/[ \t]*#.*//; # Delete comments.
43 s/^\s*(\S+).*$/#define $1\t\tPerl_$1/;
45 s/(................\t)\t/$1/;
49 close(GL) || warn "Can't close old_global.sym: $!\n";
55 /* Put interpreter specific symbols into a struct? */
59 /* Undefine symbols that were defined by EMBED. Somewhat ugly */
64 open(INT, "<interp.sym") || die "Can't open interp.sym: $!\n";
66 s/[ \t]*#.*//; # Delete comments.
68 s/^\s*(\S*).*$/#undef $1/;
69 print EM $_ if (exists $global{$1});
71 close(INT) || warn "Can't close interp.sym: $!\n";
75 open(INT, "<interp.sym") || die "Can't open interp.sym: $!\n";
77 s/[ \t]*#.*//; # Delete comments.
79 s/^\s*(\S+).*$/#define $1\t\t(curinterp->I$1)/;
80 s/(................\t)\t/$1/;
83 close(INT) || warn "Can't close interp.sym: $!\n";
87 #else /* not multiple, so translate interpreter symbols the other way... */
91 open(INT, "<interp.sym") || die "Can't open interp.sym: $!\n";
93 s/[ \t]*#.*//; # Delete comments.
95 s/^\s*(\S+).*$/#define I$1\t\t$1/;
96 s/(................\t)\t/$1/;
99 close(INT) || warn "Can't close interp.sym: $!\n";
103 #endif /* MULTIPLICITY */