From: Malcolm Beattie Date: Thu, 20 Nov 1997 12:12:00 +0000 (+0000) Subject: Initial stab at IRIX configuration support for threading. Manually X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=eb1cfdd6b0a7e7a6918084a3828c98f88804c32d;p=p5sagit%2Fp5-mst-13.2.git Initial stab at IRIX configuration support for threading. Manually applied parts of following patches: Subject: Perl 5.004_54 on IRIX Date: Wed, 19 Nov 1997 18:37:14 +0200 (EET) From: Jarkko Hietaniemi Subject: Re: Perl 5.004_54 on IRIX Date: 19 Nov 1997 17:10:17 -0800 From: Scott Henry p4raw-id: //depot/perl@271 --- diff --git a/README.threads b/README.threads index 69bddca..653321a 100644 --- a/README.threads +++ b/README.threads @@ -4,6 +4,7 @@ If you want to build with multi-threading support and you are running Linux 2.x (with the LinuxThreads library installed: that's the linuxthreads and linuxthreads-devel RPMs for RedHat) or Digital UNIX 4.x or Solaris 2.x for recentish x (2.5 is OK) +or IRIX 6.2 or newer (6.2 will require a few os patches), then you should be able to use ./Configure -Dusethreads -Doptimize=-g -ders make @@ -42,6 +43,19 @@ For Digital Unix 4.x: Zap mallocobj and mallocsrc (foo='') Change d_mymalloc to undef For Solaris, do the same as for Linux above. +For IRIX: + Add -DUSE_THREADS -DDEBUGGING to ccflags + Add -DUSE_THREADS -DDEBUGGING to cppflags + Add -lpthread to libs + Change optimize to -g + For IRIX 6.2, you have to have the following patches 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 + 2254 Pthread library fixes + For IRIX 6.3 and 6.4 the pthreads should work out of the box. + Thanks to Hannu Napari for the IRIX + pthreads patches information. Now you can do a make diff --git a/hints/irix_6.sh b/hints/irix_6.sh index 795b6ab..1ae1ca5 100644 --- a/hints/irix_6.sh +++ b/hints/irix_6.sh @@ -20,6 +20,9 @@ # Tweaked by Chip Salzenberg on 5/13/97 # - don't assume 'cc -n32' if the n32 libm.so is missing +# Threaded by Jarkko Hietaniemi on 11/18/97 +# - POSIX threads knowledge by IRIX version + # 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. @@ -112,3 +115,49 @@ libswanted="$*" set `echo X "$libswanted "|sed -e 's/ sun / /' -e 's/ crypt / /' -e 's/ bsd / /' -e 's/ PW / /'` shift libswanted="$*" + +if [ "X$usethreads" != "X" ]; then + if test ! -f /usr/include/pthread.h -o ! -f /usr/lib/libpthread.so; then + uname_r=`uname -r` + case "`uname -r`" in + 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.3." + echo >&4 "Cannot continue, aborting." + exit 1 + ;; + 6.2) + echo >&4 "" +cat >&4 <&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 + ccflags="-DUSE_THREADS $ccflags" + cppflags="-DUSE_THREADS $cppflags" + # -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" + shift + libswanted="$*" +fi diff --git a/hints/irix_6_0.sh b/hints/irix_6_0.sh index 38fe27d..e76890d 100644 --- a/hints/irix_6_0.sh +++ b/hints/irix_6_0.sh @@ -41,3 +41,11 @@ libswanted="$*" # set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ sun / /' -e 's/ crypt / /' -e 's/ nsl / /' -e 's/ dl / /'` # shift # libswanted="$*" + +if [ "X$usethreads" != "X" ]; then + echo >&4 "IRIX 6.0 does not have POSIX threads." + echo >&4 "You should upgrade to at least IRIX 6.3." + echo >&4 "Cannot continue, aborting." + exit 1 +fi + diff --git a/hints/irix_6_1.sh b/hints/irix_6_1.sh index 38fe27d..91c3ef8 100644 --- a/hints/irix_6_1.sh +++ b/hints/irix_6_1.sh @@ -41,3 +41,10 @@ libswanted="$*" # set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ sun / /' -e 's/ crypt / /' -e 's/ nsl / /' -e 's/ dl / /'` # shift # libswanted="$*" + +if [ "X$usethreads" != "X" ]; then + echo >&4 "IRIX 6.1 does not have POSIX threads." + echo >&4 "You should upgrade to at least IRIX 6.3." + echo >&4 "Cannot continue, aborting." + exit 1 +fi diff --git a/perl.h b/perl.h index 431ac96..9facb91 100644 --- a/perl.h +++ b/perl.h @@ -113,7 +113,7 @@ register struct op *op asm(stringify(OP_IN_REGISTER)); # define STANDARD_C 1 #endif -#if defined(__cplusplus) || defined(WIN32) +#if defined(__cplusplus) || defined(WIN32) || defined(__sgi) # define DONT_DECLARE_STD 1 #endif @@ -1375,7 +1375,7 @@ EXT struct thread * thr; /* Currently executing (fake) thread */ /* VMS doesn't use environ array and NeXT has problems with crt0.o globals */ #if !defined(VMS) && !(defined(NeXT) && defined(__DYNAMIC__)) -#if !defined(DONT_DECLARE_STD) || (defined(__svr4__) && defined(__GNUC__) && defined(sun)) +#if !defined(DONT_DECLARE_STD) || (defined(__svr4__) && defined(__GNUC__) && defined(sun)) || defined(__sgi) extern char ** environ; /* environment variables supplied via exec */ #endif #else