Commit | Line | Data |
aa275be2 |
1 | case $PERL_CONFIG_SH in |
2b317908 |
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 |
beb210ef |
17 | */cflags.SH) cd `expr X$0 : 'X\(.*\)/'` ;; |
18 | cflags.SH) ;; |
19 | *) case `pwd` in |
20 | */x2p) ;; |
21 | *) if test -d x2p; then cd x2p |
22 | else echo "Can't figure out where to write output."; exit 1 |
23 | fi;; |
24 | esac;; |
2b317908 |
25 | esac |
a0d0e21e |
26 | echo "Extracting x2p/cflags (with variable substitutions)" |
2b317908 |
27 | : This section of the file will have variable substitutions done on it. |
28 | : Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!. |
29 | : Protect any dollar signs and backticks that you do not want interpreted |
30 | : by putting a backslash in front. You may delete these comments. |
14ee6a0a |
31 | rm -f cflags |
2b317908 |
32 | $spitshell >cflags <<!GROK!THIS! |
33 | !GROK!THIS! |
34 | |
35 | : In the following dollars and backticks do not need the extra backslash. |
36 | $spitshell >>cflags <<'!NO!SUBS!' |
aa275be2 |
37 | case $PERL_CONFIG_SH in |
2b317908 |
38 | '') |
a0d0e21e |
39 | if test -f config.sh; then TOP=.; |
40 | elif test -f ../config.sh; then TOP=..; |
41 | elif test -f ../../config.sh; then TOP=../..; |
42 | elif test -f ../../../config.sh; then TOP=../../..; |
43 | elif test -f ../../../../config.sh; then TOP=../../../..; |
44 | else |
45 | echo "Can't find config.sh."; exit 1 |
46 | fi |
47 | . $TOP/config.sh |
48 | ;; |
2b317908 |
49 | esac |
50 | |
40fee945 |
51 | case "X$1" in |
52 | Xoptimize=*|X"optimize=*") |
53 | eval "$1" |
54 | shift |
55 | ;; |
56 | esac |
57 | |
2b317908 |
58 | also=': ' |
59 | case $# in |
60 | 1) also='echo 1>&2 " CCCMD = "' |
61 | esac |
62 | |
63 | case $# in |
64 | 0) set *.c; echo "The current C flags are:" ;; |
65 | esac |
66 | |
578789a7 |
67 | set `echo "$* " | sed -e 's/\.[oc] / /g' -e 's/\.obj / /g' -e "s/\\$obj_ext / /g"` |
2b317908 |
68 | |
69 | for file do |
70 | |
71 | case "$#" in |
72 | 1) ;; |
73 | *) echo $n " $file.c $c" ;; |
74 | esac |
75 | |
76 | : allow variables like str_cflags to be evaluated |
77 | |
78 | eval 'eval ${'"${file}_cflags"'-""}' |
79 | |
80 | : or customize here |
81 | |
82 | case "$file" in |
83 | a2p) ;; |
84 | a2py) ;; |
85 | hash) ;; |
86 | str) ;; |
87 | util) ;; |
88 | walk) ;; |
89 | *) ;; |
90 | esac |
91 | |
760ac839 |
92 | ccflags="`echo $ccflags | sed -e 's/-DMULTIPLICITY//'`" |
a0d0e21e |
93 | |
5869b1f1 |
94 | echo "$cc -c $ccflags $optimize" |
95 | eval "$also "'"$cc -c $ccflags $optimize"' |
2b317908 |
96 | |
a0d0e21e |
97 | . $TOP/config.sh |
2b317908 |
98 | |
99 | done |
100 | !NO!SUBS! |
a0d0e21e |
101 | chmod 755 cflags |
2b317908 |
102 | $eunicefix cflags |