From: H.Merijn Brand Date: Wed, 9 May 2001 13:12:49 +0000 (+0200) Subject: Re: Less warnings during configure X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7f128676cff088eb9506f79920f3f68dd5210f83;p=p5sagit%2Fp5-mst-13.2.git Re: Less warnings during configure Message-Id: <20010509125337.995D.H.M.BRAND@hccnet.nl> p4raw-id: //depot/perl@10046 --- diff --git a/hints/hpux.sh b/hints/hpux.sh index ebb70ea..59dcdbf 100644 --- a/hints/hpux.sh +++ b/hints/hpux.sh @@ -177,6 +177,35 @@ EOM ### COMPILER SPECIFICS +## Local restrictions (point to README.hpux to lift these) + +## Optimization limits +cat >try.c < + +int main () +{ + struct rlimit rl; + int i = getrlimit (RLIMIT_DATA, &rl); + printf ("%d\n", rl.rlim_cur / (1024 * 1024)); + } /* main */ +EOF +$cc -o try $ccflags $ldflags try.c + maxdsiz=`try` +if [ $maxdsiz -le 64 ]; then + # 64 Mb is probably not enough to optimize toke.c + # and regexp.c with -O2 + cat <&4 +Your kernel limits the data section of your programs to $maxdsiz Mb, +which is (sadly) not enough to fully optimize some parts of the +perl binary. I'll try to use a lower optimization level for +those parts. If you are a sysadmin, and you *do* want full +optimization, raise the 'maxdsiz' kernel configuration parameter +to at least 0x08000000 (128 Mb) and rebuild your kernel. +EOM + exit + fi + case "$ccisgcc" in $define|true|[Yy]) @@ -202,6 +231,16 @@ case "$ccisgcc" in esac ;; esac + if [ $maxdsiz -le 64 ]; then + # 64 Mb is probably not enough to optimize toke.c + # and regexp.c with -O2 + case "$optimize" in + *O2*) opt=`echo "$optimize" | sed -e 's/O2/O1/'` + toke_cflags="$ccflags $opt" + regexec_cflags="$ccflags $opt" + ;; + esac + fi ;; *) # HP's compiler cannot combine -g and -O @@ -209,6 +248,17 @@ case "$ccisgcc" in "") optimize="+O2 +Onolimit" ;; *O[3456789]*) optimize=`echo "$optimize" | sed -e 's/O[3-9]/O2/'` ;; esac + if [ $maxdsiz -le 64 ]; then + # 64 Mb is probably not enough to optimize toke.c + # and regexp.c with -O (+O2) + case "$optimize" in + *-O*|\ + *O2*) opt=`echo "$optimize" | sed -e 's/-O/+O2/' -e 's/O2/O1/' -e 's/ *+Onolimit//'` + toke_cflags="$ccflags $opt" + regexec_cflags="$ccflags $opt" + ;; + esac + fi ld=/usr/bin/ld cccdlflags='+Z' lddlflags='-b +vnocompatwarnings'