From: Jarkko Hietaniemi Date: Sat, 9 Jan 1999 16:17:13 +0000 (+0000) Subject: Move usethreads and use64bits logic from hints to Configure. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b691c02f8c79b7bac4a606da95849c0c7bcae239;p=p5sagit%2Fp5-mst-13.2.git Move usethreads and use64bits logic from hints to Configure. p4raw-id: //depot/cfgperl@2592 --- diff --git a/Configure b/Configure index e9d0ce8..1d99afe 100755 --- a/Configure +++ b/Configure @@ -20,7 +20,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Fri Jan 8 17:24:49 EET 1999 [metaconfig 3.0 PL70] +# Generated on Sat Jan 9 18:00:39 EET 1999 [metaconfig 3.0 PL70] # (with additional metaconfig patches by jhi@iki.fi) cat >/tmp/c1$$ <&4 "Switching cc to xlc_r because of POSIX threads." + cc=xlc_r + ;; + '') + cc=xlc_r + ;; + *) + cat >&4 <&4 +POSIX threads are not supported by default on FreeBSD $osvers. Follow the +instructions in 'man pthread' to build and install the needed libraries. +EOM + exit 1 + fi + set `echo X "$libswanted "| sed -e 's/ c / c_r /'` + shift + libswanted="$*" + # Configure will probably pick the wrong libc to use for nm + # scan. + # The safest quick-fix is just to not use nm at all. + usenm=false + ;; + *) cat <<'EOM' >&4 + +It is not known if FreeBSD $osvers supports POSIX threads or not. +Consider upgrading to the latest STABLE release. + +EOM + exit 1 + ;; + esac + ;; + hpux) + if [ "$xxOsRevMajor" -lt 10 ]; then + cat <&4 +HP-UX $xxOsRevMajor cannot support POSIX threads. +Consider upgrading to at least HP-UX 11. +Cannot continue, aborting. +EOM + exit 1 + fi + case "$xxOsRevMajor" in + 10) + # Under 10.X, a threaded perl can be built, but it needs + # libcma and OLD_PTHREADS_API. Also needs to + # be #included before any other includes (in perl.h) + if [ ! -f /usr/include/pthread.h -o ! -f /usr/lib/libcma.sl ]; then + cat <&4 +In HP-UX 10.X for POSIX threads you need both of the files +/usr/include/pthread.h and /usr/lib/libcma.sl. +Either you must install the CMA package or you must upgrade to HP-UX 11. +Cannot continue, aborting. +EOM + exit 1 + fi + + # HP-UX 10.X uses the old pthreads API + case "$d_oldpthreads" in + '') d_oldpthreads="$define" ;; + esac + + # include libcma before all the others + libswanted="cma $libswanted" + + # tell perl.h to include before other include files + ccflags="$ccflags -DPTHREAD_H_FIRST" + + # CMA redefines select to cma_select, and cma_select expects int * + # instead of fd_set * (just like 9.X) + selecttype='int *' + ;; + 11 | 12) # 12 may want upping the _POSIX_C_SOURCE + ccflags="$ccflags -D_POSIX_C_SOURCE=199506L" + libswanted="$libswanted pthread" + ;; + esac + ;; + irix) + if test ! -f ${TOOLROOT}/usr/include/pthread.h -o ! -f /usr/lib/libpthread.so; then + case "`uname -r`" in + [1-5].*|6.[01]|6.[01]) + cat >&4 <&4 <&4 <&4 < for this report. + # Sun BugID is 4117946, "sigsetjmp always returns 1 when called by + # siglongjmp in a MT program". As of 19980622, there is no patch + # available. + cat >try.c <<'EOM' + /* Test for sig(set|long)jmp bug. */ + #include + + main() + { + sigjmp_buf env; + int ret; + + ret = sigsetjmp(env, 1); + if (ret) { return ret == 2; } + siglongjmp(env, 2); + } +EOM + if test "`arch`" = i86pc -a "$osvers" = 2.6 && \ + ${cc:-cc} try.c -lpthread >/dev/null 2>&1 && ./a.out; then + d_sigsetjmp=$undef + cat << 'EOM' >&2 + +You will see a *** WHOA THERE!!! *** message from Configure for +d_sigsetjmp. Keep the recommended value. See hints/solaris_2.sh +for more information. + +EOM + fi + ;; + vmesa) + ;; + *) + cat >&4 <&4 +64-bit compilation is not supported on HP-UX $xxOsRevMajor. +You need at least HP-UX 11.0. +Cannot continue, aborting. +EOM + exit 1 + fi + if [ ! -d /lib/pa20_64 ]; then + cat <&4 +You do not seem to have the 64-bit libraries, /lib/pa20_64. +Cannot continue, aborting. +EOM + exit 1 + fi + ccflags="$ccflags +DD64 -D_FILE_OFFSET_BITS=64" + ldflags="$ldflags +DD64" + ld=/usr/bin/ld + set `echo " $libswanted " | sed -e 's@ dl @ @'` + libswanted="$*" + glibpth="/lib/pa20_64" + ;; + irix) + case "`uname -r`" in + [1-5]*|6.[01]) + cat >&4 <&2 + +You will see a *** WHOA THERE!!! *** message from Configure for +d_open64. Keep the recommended value. See hints/irix6.sh +for more information. + +EOM + ;; + esac + ccflags="$ccflags -DUSE_64_BIT_FILES" + ;; + solaris) + case "`uname -r`" in + 1.*|2.[1-5]) + cat >&4 <&4 <&4 < -case "$_DEC_uname_r" in +case "$`uname -r`" in *[123].*) # old loader lddlflags="$lddlflags -O3" ;; @@ -165,7 +160,7 @@ esac # As noted above the -DDEBUGGING is added automagically by Configure if -g. case "$optimize" in *-g*) ;; # left intentionally blank -*) case "$_DEC_uname_r" in +*) case "$`uname -r`" in *[123].*) case "$useshrplib" in false|undef|'') lddlflags="$lddlflags -s" ;; @@ -177,19 +172,6 @@ case "$optimize" in ;; esac -if [ "X$usethreads" = "X$define" ]; then - # Threads interfaces changed with V4.0. - case "$_DEC_uname_r" in - *[123].*) libswanted="$libswanted pthreads mach exc c_r" - ccflags="-threads $ccflags" - ;; - *) libswanted="$libswanted pthread exc" - ccflags="-pthread $ccflags" - ;; - esac - usemymalloc='n' -fi - # # Make embedding in things like INN and Apache more memory friendly. # Keep it overridable on the Configure command line, though, so that @@ -214,7 +196,6 @@ pp_sys_cflags='ccflags="$ccflags -DNO_EFF_ONLY_OK"' # unset _DEC_cc_style -unset _DEC_uname_r # # History: diff --git a/hints/dos_djgpp.sh b/hints/dos_djgpp.sh index 73bae63..94c09d0 100644 --- a/hints/dos_djgpp.sh +++ b/hints/dos_djgpp.sh @@ -52,8 +52,3 @@ sitearch=$sitelib eagain='EAGAIN' rd_nodata='-1' -if [ "X$usethreads" = "X$define" ]; then - set `echo X "$libswanted "| sed -e 's/ c / gthreads c /'` - shift - libswanted="$*" -fi diff --git a/hints/freebsd.sh b/hints/freebsd.sh index 65ea8c5..d638462 100644 --- a/hints/freebsd.sh +++ b/hints/freebsd.sh @@ -130,42 +130,6 @@ problem. Try EOM -# XXX EXPERIMENTAL A.D. 03/09/1998 -# XXX This script UU/usethreads.cbu will get 'called-back' by Configure -# XXX after it has prompted the user for whether to use threads. -cat > UU/usethreads.cbu <<'EOSH' -case "$usethreads" in -$define) - case "$osvers" in - 3.0*) ldflags="-pthread $ldflags" - ;; - 2.2*) if [ ! -r /usr/lib/libc_r ]; then - cat <<'EOM' >&4 -POSIX threads are not supported by default on FreeBSD $uname_r. Follow the -instructions in 'man pthread' to build and install the needed libraries. -EOM - exit 1 - fi - set `echo X "$libswanted "| sed -e 's/ c / c_r /'` - shift - libswanted="$*" - # Configure will probably pick the wrong libc to use for nm - # scan. - # The safest quick-fix is just to not use nm at all. - usenm=false - ;; - *) cat <<'EOM' >&4 -It is not known if FreeBSD $uname_r supports POSIX threads or not. Consider -upgrading to the latest STABLE release. -EOM - exit 1 - ;; - esac - ;; -esac -EOSH -# XXX EXPERIMENTAL --end of call-back - # From: Anton Berezin # To: perl5-porters@perl.org # Subject: [PATCH 5.005_54] Configure - hints/freebsd.sh signal handler type diff --git a/hints/hpux.sh b/hints/hpux.sh index fa0d7fc..ceef5a3 100644 --- a/hints/hpux.sh +++ b/hints/hpux.sh @@ -139,37 +139,6 @@ else selecttype='int *' fi -# Under 10.X, a threaded perl can be built, but it needs -# libcma and OLD_PTHREADS_API. Also needs to -# be #included before any other includes (in perl.h) -if [ "$xxOsRevMajor" -eq 10 -a "X$usethreads" = "X$define" ]; then - - if [ ! -f /usr/include/pthread.h -o ! -f /usr/lib/libcma.sl ]; then - cat <&4 -In HP-UX 10.X for threads you need both the files -/usr/include/pthread.h and /usr/lib/libcma.sl. - -Either you must install the CMA package or you must upgrade to HP-UX 11. -EOM - exit 1 - fi - - # HP-UX 10.X uses the old pthreads API - case "$d_oldpthreads" in - '') d_oldpthreads="$define" ;; - esac - - # include libcma before all the others - libswanted="cma $libswanted" - - # tell perl.h to include before other include files - ccflags="$ccflags -DPTHREAD_H_FIRST" - - # CMA redefines select to cma_select, and cma_select expects int * - # instead of fd_set * (just like 9.X) - selecttype='int *' -fi - # Remove bad libraries that will cause problems # (This doesn't remove libraries that don't actually exist) # -lld is unneeded (and I can't figure out what it's used for anyway) @@ -224,28 +193,3 @@ esac # assembler of the form: # (warning) Use of GR3 when frame >= 8192 may cause conflict. # These warnings are harmless and can be safely ignored. - -# 64-bitness. -# jhi@iki.fi, inspired by Jeff Okamoto. - -if [ X"$use64bits" = X"$define" ]; then - if [ "$xxOsRevMajor" -lt 11 ]; then - cat <&4 -64-bit compilation is not supported on HP-UX $xxOsRevMajor. -You need at least HP-UX 11.0. -EOM - exit 1 - fi - if [ ! -d /lib/pa20_64 ]; then - cat <&4 -You do not seem to have the 64-bit libraries, /lib/pa20_64. -EOM - exit 1 - fi - ccflags="$ccflags +DD64 -D_FILE_OFFSET_BITS=64" - ldflags="$ldflags +DD64" - ld=/usr/bin/ld - set `echo " $libswanted " | sed -e 's@ dl @ @'` - libswanted="$*" - glibpth="/lib/pa20_64" -fi diff --git a/hints/irix_6.sh b/hints/irix_6.sh index 515a94f..8f4dbd6 100644 --- a/hints/irix_6.sh +++ b/hints/irix_6.sh @@ -161,86 +161,3 @@ 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 <&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.sh -for more information. - -EOM - ;; - *-64*) - ;; - esac - ccflags="$ccflags -DUSE_64_BIT_FILES" -fi diff --git a/hints/irix_6_0.sh b/hints/irix_6_0.sh index b0a3994..38fe27d 100644 --- a/hints/irix_6_0.sh +++ b/hints/irix_6_0.sh @@ -41,11 +41,3 @@ 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$define" ]; 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 1c54f77..38fe27d 100644 --- a/hints/irix_6_1.sh +++ b/hints/irix_6_1.sh @@ -41,10 +41,3 @@ 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$define" ]; 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/hints/linux.sh b/hints/linux.sh index b34967b..9b69e9b 100644 --- a/hints/linux.sh +++ b/hints/linux.sh @@ -216,21 +216,3 @@ fi # it should be: # ccdlflags='-Wl,-E' -# XXX EXPERIMENTAL A.D. 2/27/1998 -# XXX This script UU/usethreads.cbu will get 'called-back' by Configure -# XXX after it has prompted the user for whether to use threads. -cat > UU/usethreads.cbu <<'EOSH' -case "$usethreads" in -$define|true|[yY]*) - ccflags="-D_REENTRANT $ccflags" - # -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 c /'` - shift - libswanted="$*" - ;; -esac -EOSH -# XXX EXPERIMENTAL --end of call-back diff --git a/hints/os2.sh b/hints/os2.sh index 58086c5..0560175 100644 --- a/hints/os2.sh +++ b/hints/os2.sh @@ -250,15 +250,6 @@ nm_opt='-p' d_getprior='define' d_setprior='define' -if [ "X$usethreads" = "X$define" ]; then - ccflags="-Zmt $ccflags" - cppflags="-Zmt $cppflags" # Do we really need to set this? - aout_ccflags="-DUSE_THREADS $aout_ccflags" - aout_cppflags="-DUSE_THREADS $aout_cppflags" - aout_lddlflags="-Zmt $aout_lddlflags" - aout_ldflags="-Zmt $aout_ldflags" -fi - # The next two are commented. pdksh handles #!, extproc gives no path part. # sharpbang='extproc ' # shsharp='false' diff --git a/hints/solaris_2.sh b/hints/solaris_2.sh index 7bee52a..e518540 100644 --- a/hints/solaris_2.sh +++ b/hints/solaris_2.sh @@ -261,70 +261,6 @@ rm -f core # XXX EOSH -if [ "X$usethreads" = "X$define" ]; then - ccflags="-D_REENTRANT $ccflags" - # -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. - # sched_yield is in -lposix4 - set `echo X "$libswanted "| sed -e 's/ c / posix4 pthread c /'` - shift - libswanted="$*" - - # On Solaris 2.6 x86 there is a bug with sigsetjmp() and siglongjmp() - # when linked with the threads library, such that whatever positive value - # you pass to siglongjmp(), sigsetjmp() returns 1. - # Thanks to Simon Parsons for this report. - # Sun BugID is 4117946, "sigsetjmp always returns 1 when called by - # siglongjmp in a MT program". As of 19980622, there is no patch - # available. - cat >try.c <<'EOM' - /* Test for sig(set|long)jmp bug. */ - #include - - main() - { - sigjmp_buf env; - int ret; - - ret = sigsetjmp(env, 1); - if (ret) { return ret == 2; } - siglongjmp(env, 2); - } -EOM - if test "`arch`" = i86pc -a "$osvers" = 2.6 \ - && ${cc:-cc} try.c -lpthread >/dev/null 2>&1 && ./a.out; then - d_sigsetjmp=$undef - cat << 'EOM' >&2 - -You will see a *** WHOA THERE!!! *** message from Configure for -d_sigsetjmp. Keep the recommended value. See hints/solaris_2.sh -for more information. - -EOM - fi -fi - -# 64-bitness -# jhi@iki.fi, inspired by Alan Burlison. - -if [ "X$use64bits" = "X$define" ]; then - uname_r=`uname -r` - case "$uname_r" in - 1.*|2.[1-5]) - echo >&4 "Solaris $uname_r does not support 64-bit types." - echo >&4 "You should upgrade to at least Solaris 2.6." - exit 1 - ;; - esac - ccflags="$ccflags `getconf LFS_CFLAGS` -DUSE_LONG_LONG" - ldflags="$ldflags `getconf LFS_LDFLAGS`" - libswanted="$libswanted `getconf LFS_LIBS`" - # When a 64-bit cc becomes available $archname64 may need setting - # so that $archname gets it attached. -fi - # This is just a trick to include some useful notes. cat > /dev/null <<'End_of_Solaris_Notes' diff --git a/hints/vmesa.sh b/hints/vmesa.sh index 54fa5e7..bc03387 100644 --- a/hints/vmesa.sh +++ b/hints/vmesa.sh @@ -1,7 +1,12 @@ # hints/vmesa.sh # # VM/ESA hints by Neale Ferguson (neale@mailbox.tabnsw.com.au) - +# +# Currently (1999-Jan-09) Configure cannot be used in VM/ESA because +# too many things are done differently in the C compiler environment. +# Therefore the hints file is hand-crafted. --jhi@iki.fi +# + case "$archname" in '') archname="$osname" ;; esac