Getting perlio and threads to compile
Lupe Christoph [Wed, 9 Aug 2000 11:35:54 +0000 (13:35 +0200)]
Message-ID: <20000809113554.G23160@alanya.lupe-christoph.de>

(the Solaris version changes in Configure skipped)

p4raw-id: //depot/perl@6594

hints/solaris_2.sh
thread.h

index 21b0b0e..4e5d6fa 100644 (file)
@@ -328,8 +328,12 @@ case "$usethreads" in
 $define|true|[yY]*)
         ccflags="-D_REENTRANT $ccflags"
 
-        # sched_yield is in -lposix4
-        set `echo X "$libswanted "| sed -e 's/ c / posix4 pthread c /'`
+        # sched_yield is in -lposix4 up to Solaris 2.6, in -lrt starting with Solaris 7
+       case `uname -r` in
+       5.[0-6] | 5.5.1) sched_yield_lib="posix4" ;;
+       *) sched_yield_lib="rt";
+       esac
+        set `echo X "$libswanted "| sed -e "s/ c / $sched_yield_lib pthread c /"`
         shift
         libswanted="$*"
 
@@ -354,7 +358,7 @@ $define|true|[yY]*)
            siglongjmp(env, 2);
        }
 EOM
-        if test "`arch`" = i86pc -a "$osvers" = 2.6 && \
+        if test "`arch`" = i86pc -a `uname -r` = 5.6 && \
            ${cc:-cc} try.c -lpthread >/dev/null 2>&1 && ./a.out; then
            d_sigsetjmp=$undef
            cat << 'EOM' >&2
index f7ab18c..206a5c5 100644 (file)
--- a/thread.h
+++ b/thread.h
 #  define ALLOC_THREAD_KEY \
     STMT_START {                                               \
        if (pthread_key_create(&PL_thr_key, 0)) {               \
-           fprintf(stderr, "panic: pthread_key_create");       \
+           PerlIO_printf(PerlIO_stderr(), "panic: pthread_key_create");        \
            exit(1);                                            \
        }                                                       \
     } STMT_END