[3181] | 1 | case $PERL_CONFIG_SH in
|
---|
| 2 | '')
|
---|
| 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 | ;;
|
---|
| 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!
|
---|
| 26 | $startsh
|
---|
| 27 | !GROK!THIS!
|
---|
| 28 |
|
---|
| 29 | : In the following dollars and backticks do not need the extra backslash.
|
---|
| 30 | $spitshell >>cflags <<'!NO!SUBS!'
|
---|
| 31 | case $PERL_CONFIG_SH in
|
---|
| 32 | '')
|
---|
| 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 | : syntax: cflags [optimize=XXX] [file[.suffix]]
|
---|
| 46 | : displays the compiler command line for file
|
---|
| 47 |
|
---|
| 48 | case "X$1" in
|
---|
| 49 | Xoptimize=*|X"optimize=*")
|
---|
| 50 | eval "$1"
|
---|
| 51 | shift
|
---|
| 52 | ;;
|
---|
| 53 | esac
|
---|
| 54 |
|
---|
| 55 | also=': '
|
---|
| 56 | case $# in
|
---|
| 57 | 1) also='echo 1>&2 " CCCMD = "'
|
---|
| 58 | esac
|
---|
| 59 |
|
---|
| 60 | case $# in
|
---|
| 61 | 0) set *.c; echo "The current C flags are:" ;;
|
---|
| 62 | esac
|
---|
| 63 |
|
---|
| 64 | set `echo "$* " | sed -e 's/\.[oc] / /g' -e 's/\.obj / /g' -e "s/\\$obj_ext / /g"`
|
---|
| 65 |
|
---|
| 66 | for file do
|
---|
| 67 |
|
---|
| 68 | case "$#" in
|
---|
| 69 | 1) ;;
|
---|
| 70 | *) echo $n " $file.c $c" ;;
|
---|
| 71 | esac
|
---|
| 72 |
|
---|
| 73 | : allow variables like toke_cflags to be evaluated
|
---|
| 74 |
|
---|
| 75 | if echo $file | grep -v / >/dev/null
|
---|
| 76 | then
|
---|
| 77 | eval 'eval ${'"${file}_cflags"'-""}'
|
---|
| 78 | fi
|
---|
| 79 |
|
---|
| 80 | : or customize here
|
---|
| 81 |
|
---|
| 82 | case "$file" in
|
---|
| 83 | DB_File) ;;
|
---|
| 84 | GDBM_File) ;;
|
---|
| 85 | NDBM_File) ;;
|
---|
| 86 | ODBM_File) ;;
|
---|
| 87 | POSIX) ;;
|
---|
| 88 | SDBM_File) ;;
|
---|
| 89 | av) ;;
|
---|
| 90 | byterun) ;;
|
---|
| 91 | deb) ;;
|
---|
| 92 | dl) ;;
|
---|
| 93 | doio) ;;
|
---|
| 94 | doop) ;;
|
---|
| 95 | dump) ;;
|
---|
| 96 | gv) ;;
|
---|
| 97 | hv) ;;
|
---|
| 98 | locale) ;;
|
---|
| 99 | main) ;;
|
---|
| 100 | malloc) ;;
|
---|
| 101 | mg) ;;
|
---|
| 102 | miniperlmain) ;;
|
---|
| 103 | numeric) ;;
|
---|
| 104 | op) ;;
|
---|
| 105 | perl) ;;
|
---|
| 106 | perlapi) ;;
|
---|
| 107 | perlmain) ;;
|
---|
| 108 | perly) ;;
|
---|
| 109 | pp) ;;
|
---|
| 110 | pp_ctl) ;;
|
---|
| 111 | pp_hot) ;;
|
---|
| 112 | pp_pack) ;;
|
---|
| 113 | pp_sys) ;;
|
---|
| 114 | regcomp) ;;
|
---|
| 115 | regexec) ;;
|
---|
| 116 | run) ;;
|
---|
| 117 | scope) ;;
|
---|
| 118 | sv) ;;
|
---|
| 119 | taint) ;;
|
---|
| 120 | toke) ;;
|
---|
| 121 | usersub) ;;
|
---|
| 122 | util) ;;
|
---|
| 123 | *) ;;
|
---|
| 124 | esac
|
---|
| 125 |
|
---|
| 126 | # Add -Wall for the core modules iff gcc and not already -Wall
|
---|
| 127 | warn=''
|
---|
| 128 | case "$gccversion" in
|
---|
| 129 | '') ;;
|
---|
| 130 | Intel*) ;;
|
---|
| 131 | *) case "$ccflags" in
|
---|
| 132 | *-Wall*) ;;
|
---|
| 133 | *) warn="$warn -Wall" ;;
|
---|
| 134 | esac
|
---|
| 135 | case "$gccansipedantic" in
|
---|
| 136 | define)
|
---|
| 137 | case "$gccversion" in
|
---|
| 138 | [12]*) ;; # gcc versions 1 (gasp!) and 2 are not good for this.
|
---|
| 139 | *) case "$osname" in
|
---|
| 140 | # Add -ansi -pedantic only for known platforms.
|
---|
| 141 | aix|dec_osf|freebsd|hpux|irix|linux)
|
---|
| 142 | ansipedantic="-ansi -pedantic" ;;
|
---|
| 143 | solaris)
|
---|
| 144 | # Can't add -ansi for Solaris.
|
---|
| 145 | # Off_t/off_t is a struct in Solaris with largefiles, and with -ansi
|
---|
| 146 | # that struct cannot be compared with a flat integer, such as a STRLEN.
|
---|
| 147 | # The -ansi will also cause a lot of noise in Solaris because of:
|
---|
| 148 | # /usr/include/sys/resource.h:148: warning: `struct rlimit64' declared inside parameter list
|
---|
| 149 | ansipedantic="-pedantic" ;;
|
---|
| 150 | esac
|
---|
| 151 | for i in $ansipedantic
|
---|
| 152 | do
|
---|
| 153 | case "$ccflags" in
|
---|
| 154 | *$i*) ;;
|
---|
| 155 | *) warn="$warn $i" ;;
|
---|
| 156 | esac
|
---|
| 157 | done
|
---|
| 158 | case "$warn$ccflags" in
|
---|
| 159 | *-pedantic*) warn="$warn -DPERL_GCC_PEDANTIC" ;;
|
---|
| 160 | esac
|
---|
| 161 | ;;
|
---|
| 162 | esac
|
---|
| 163 | ;;
|
---|
| 164 | esac
|
---|
| 165 | ;;
|
---|
| 166 | esac
|
---|
| 167 |
|
---|
| 168 | : Can we perhaps use $ansi2knr here
|
---|
| 169 | echo "$cc -c -DPERL_CORE $ccflags $optimize $warn"
|
---|
| 170 | eval "$also "'"$cc -DPERL_CORE -c $ccflags $optimize $warn"'
|
---|
| 171 |
|
---|
| 172 | . $TOP/config.sh
|
---|
| 173 |
|
---|
| 174 | done
|
---|
| 175 | !NO!SUBS!
|
---|
| 176 | chmod 755 cflags
|
---|
| 177 | $eunicefix cflags
|
---|