1 case $PERL_CONFIG_SH in
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=../../../..;
9 echo "Can't find config.sh."; exit 1
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.
17 */*) cd `expr X$0 : 'X\(.*\)/'` ;;
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.
25 $spitshell >cflags <<!GROK!THIS!
29 : In the following dollars and backticks do not need the extra backslash.
30 $spitshell >>cflags <<'!NO!SUBS!'
31 case $PERL_CONFIG_SH in
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=../../../..;
39 echo "Can't find config.sh."; exit 1
46 Xoptimize=*|X"optimize=*")
53 optdebug='' # ensure -g used if building a -DDEBUGGING libperl
56 *perl.*) perltype='';;
57 *perld.*) perltype='-DDEBUGGING'; optdebug='-g' ;;
58 *perle.*) perltype='-DEMBED';;
59 *perlde.*) perltype='-DDEBUGGING -DEMBED'; optdebug='-g' ;;
60 *perlm.*) perltype='-DEMBED -DMULTIPLICITY';;
61 *perldm.*) perltype='-DDEBUGGING -DEMBED -DMULTIPLICITY'; optdebug='-g' ;;
68 1) also='echo 1>&2 " CCCMD = "'
72 0) set *.c; echo "The current C flags are:" ;;
75 set `echo "$* " | sed -e 's/\.[oc] / /g' -e 's/\.obj / /g' -e "s/\\$obj_ext / /g"`
81 *) echo $n " $file.c $c" ;;
84 : allow variables like toke_cflags to be evaluated
86 if echo $file | grep -v / >/dev/null
88 eval 'eval ${'"${file}_cflags"'-""}'
137 if test "X$optdebug" != "X"; then
141 # Add -Wall for the core and core modules iff gcc and not already -Wall
143 case "$gccversion" in
145 *) case "$ccflags" in
147 # Can't add -ansi here because it will fail e.g. in Solaris.
148 # Off_t/off_t is a struct in Solaris with largefiles, and with -ansi
149 # that struct cannot be compared with a flat integer, such as a STRLEN.
150 # The -ansi will also cause a lot of noise in Solaris because of:
151 # /usr/include/sys/resource.h:148: warning: `struct rlimit64' declared inside parameter list
157 : Can we perhaps use $ansi2knr here
158 echo "$cc -c -DPERL_CORE $ccflags $optimize $warn $perltype"
159 eval "$also "'"$cc -DPERL_CORE -c $ccflags $optimize $warn $perltype"'