Commit | Line | Data |
1c3d792e |
1 | case $CONFIG in |
2 | '') |
a0d0e21e |
3 | if test -f config.sh; then TOP=.; |
4 | elif test -f ../config.sh; then TOP=..; |
5 | elif test -f ../../config.sh; then TOP=../..; |
6 | elif test -f ../../../config.sh; then TOP=../../..; |
7 | elif test -f ../../../../config.sh; then TOP=../../../..; |
8 | else |
9 | echo "Can't find config.sh."; exit 1 |
10 | fi |
11 | . $TOP/config.sh |
12 | ;; |
1c3d792e |
13 | esac |
2b317908 |
14 | : This forces SH files to create target in same directory as SH file. |
15 | : This is so that make depend always knows where to find SH derivatives. |
1c3d792e |
16 | case "$0" in |
17 | */*) cd `expr X$0 : 'X\(.*\)/'` ;; |
18 | esac |
2b317908 |
19 | echo "Extracting cflags (with variable substitutions)" |
20 | : This section of the file will have variable substitutions done on it. |
21 | : Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!. |
22 | : Protect any dollar signs and backticks that you do not want interpreted |
23 | : by putting a backslash in front. You may delete these comments. |
24 | $spitshell >cflags <<!GROK!THIS! |
25 | !GROK!THIS! |
26 | |
27 | : In the following dollars and backticks do not need the extra backslash. |
28 | $spitshell >>cflags <<'!NO!SUBS!' |
2b317908 |
29 | case $CONFIG in |
30 | '') |
a0d0e21e |
31 | if test -f config.sh; then TOP=.; |
32 | elif test -f ../config.sh; then TOP=..; |
33 | elif test -f ../../config.sh; then TOP=../..; |
34 | elif test -f ../../../config.sh; then TOP=../../..; |
35 | elif test -f ../../../../config.sh; then TOP=../../../..; |
36 | else |
37 | echo "Can't find config.sh."; exit 1 |
38 | fi |
39 | . $TOP/config.sh |
40 | ;; |
41 | esac |
42 | |
43 | perltype='' |
44 | optdebug='' # ensure -g used if building a -DDEBUGGING libperl |
45 | case $# in |
46 | 2) case $1 in |
47 | *perl.*) perltype='';; |
48 | *perld.*) perltype='-DDEBUGGING'; optdebug='-g' ;; |
49 | *perle.*) perltype='-DEMBED';; |
50 | *perlde.*) perltype='-DDEBUGGING -DEMBED'; optdebug='-g' ;; |
51 | *perlm.*) perltype='-DEMBED -DMULTIPLICITY';; |
52 | *perldm.*) perltype='-DDEBUGGING -DEMBED -DMULTIPLICITY'; optdebug='-g' ;; |
53 | esac |
54 | shift ;; |
2b317908 |
55 | esac |
1c3d792e |
56 | |
57 | also=': ' |
58 | case $# in |
2b317908 |
59 | 1) also='echo 1>&2 " CCCMD = "' |
1c3d792e |
60 | esac |
61 | |
62 | case $# in |
63 | 0) set *.c; echo "The current C flags are:" ;; |
1c3d792e |
64 | esac |
2b317908 |
65 | |
66 | set `echo "$* " | sed 's/\.[oc] / /g'` |
67 | |
1c3d792e |
68 | for file do |
69 | |
70 | case "$#" in |
71 | 1) ;; |
2b317908 |
72 | *) echo $n " $file.c $c" ;; |
1c3d792e |
73 | esac |
74 | |
2b317908 |
75 | : allow variables like toke_cflags to be evaluated |
76 | |
77 | eval 'eval ${'"${file}_cflags"'-""}' |
78 | |
79 | : or customize here |
80 | |
1c3d792e |
81 | case "$file" in |
a0d0e21e |
82 | DB_File) ;; |
83 | GDBM_File) ;; |
2304df62 |
84 | NDBM_File) ;; |
85 | ODBM_File) ;; |
86 | POSIX) ;; |
87 | SDBM_File) ;; |
88 | av) ;; |
89 | deb) ;; |
90 | dl) ;; |
2b317908 |
91 | doio) ;; |
2304df62 |
92 | doop) ;; |
2b317908 |
93 | dump) ;; |
2304df62 |
94 | gv) ;; |
95 | hv) ;; |
96 | main) ;; |
2b317908 |
97 | malloc) ;; |
2304df62 |
98 | mg) ;; |
99 | miniperlmain) ;; |
100 | op) ;; |
2b317908 |
101 | perl) ;; |
2304df62 |
102 | perlmain) ;; |
2b317908 |
103 | perly) ;; |
2304df62 |
104 | pp) ;; |
a0d0e21e |
105 | pp_ctl) ;; |
106 | pp_hot) ;; |
107 | pp_sys) ;; |
2b317908 |
108 | regcomp) ;; |
109 | regexec) ;; |
2304df62 |
110 | run) ;; |
111 | scope) ;; |
112 | sv) ;; |
113 | taint) ;; |
2b317908 |
114 | toke) ;; |
115 | usersub) ;; |
116 | util) ;; |
1c3d792e |
117 | *) ;; |
118 | esac |
119 | |
a0d0e21e |
120 | if test "X$optdebug" != "X"; then |
121 | optimize="$optdebug" |
122 | fi |
123 | |
124 | echo "$cc -c $ccflags $optimize $perltype $large $split" |
125 | eval "$also "'"$cc -c $ccflags $optimize $perltype $large $split"' |
2b317908 |
126 | |
a0d0e21e |
127 | . $TOP/config.sh |
2b317908 |
128 | |
1c3d792e |
129 | done |
2b317908 |
130 | !NO!SUBS! |
a0d0e21e |
131 | chmod 755 cflags |
2b317908 |
132 | $eunicefix cflags |