Commit | Line | Data |
1c3d792e |
1 | case $CONFIG in |
2 | '') |
3 | if test ! -f config.sh; then |
4 | ln ../config.sh . || \ |
5 | ln ../../config.sh . || \ |
6 | ln ../../../config.sh . || \ |
7 | (echo "Can't find config.sh."; exit 1) |
2b317908 |
8 | fi |
11aea360 |
9 | . ./config.sh |
1c3d792e |
10 | ;; |
11 | esac |
2b317908 |
12 | : This forces SH files to create target in same directory as SH file. |
13 | : This is so that make depend always knows where to find SH derivatives. |
1c3d792e |
14 | case "$0" in |
15 | */*) cd `expr X$0 : 'X\(.*\)/'` ;; |
16 | esac |
2b317908 |
17 | echo "Extracting cflags (with variable substitutions)" |
18 | : This section of the file will have variable substitutions done on it. |
19 | : Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!. |
20 | : Protect any dollar signs and backticks that you do not want interpreted |
21 | : by putting a backslash in front. You may delete these comments. |
22 | $spitshell >cflags <<!GROK!THIS! |
23 | !GROK!THIS! |
24 | |
25 | : In the following dollars and backticks do not need the extra backslash. |
26 | $spitshell >>cflags <<'!NO!SUBS!' |
27 | case "$0" in |
28 | */*) cd `expr X$0 : 'X\(.*\)/'` ;; |
29 | esac |
30 | case $CONFIG in |
31 | '') |
32 | if test ! -f config.sh; then |
33 | ln ../config.sh . || \ |
34 | ln ../../config.sh . || \ |
35 | ln ../../../config.sh . || \ |
36 | (echo "Can't find config.sh."; exit 1) |
37 | fi 2>/dev/null |
38 | . ./config.sh |
39 | ;; |
40 | esac |
1c3d792e |
41 | |
42 | also=': ' |
43 | case $# in |
2b317908 |
44 | 1) also='echo 1>&2 " CCCMD = "' |
1c3d792e |
45 | esac |
46 | |
47 | case $# in |
48 | 0) set *.c; echo "The current C flags are:" ;; |
1c3d792e |
49 | esac |
2b317908 |
50 | |
51 | set `echo "$* " | sed 's/\.[oc] / /g'` |
52 | |
1c3d792e |
53 | for file do |
54 | |
55 | case "$#" in |
56 | 1) ;; |
2b317908 |
57 | *) echo $n " $file.c $c" ;; |
1c3d792e |
58 | esac |
59 | |
2b317908 |
60 | : allow variables like toke_cflags to be evaluated |
61 | |
62 | eval 'eval ${'"${file}_cflags"'-""}' |
63 | |
64 | : or customize here |
65 | |
1c3d792e |
66 | case "$file" in |
2b317908 |
67 | array) ;; |
68 | cmd) ;; |
69 | cons) ;; |
70 | consarg) ;; |
71 | doarg) ;; |
72 | doio) ;; |
73 | dolist) ;; |
74 | dump) ;; |
75 | eval) ;; |
76 | form) ;; |
77 | hash) ;; |
78 | malloc) ;; |
79 | perl) ;; |
80 | perly) ;; |
81 | regcomp) ;; |
82 | regexec) ;; |
83 | stab) ;; |
84 | str) ;; |
85 | toke) ;; |
86 | usersub) ;; |
87 | util) ;; |
88 | tarray) ;; |
89 | tcmd) ;; |
90 | tcons) ;; |
91 | tconsarg) ;; |
92 | tdoarg) ;; |
93 | tdoio) ;; |
94 | tdolist) ;; |
95 | tdump) ;; |
96 | teval) ;; |
97 | tform) ;; |
98 | thash) ;; |
99 | tmalloc) ;; |
100 | tperl) ;; |
101 | tperly) ;; |
102 | tregcomp) ;; |
103 | tregexec) ;; |
104 | tstab) ;; |
105 | tstr) ;; |
106 | ttoke) ;; |
107 | tusersub) ;; |
108 | tutil) ;; |
1c3d792e |
109 | *) ;; |
110 | esac |
111 | |
2b317908 |
112 | echo "$cc -c $ccflags $optimize $large $split" |
113 | eval "$also "'"$cc -c $ccflags $optimize $large $split"' |
114 | |
115 | . ./config.sh |
116 | |
1c3d792e |
117 | done |
2b317908 |
118 | !NO!SUBS! |
119 | chmod +x cflags |
120 | $eunicefix cflags |