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