This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
optimise Perl_sv_gets(): use memchr() for loop
[perl5.git] / hints / irix_6.sh
index e0f77ac..832fde2 100644 (file)
@@ -3,7 +3,7 @@
 # original from Krishna Sethuraman, krishna@sgi.com
 #
 # Modified Mon Jul 22 14:52:25 EDT 1996
-#      Andy Dougherty <doughera@lafcol.lafayette.edu>
+#      Andy Dougherty <doughera@lafayette.edu>
 #      with help from Dean Roehrich <roehrich@cray.com>.
 #   cc -n32 update info from Krishna Sethuraman, krishna@sgi.com.
 #       additional update from Scott Henry, scotth@sgi.com
@@ -26,6 +26,8 @@
 
 # 64-bitty by Jarkko Hietaniemi on 9/1998
 
+# Martin Pool added -shared for gcc on 2004-01-27
+
 # Use   sh Configure -Dcc='cc -n32' to try compiling with -n32.
 #     or -Dcc='cc -n32 -mips3' (or -mips4) to force (non)portability
 # Don't bother with -n32 unless you have the 7.1 or later compilers.
@@ -39,6 +41,9 @@
 # The compiler bug has been reported to SGI.
 # -- Allen Smith <allens@cpan.org>
 
+# Modified (10/30/04) to turn off usemallocwrap (PERL_MALLOC_WRAP) in -n32
+# mode - Allen.
+
 case "$use64bitall" in
 $define|true|[yY]*)
     case "`uname -s`" in
@@ -97,7 +102,12 @@ $cat > UU/cc.cbu <<'EOCCBU'
 # has prompted the user for the C compiler to use.
 
 case "$cc" in
-*gcc*) ;;
+*gcc*)
+  # With cc we can use -c99, but with gcc we just can't use C99 headers.
+  # (There is a hidden define __c99 that cc uses, but trying to use that
+  # with gcc leads into magnificent explosions.)
+  i_stdint='undef'
+  ;;
 *) ccversion=`cc -version 2>&1` ;;
 esac
 
@@ -138,7 +148,15 @@ esac'
        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)
@@ -173,16 +191,21 @@ esac'
        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://reality.sgi.com/ariel/freeware/gcc-2.8.1-notes.html
+       # 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
        ;;
@@ -219,6 +242,7 @@ case "$cc" in
 
        # Warnings to turn off because the source code hasn't
        # been cleaned up enough yet to satisfy the IRIX cc.
+       # 1047: macro redefinitions (in IRIX' own system headers!)
        # 1184: "=" is used where where "==" may have been intended.
        # 1552: The variable "foobar" is set but never used.
        woff=1184,1552
@@ -266,6 +290,9 @@ case "$cc" in
                '-O') optimize='-O3 -OPT:Olimit=0:space=ON' ;;
                *) ;;
             esac
+           # Perl source has just grown too chummy with c99
+           # (headerwise, not code-wise: we use <stdint.h> and such)
+           ccflags="$ccflags -c99"
             ;;
        *6.2*)                        # Ragnarok 6.2
             ccflags="$ccflags -D_BSD_TYPES -D_BSD_TIME -woff $woff"
@@ -319,6 +346,40 @@ case "`$cc -version 2>&1`" in
     ;;
 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
+
+# There is a devious bug in the MIPSpro 7.4 compiler:
+# memcmp() is an inlined intrinsic, and "sometimes" it gets compiled wrong.
+#
+# In Perl the most obvious hit is regcomp.c:S_regpposixcc(),
+# causing bus errors when compiling the POSIX character classes like
+# /[[:digit:]], which means that miniperl cannot build perl.
+# (That is almost only the one victim: one single test in re/pat fails, also.)
+#
+# Therefore let's turn the inline intrinsics off and let the normal
+# libc versions be used instead. This may cause a performance hit
+# but a little slower is better than zero speed.
+#
+# MIPSpro C 7.4.1m is supposed to have fixed this bug.
+#
+case "$ccversion" in
+"MIPSpro Compilers: Version 7.4")
+  ccflags="$ccflags -U__INLINE_INTRINSICS"
+  ;;
+esac
+
 EOCCBU
 
 # End of cc.cbu callback unit. - Allen
@@ -376,6 +437,10 @@ case "$ldflags" in
     *) ldflags="$ldflags -Wl,-woff,84" ;;
 esac
 
+# IRIX freeware kits sometimes have only o32 libraries for gdbm.
+# You can try Configure ... -Dlibswanted='m' -Dnoextensions='GDBM_File'
+# since the libm seems to be pretty much the only really needed library.
+
 # Irix 6.5.6 seems to have a broken header <sys/mode.h>
 # don't include that (it doesn't contain S_IFMT, S_IFREG, et al)
 
@@ -613,3 +678,11 @@ EOCBU
 # Helmut Jarausch reports that Perl's malloc is rather unusable
 # with IRIX, and SGI confirms the problem.
 usemymalloc=${usemymalloc:-false}
+
+# Configure finds <fcntl.h> but then thinks it can use <sys/file.h>
+# instead; in IRIX this is not true because the prototype of fcntl()
+# requires explicit include of <fcntl.h>
+i_fcntl=define
+
+# There is <prctl.h> but it's not the Linux one that Configure expects.
+d_prctl="$undef"