[9008] | 1 | case $CONFIG in |
---|
| 2 | '') |
---|
[10723] | 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 | ;; |
---|
[9008] | 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 |
---|
| 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 | rm -f cflags |
---|
| 25 | $spitshell >cflags <<!GROK!THIS! |
---|
[10723] | 26 | $startsh |
---|
[9008] | 27 | !GROK!THIS! |
---|
| 28 | |
---|
| 29 | : In the following dollars and backticks do not need the extra backslash. |
---|
| 30 | $spitshell >>cflags <<'!NO!SUBS!' |
---|
[14544] | 31 | case $CONFIGDOTSH in |
---|
[9008] | 32 | '') |
---|
[10723] | 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 | ;; |
---|
[9008] | 43 | esac |
---|
| 44 | |
---|
[10723] | 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 ;; |
---|
| 57 | esac |
---|
| 58 | |
---|
[9008] | 59 | also=': ' |
---|
| 60 | case $# in |
---|
| 61 | 1) also='echo 1>&2 " CCCMD = "' |
---|
| 62 | esac |
---|
| 63 | |
---|
| 64 | case $# in |
---|
| 65 | 0) set *.c; echo "The current C flags are:" ;; |
---|
| 66 | esac |
---|
| 67 | |
---|
[14544] | 68 | set `echo "$* " | sed -e 's/\.[oc] / /g' -e 's/\.obj / /g' -e "s/\\$obj_ext / /g"` |
---|
[9008] | 69 | |
---|
| 70 | for file do |
---|
| 71 | |
---|
| 72 | case "$#" in |
---|
| 73 | 1) ;; |
---|
| 74 | *) echo $n " $file.c $c" ;; |
---|
| 75 | esac |
---|
| 76 | |
---|
| 77 | : allow variables like toke_cflags to be evaluated |
---|
| 78 | |
---|
[14544] | 79 | if echo $file | grep -v / >/dev/null |
---|
| 80 | then |
---|
| 81 | eval 'eval ${'"${file}_cflags"'-""}' |
---|
| 82 | fi |
---|
[9008] | 83 | |
---|
| 84 | : or customize here |
---|
| 85 | |
---|
| 86 | case "$file" in |
---|
[10723] | 87 | DB_File) ;; |
---|
| 88 | GDBM_File) ;; |
---|
| 89 | NDBM_File) ;; |
---|
| 90 | ODBM_File) ;; |
---|
| 91 | POSIX) ;; |
---|
| 92 | SDBM_File) ;; |
---|
| 93 | av) ;; |
---|
[14544] | 94 | byterun) ;; |
---|
[10723] | 95 | deb) ;; |
---|
| 96 | dl) ;; |
---|
[9008] | 97 | doio) ;; |
---|
[10723] | 98 | doop) ;; |
---|
[9008] | 99 | dump) ;; |
---|
[10723] | 100 | gv) ;; |
---|
| 101 | hv) ;; |
---|
| 102 | main) ;; |
---|
[9008] | 103 | malloc) ;; |
---|
[10723] | 104 | mg) ;; |
---|
| 105 | miniperlmain) ;; |
---|
| 106 | op) ;; |
---|
[9008] | 107 | perl) ;; |
---|
[14544] | 108 | perlapi) ;; |
---|
[10723] | 109 | perlmain) ;; |
---|
[9008] | 110 | perly) ;; |
---|
[10723] | 111 | pp) ;; |
---|
| 112 | pp_ctl) ;; |
---|
| 113 | pp_hot) ;; |
---|
| 114 | pp_sys) ;; |
---|
[9008] | 115 | regcomp) ;; |
---|
| 116 | regexec) ;; |
---|
[10723] | 117 | run) ;; |
---|
| 118 | scope) ;; |
---|
| 119 | sv) ;; |
---|
| 120 | taint) ;; |
---|
[9008] | 121 | toke) ;; |
---|
| 122 | usersub) ;; |
---|
| 123 | util) ;; |
---|
| 124 | *) ;; |
---|
| 125 | esac |
---|
| 126 | |
---|
[10723] | 127 | if test "X$optdebug" != "X"; then |
---|
| 128 | optimize="$optdebug" |
---|
| 129 | fi |
---|
[9008] | 130 | |
---|
[14544] | 131 | : Can we perhaps use $ansi2knr here |
---|
[10723] | 132 | echo "$cc -c -DPERL_CORE $ccflags $optimize $perltype $large $split" |
---|
| 133 | eval "$also "'"$cc -DPERL_CORE -c $ccflags $optimize $perltype $large $split"' |
---|
[9008] | 134 | |
---|
[10723] | 135 | . $TOP/config.sh |
---|
| 136 | |
---|
[9008] | 137 | done |
---|
| 138 | !NO!SUBS! |
---|
[10723] | 139 | chmod 755 cflags |
---|
[9008] | 140 | $eunicefix cflags |
---|