This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
While awaiting a good test program to detect the broken gcc.
[perl5.git] / hints / irix_6.sh
index 0f6637b..2c14041 100644 (file)
@@ -121,6 +121,18 @@ malloc_cflags='ccflags="-DSTRICT_ALIGNMENT $ccflags"'
        ccflags="$ccflags -D_BSD_TYPES -D_BSD_TIME -D_POSIX_C_SOURCE"
        optimize="-O3"
        usenm='undef'
+       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
+       # 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"
+               ;;
+       esac
        ;;
 *)
        # this is needed to force the old-32 paths
@@ -130,6 +142,9 @@ malloc_cflags='ccflags="-DSTRICT_ALIGNMENT $ccflags"'
        ;;
 esac
 
+# Don't groan about unused libraries.
+ldflags="$ldflags -Wl,-woff,84"
+
 # 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)
@@ -161,22 +176,23 @@ set `echo X "$libswanted "|sed -e 's/ sun / /' -e 's/ crypt / /' -e 's/ bsd / /'
 shift
 libswanted="$*"
 
-if [ "X$usethreads" = "X$define" -o "X$usethreads" = "Xy" ]; then
-    if test ! -f ${TOOLROOT}/usr/include/pthread.h -o ! -f /usr/lib/libpthread.so; then
-       uname_r=`uname -r`
-       case "`uname -r`" in
-       5*|6.0|6.1)
-           echo >&4 "IRIX $uname_r does not have the POSIX threads."
-           echo >&4 "You should upgrade to at least IRIX 6.2 with pthread patches."
-           echo >&4 "Cannot continue, aborting."
-           exit 1
-           ;;
-       6.2)
-           echo >&4 ""
-cat >&4 <<EOF
-IRIX 6.2 $uname_r can have the POSIX threads.
-The following IRIX patches (or their replacements) must, however, be installed:
-
+# This script UU/usethreads.cbu will get 'called-back' by Configure 
+# after it has prompted the user for whether to use threads.
+cat > UU/usethreads.cbu <<'EOCBU'
+case "$usethreads" in
+$define|true|[yY]*)
+        if test ! -f ${TOOLROOT}/usr/include/pthread.h -o ! -f /usr/lib/libpthread.so; then
+            case "`uname -r`" in
+            [1-5].*|6.[01])
+               cat >&4 <<EOM
+IRIX `uname -r` does not support POSIX threads.
+You should upgrade to at least IRIX 6.2 with pthread patches.
+EOM
+               ;;
+           6.2)
+               cat >&4 <<EOM
+IRIX 6.2 can have the POSIX threads.
+However, the following IRIX patches (or their replacements) MUST be installed:
         1404 Irix 6.2 Posix 1003.1b man pages
         1645 IRIX 6.2 & 6.3 POSIX header file updates
         2000 Irix 6.2 Posix 1003.1b support modules
@@ -186,61 +202,51 @@ IMPORTANT:
        Without patch 2401, a kernel bug in IRIX 6.2 will
        cause your machine to panic and crash when running
        threaded perl. IRIX 6.3 and up should be OK.
-
-
+EOM
+               ;;
+           [67].*)
+               cat >&4 <<EOM
+IRIX `uname -r` should have the POSIX threads.
+But, somehow, you do not seem to have them installed.
+EOM
+               ;;
+           esac
+            cat >&4 <<EOM
 Cannot continue, aborting.
-EOF
-           exit 1
-           ;;
-       6.*|7.*)
-           echo >&4 "IRIX $uname_r should have the POSIX threads."
-           echo >&4 "But somehow you do not seem to have them installed."
-           echo >&4 "Cannot continue, aborting."
-           exit 1
-           ;;
-       esac
-       unset uname_r
-    fi
-    # -lpthread needs to come before -lc but after other libraries such
-    # as -lgdbm and such like. We assume here that -lc is present in
-    # libswanted. If that fails to be true in future, then this can be
-    # changed to add pthread to the very end of libswanted.
-    set `echo X "$libswanted "| sed -e 's/ c / pthread /'`
-    ld="${cc:-cc}"
-    shift
-    libswanted="$*"
-    usemymalloc='n'
-fi
-
-# 64-bitness.
-# jhi@iki.fi, inspired by Scott Henry.
-
-if [ "X$use64bits" = "X$define" ]; then
-    uname_r=`uname -r`
-    case "$uname_r" in
-    [1-5]*|6.[01])
-       echo >&4 "IRIX $uname_r does not support 64-bit types."
-       echo >&4 "You should upgrade to at least IRIX 6.2."
-       exit 1
-       ;;
-    esac
-    case "$ccflags" in
-    *-n32*)
-        ccflags="$ccflags -DUSE_LONG_LONG"
-       archname64="-n32"
-       d_open64="$undef"
-       # In -n32 mode (ILP32LL64) we use the standard open().
-       # In -64 we will use the open64().
-       cat << 'EOM' >&2
-
-You will see a *** WHOA THERE!!! ***  message from Configure for
-d_open64.  Keep the recommended value.  See hints/irix6_2.sh
-for more information.
-
 EOM
-        ;;
-    *-64*)
+            exit 1
+        fi
+        set `echo X "$libswanted "| sed -e 's/ c / pthread /'`
+        ld="${cc:-cc}"
+        shift
+        libswanted="$*"
+
+        usemymalloc='n'
        ;;
-    esac
-    ccflags="$ccflags -DUSE_64_BIT_FILES"
-fi
+esac
+EOCBU
+
+# This script UU/use64bits.cbu will get 'called-back' by Configure 
+# after it has prompted the user for whether to use 64 bits.
+cat > UU/use64bits.cbu <<'EOCBU'
+case "$use64bits" in
+$define|true|[yY]*)
+           case "`uname -r`" in
+           [1-5]*|6.[01])
+               cat >&4 <<EOM
+IRIX `uname -r` does not support 64-bit types.
+You should upgrade to at least IRIX 6.2.
+Cannot continue, aborting.
+EOM
+               exit 1
+               ;;
+           esac
+           case "$ccflags" in
+           *-n32*)
+               ccflags="$ccflags -DUSE_LONG_LONG"
+               archname64="-n32"
+               ;;
+           esac
+           ;;
+esac
+EOCBU