Commit | Line | Data |
---|---|---|
79072805 LW |
1 | #!/bin/sh |
2 | ||
3 | cat <<'END' >embed.h | |
4 | /* This file is derived from global.var and interp.var */ | |
5 | ||
6 | /* (Doing namespace management portably in C is really gross.) */ | |
7 | ||
8 | #ifdef EMBEDDED | |
9 | ||
10 | /* globals we need to hide from the world */ | |
11 | END | |
12 | ||
13 | sed <global.var >>embed.h \ | |
14 | -e 's/[ ]*#.*//' \ | |
15 | -e '/^[ ]*$/d' \ | |
16 | -e 's/\(.*\)/#define \1 PERL\1/' \ | |
17 | -e 's/\(................ \) /\1/' | |
18 | ||
19 | cat <<'END' >> embed.h | |
20 | ||
21 | /* interpreter specific variables */ | |
22 | ||
23 | END | |
24 | ||
25 | ||
26 | sed <interp.var >>embed.h \ | |
27 | -e 's/[ ]*#.*//' \ | |
28 | -e '/^[ ]*$/d' \ | |
29 | -e 's/\(.*\)/#define \1 (curinterp->I\1)/' \ | |
30 | -e 's/\(................ \) /\1/' | |
31 | ||
32 | cat <<'END' >> embed.h | |
33 | ||
34 | #else /* not embedded, so translate interpreter variables the other way... */ | |
35 | ||
36 | END | |
37 | ||
38 | sed <interp.var >>embed.h \ | |
39 | -e 's/[ ]*#.*//' \ | |
40 | -e '/^[ ]*$/d' \ | |
41 | -e 's/\(.*\)/#define I\1 \1/' \ | |
42 | -e 's/\(................ \) /\1/' | |
43 | ||
44 | cat <<'END' >> embed.h | |
45 | ||
46 | #endif | |
47 | END | |
48 |