+ test -z "$ldlibpthname" && ldlibpthname='LD_LIBRARYN32_PATH'
+
+ # If a library is requested to link against, make sure the
+ # objects in the library are of the same ABI we are compiling
+ # against. Albert Chin-A-Young <china@thewrittenword.com>
+
+ # In other words, you no longer have to worry regarding having old
+ # library paths (/usr/lib) in the searchpath for -n32 or -64; thank
+ # you very much, Albert! Now if we could just get more module authors
+ # to use something like this... - Allen
+
+ libscheck='case "$xxx" in
+*.a) /bin/ar p $xxx `/bin/ar t $xxx | sed q` >$$.o;
+ case "`/usr/bin/file $$.o`" in
+ *N32*) rm -f $$.o ;;
+ *) rm -f $$.o; xxx=/no/n32$xxx ;;
+ esac ;;
+*) case "`/usr/bin/file $xxx`" in
+ *N32*) ;;
+ *) xxx=/no/n32$xxx ;;
+ esac ;;
+esac'
+
+ # NOTE: -L/usr/lib32 -L/lib32 are automatically selected by the linker
+ test -z "$ldflags" && ldflags=' -L/usr/local/lib32 -L/usr/local/lib'
+ cccdlflags=' '
+ # From: David Billinghurst <David.Billinghurst@riotinto.com.au>
+ # If you get complaints about so_locations then change the following
+ # line to something like:
+ # lddlflags="-n32 -shared -check_registry /usr/lib32/so_locations"
+ test -z "$lddlflags" && lddlflags="-n32 -shared"
+ test -z "$libc" && libc='/usr/lib32/libc.so'
+ test -z "$plibpth" && plibpth='/usr/lib32 /lib32 /usr/ccs/lib'
+
+ # PERL_MALLOC_WRAP gives false alarms ("panic: memory wrap") in IRIX
+ # -n32 mode, resulting in perl compiles never getting further than
+ # miniperl. I am not sure whether it actually does any good in -32 or
+ # -64 mode, especially the latter, but it does not give false
+ # alarms (in testing). -Allen
+
+ usemallocwrap=${usemallocwrap:-false}
+ ;;
+*"cc -64"*)
+ case "`uname -s`" in
+ IRIX)
+ $cat >&4 <<EOM
+You cannot use cc -64 or -Duse64bitall in 32-bit IRIX, sorry.
+Cannot continue, aborting.
+EOM
+ exit 1
+ ;;
+ esac
+ test -z "$ldlibpthname" && ldlibpthname='LD_LIBRARY64_PATH'
+ test -z "$use64bitall" && use64bitall="$define"
+ test -z "$use64bitint" && use64bitint="$define"
+ loclibpth="$loclibpth /usr/lib64"
+ libscheck='case "`/usr/bin/file $xxx`" in
+*64-bit*) ;;
+*) xxx=/no/64-bit$xxx ;;
+esac'
+ # NOTE: -L/usr/lib64 -L/lib64 are automatically selected by the linker
+ test -z "$ldflags" && ldflags=' -L/usr/local/lib64 -L/usr/local/lib'
+ cccdlflags=' '
+ test -z "$archname64" && archname64='64all'
+ # From: David Billinghurst <David.Billinghurst@riotinto.com.au>
+ # If you get complaints about so_locations then change the following
+ # line to something like:
+ # lddlflags="-64 -shared -check_registry /usr/lib64/so_locations"
+ test -z lddlflags="-64 -shared"
+ test -z "$libc" && libc='/usr/lib64/libc.so'
+ test -z "$plibpth" && plibpth='/usr/lib64 /lib64 /usr/ccs/lib'
+ ;;
+*gcc*)
+ ccflags="$ccflags -D_BSD_TYPES -D_BSD_TIME"
+ test -z "$optimize" && optimize="-O3"
+ usenm='undef'
+ # It seems gcc can build Irix shlibs, but of course it needs
+ # -shared. Otherwise you get link errors looking for main().
+ lddlflags="$lddlflags -shared"
+ case "`uname -s`" in
+ # Without the -mabi=64 gcc in 64-bit IRIX has problems passing
+ # and returning small structures. This affects inet_*() and semctl().
+ # See http://groups.google.com/group/comp.sys.sgi.admin/msg/3ad8353bc4ce3cb0
+ # for more information. Reported by Lionel Cons <lionel.cons@cern.ch>.
+ IRIX64) ccflags="$ccflags -mabi=64"
+ ldflags="$ldflags -mabi=64 -L/usr/lib64"
+ lddlflags="$lddlflags -mabi=64"
+ ;;
+ *) ccflags="$ccflags -DIRIX32_SEMUN_BROKEN_BY_GCC"
+ # XXX Note: It is possible that turning off usemallocwrap is
+ # needed here; insufficient data! - Allen
+ ;;
+ esac
+ ;;
+*)
+ # this is needed to force the old-32 paths
+ # since the system default can be changed.
+ ccflags="$ccflags -32 -D_BSD_TYPES -D_BSD_TIME -Olimit 3100"
+ optimize='-O'
+ ;;
+esac
+
+# 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