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! |
ecfc5424 |
25 | $startsh |
2b317908 |
26 | !GROK!THIS! |
27 | |
28 | : In the following dollars and backticks do not need the extra backslash. |
29 | $spitshell >>cflags <<'!NO!SUBS!' |
2b317908 |
30 | case $CONFIG in |
31 | '') |
a0d0e21e |
32 | if 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 | elif test -f ../../../../config.sh; then TOP=../../../..; |
37 | else |
38 | echo "Can't find config.sh."; exit 1 |
39 | fi |
40 | . $TOP/config.sh |
41 | ;; |
42 | esac |
43 | |
44 | perltype='' |
45 | optdebug='' # ensure -g used if building a -DDEBUGGING libperl |
46 | case $# in |
47 | 2) case $1 in |
48 | *perl.*) perltype='';; |
49 | *perld.*) perltype='-DDEBUGGING'; optdebug='-g' ;; |
50 | *perle.*) perltype='-DEMBED';; |
51 | *perlde.*) perltype='-DDEBUGGING -DEMBED'; optdebug='-g' ;; |
52 | *perlm.*) perltype='-DEMBED -DMULTIPLICITY';; |
53 | *perldm.*) perltype='-DDEBUGGING -DEMBED -DMULTIPLICITY'; optdebug='-g' ;; |
54 | esac |
55 | shift ;; |
2b317908 |
56 | esac |
1c3d792e |
57 | |
58 | also=': ' |
59 | case $# in |
2b317908 |
60 | 1) also='echo 1>&2 " CCCMD = "' |
1c3d792e |
61 | esac |
62 | |
63 | case $# in |
64 | 0) set *.c; echo "The current C flags are:" ;; |
1c3d792e |
65 | esac |
2b317908 |
66 | |
4633a7c4 |
67 | set `echo "$* " | sed -e 's/\.[oc] / /g' -e 's/\.obj / /g'` |
2b317908 |
68 | |
1c3d792e |
69 | for file do |
70 | |
71 | case "$#" in |
72 | 1) ;; |
2b317908 |
73 | *) echo $n " $file.c $c" ;; |
1c3d792e |
74 | esac |
75 | |
2b317908 |
76 | : allow variables like toke_cflags to be evaluated |
77 | |
78 | eval 'eval ${'"${file}_cflags"'-""}' |
79 | |
80 | : or customize here |
81 | |
1c3d792e |
82 | case "$file" in |
a0d0e21e |
83 | DB_File) ;; |
84 | GDBM_File) ;; |
2304df62 |
85 | NDBM_File) ;; |
86 | ODBM_File) ;; |
87 | POSIX) ;; |
88 | SDBM_File) ;; |
89 | av) ;; |
90 | deb) ;; |
91 | dl) ;; |
2b317908 |
92 | doio) ;; |
2304df62 |
93 | doop) ;; |
2b317908 |
94 | dump) ;; |
2304df62 |
95 | gv) ;; |
96 | hv) ;; |
97 | main) ;; |
2b317908 |
98 | malloc) ;; |
2304df62 |
99 | mg) ;; |
100 | miniperlmain) ;; |
101 | op) ;; |
2b317908 |
102 | perl) ;; |
2304df62 |
103 | perlmain) ;; |
2b317908 |
104 | perly) ;; |
2304df62 |
105 | pp) ;; |
a0d0e21e |
106 | pp_ctl) ;; |
107 | pp_hot) ;; |
108 | pp_sys) ;; |
2b317908 |
109 | regcomp) ;; |
110 | regexec) ;; |
2304df62 |
111 | run) ;; |
112 | scope) ;; |
113 | sv) ;; |
114 | taint) ;; |
2b317908 |
115 | toke) ;; |
116 | usersub) ;; |
117 | util) ;; |
1c3d792e |
118 | *) ;; |
119 | esac |
120 | |
a0d0e21e |
121 | if test "X$optdebug" != "X"; then |
122 | optimize="$optdebug" |
123 | fi |
124 | |
125 | echo "$cc -c $ccflags $optimize $perltype $large $split" |
126 | eval "$also "'"$cc -c $ccflags $optimize $perltype $large $split"' |
2b317908 |
127 | |
a0d0e21e |
128 | . $TOP/config.sh |
2b317908 |
129 | |
1c3d792e |
130 | done |
2b317908 |
131 | !NO!SUBS! |
a0d0e21e |
132 | chmod 755 cflags |
2b317908 |
133 | $eunicefix cflags |