summaryrefslogtreecommitdiff
path: root/hints
diff options
context:
space:
mode:
authorH.Merijn Brand <h.m.brand@xs4all.nl>2001-05-09 15:12:49 +0200
committerJarkko Hietaniemi <jhi@iki.fi>2001-05-09 10:49:34 +0000
commit7f128676cff088eb9506f79920f3f68dd5210f83 (patch)
treec23db6ab242c4ab885c90dae8d2f03d2056cd2d9 /hints
parenta1063b2d347f61fd47f71876da72ed835b315f8a (diff)
downloadperl-7f128676cff088eb9506f79920f3f68dd5210f83.tar.gz
Re: Less warnings during configure
Message-Id: <20010509125337.995D.H.M.BRAND@hccnet.nl> p4raw-id: //depot/perl@10046
Diffstat (limited to 'hints')
-rw-r--r--hints/hpux.sh50
1 files changed, 50 insertions, 0 deletions
diff --git a/hints/hpux.sh b/hints/hpux.sh
index ebb70ead6e..59dcdbf26a 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 <<EOF
+#include <sys/resource.h>
+
+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 <<EOM >&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'