Commit | Line | Data |
2b317908 |
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 | ;; |
2b317908 |
13 | esac |
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. |
16 | case "$0" in |
17 | */*) cd `expr X$0 : 'X\(.*\)/'` ;; |
18 | esac |
a0d0e21e |
19 | echo "Extracting x2p/cflags (with variable substitutions)" |
2b317908 |
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. |
14ee6a0a |
24 | rm -f cflags |
2b317908 |
25 | $spitshell >cflags <<!GROK!THIS! |
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 | ;; |
2b317908 |
42 | esac |
43 | |
44 | also=': ' |
45 | case $# in |
46 | 1) also='echo 1>&2 " CCCMD = "' |
47 | esac |
48 | |
49 | case $# in |
50 | 0) set *.c; echo "The current C flags are:" ;; |
51 | esac |
52 | |
4633a7c4 |
53 | set `echo "$* " | sed -e 's/\.[oc] / /g' -e 's/\.obj / /g'` |
2b317908 |
54 | |
55 | for file do |
56 | |
57 | case "$#" in |
58 | 1) ;; |
59 | *) echo $n " $file.c $c" ;; |
60 | esac |
61 | |
62 | : allow variables like str_cflags to be evaluated |
63 | |
64 | eval 'eval ${'"${file}_cflags"'-""}' |
65 | |
66 | : or customize here |
67 | |
68 | case "$file" in |
69 | a2p) ;; |
70 | a2py) ;; |
71 | hash) ;; |
72 | str) ;; |
73 | util) ;; |
74 | walk) ;; |
75 | *) ;; |
76 | esac |
77 | |
a0d0e21e |
78 | ccflags="`echo $ccflags | sed -e 's/-DEMBED//'`" |
79 | |
2b317908 |
80 | echo "$cc -c $ccflags $optimize $large $split" |
81 | eval "$also "'"$cc -c $ccflags $optimize $large $split"' |
82 | |
a0d0e21e |
83 | . $TOP/config.sh |
2b317908 |
84 | |
85 | done |
86 | !NO!SUBS! |
a0d0e21e |
87 | chmod 755 cflags |
2b317908 |
88 | $eunicefix cflags |