+# Settings common to both native compiler modes.
+case "$cc" in
+*"cc -n32"*|*"cc -64"*)
+ test -z "$ld" && ld=$cc
+
+ # perl's malloc can return improperly aligned buffer
+ # which (under 5.6.0RC1) leads into really bizarre bus errors
+ # and freak test failures (lib/safe1 #18, for example),
+ # even more so with -Duse64bitall: for example lib/io_linenumtb.
+ # fails under the harness but succeeds when run separately,
+ # under make test pragma/warnings #98 fails, and lib/io_dir
+ # apparently coredumps (the last two don't happen under
+ # the harness. Helmut Jarausch is seeing bus errors from
+ # miniperl, as was Scott Henry with snapshots from just before
+ # the RC1. --jhi
+ usemymalloc='undef'
+
+ # Was at the first of the line - Allen
+ #malloc_cflags='ccflags="-DSTRICT_ALIGNMENT $ccflags"'
+
+ nm_opt="$nm_opt -p"
+ nm_so_opt="$nm_so_opt -p"
+
+ # Warnings to turn off because the source code hasn't
+ # been cleaned up enough yet to satisfy the IRIX cc.
+ # 1184: "=" is used where where "==" may have been intended.
+ # 1552: The variable "foobar" is set but never used.
+ woff=1184,1552
+
+ # Perl 5.004_57 introduced new qsort code into pp_ctl.c that
+ # makes IRIX cc prior to 7.2.1 to emit bad code.
+ # so some serious hackery follows to set pp_ctl flags correctly.
+
+ # Check for which version of the compiler we're running
+ case "`$cc -version 2>&1`" in
+ *7.0*) # Mongoose 7.0
+ ccflags="$ccflags -D_BSD_TYPES -D_BSD_TIME -woff $woff -OPT:Olimit=0"
+ optimize='none'
+ ;;
+ *7.1*|*7.2|*7.20) # Mongoose 7.1+
+ ccflags="$ccflags -D_BSD_TYPES -D_BSD_TIME -woff $woff"
+ case "$optimize" in
+ '') optimize='-O3 -OPT:Olimit=0' ;;
+ '-O') optimize='-O3 -OPT:Olimit=0' ;;
+ *) ;;
+ esac
+
+ # This is a temporary fix for 5.005+.
+ # See hints/README.hints, especially the section
+ # =head2 Propagating variables to config.sh
+
+ # Note the part about case statements not working without
+ # weirdness like the below echo statement... and, since
+ # we're in a callback unit, it's to config.sh, not UU/config.sh
+ # - Allen
+
+
+ pp_ctl_cflags="$pp_ctl_flags optimize=\"$optimize -O1\""
+ echo "pp_ctl_cflags=\"$pp_ctl_flags optimize=\\\"\$optimize -O1\\\"\"" >> config.sh
+ ;;
+
+
+
+# XXX What is space=ON doing in here? Could someone ask Scott Henry? - Allen
+
+ *7.*) # Mongoose 7.2.1+
+ ccflags="$ccflags -D_BSD_TYPES -D_BSD_TIME -woff $woff"
+ case "$optimize" in
+ '') optimize='-O3 -OPT:Olimit=0:space=ON' ;;
+ '-O') optimize='-O3 -OPT:Olimit=0:space=ON' ;;
+ *) ;;
+ esac
+ ;;
+ *6.2*) # Ragnarok 6.2
+ ccflags="$ccflags -D_BSD_TYPES -D_BSD_TIME -woff $woff"
+ optimize='none'
+ ;;
+ *) # Be safe and not optimize
+ ccflags="$ccflags -D_BSD_TYPES -D_BSD_TIME -woff $woff"
+ optimize='none'
+ ;;
+ esac
+
+# this is to accommodate the 'modules' capability of the
+# 7.2 MIPSPro compilers, which allows for the compilers to be installed
+# in a nondefault location. Almost everything works as expected, but
+# /usr/include isn't caught properly. Hence see the /usr/include/pthread.h
+# change below to include TOOLROOT (a modules environment variable),
+# and the following code. Additional
+# code to accommodate the 'modules' environment should probably be added
+# here if possible, or be inserted as a ${TOOLROOT} reference before
+# absolute paths (again, see the pthread.h change below).
+# -- krishna@sgi.com, 8/23/98
+
+ if [ "X${TOOLROOT}" != "X" ]; then
+ # we cant set cppflags because it gets overwritten
+ # we dont actually need $TOOLROOT/usr/include on the cc line cuz the
+ # modules functionality already includes it but
+ # XXX - how do I change cppflags in the hints file?
+ ccflags="$ccflags -I${TOOLROOT}/usr/include"
+ usrinc="${TOOLROOT}/usr/include"
+ fi
+
+ ;;
+esac
+
+# workaround for an optimizer bug
+# Made to work via UU/config.sh thing (or, rather, config.sh, since we're in
+# a callback) from README.hints, plus further stuff; doesn't handle -g still,
+# unfortunately - Allen
+case "`$cc -version 2>&1`" in
+*7.2.*)
+ test -z "$op_cflags" && echo "op_cflags=\"optimize=\\\"\$optimize -O1\\\"\"" >> config.sh
+ test -z "$op_cflags" && op_cflags="optimize=\"\$optimize -O1\""
+ test -z "$opmini_cflags" && echo "opmini_cflags=\"optimize=\\\"\$optimize -O1\\\"\"" >> config.sh
+ test -z "$opmini_cflags" && opmini_cflags="optimize=\"\$optimize -O1\""
+ ;;
+*7.3.1.*)
+ test -z "$op_cflags" && echo "op_cflags=\"optimize=\\\"\$optimize -O2\\\"\"" >> config.sh
+ test -z "$op_cflags" && op_cflags="$op_cflags optimize=\"\$optimize -O2\""
+ test -z "$opmini_cflags" && echo "opmini_cflags=\"optimize=\\\"\$optimize -O2\\\"\"" >> config.sh
+ test -z "$opmini_cflags" && opmini_cflags="optimize=\"\$optimize -O2\""
+ ;;
+esac
+
+
+# Workaround [perl #33849]: perl 5.8.6 fails to build on IRIX 6.5 due to
+# bizarre preprocessor bug: cc -E - unfortunately goes into K&R mode, but
+# cc -E file.c doesn't. Force a wrapper to always get the ANSI mode.
+# (We only need to do this for cc, not for gcc. ccversion is computed above.)
+case "$ccversion" in
+'') ;; # gcc. Do nothing.
+*) # Inside this call-back unit, we are down in the UU/ subdirectory,
+ # but Configure will look for cppstdin one level up.
+ cd ..; cppstdin=`pwd`/cppstdin; cd UU
+ cpprun="$cppstdin"
+ ;;
+esac
+
+EOCCBU
+
+# End of cc.cbu callback unit. - Allen
+
+# We don't want these libraries.
+# Socket networking is in libc, these are not installed by default,
+# and just slow perl down. (scotth@sgi.com)
+# librt contains nothing we need (some places need it for Time::HiRes) --jhi
+set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ nsl / /' -e 's/ dl / /' -e 's/ rt / /'`