From: François Désarménien Date: Wed, 3 Feb 1999 13:13:24 +0000 (+0000) Subject: 5.005_54 (hints) SCO 3/5 hint files and SysV correction X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e8523c57a20f7ef87c4d43878806bdd97b9f1403;p=p5sagit%2Fp5-mst-13.2.git 5.005_54 (hints) SCO 3/5 hint files and SysV correction To: Mailing list Perl5 Message-ID: <36B84B74.5EC9B6C8@club-internet.fr> (note: this patch completely overrides Tom Wolfe's patch, change #2604) p4raw-link: @2604 on //depot/cfgperl: 0a6b11f8fedc4bae957f03efab3ecb64338ce939 p4raw-id: //depot/cfgperl@2810 --- diff --git a/MANIFEST b/MANIFEST index d405a13..9b93d44 100644 --- a/MANIFEST +++ b/MANIFEST @@ -229,6 +229,7 @@ ext/GDBM_File/GDBM_File.pm GDBM extension Perl module ext/GDBM_File/GDBM_File.xs GDBM extension external subroutines ext/GDBM_File/Makefile.PL GDBM extension makefile writer ext/GDBM_File/typemap GDBM extension interface types +ext/GDBM_File/hints/sco.pl Hint for GDBM_File for named architecture ext/IO/ChangeLog IO perl module change log ext/IO/IO.pm Top-level interface to IO::* classes ext/IO/IO.xs IO extension external subroutines diff --git a/ext/GDBM_File/hints/sco.pl b/ext/GDBM_File/hints/sco.pl new file mode 100644 index 0000000..5c74a77 --- /dev/null +++ b/ext/GDBM_File/hints/sco.pl @@ -0,0 +1,2 @@ +# SCO OSR5 needs to link with libc.so again to have C defined +$self->{LIBS} = ['-lgdbm -lc']; diff --git a/ext/IPC/SysV/SysV.xs b/ext/IPC/SysV/SysV.xs index e6c7555..0605918 100644 --- a/ext/IPC/SysV/SysV.xs +++ b/ext/IPC/SysV/SysV.xs @@ -15,7 +15,7 @@ # include # endif # ifdef HAS_SHM -# if defined(PERL_SCO5) || defined(PERL_ISC) +# if defined(PERL_SCO) || defined(PERL_ISC) # include /* SHMLBA */ # endif # include diff --git a/hints/sco.sh b/hints/sco.sh index 1323cab..eb59845 100644 --- a/hints/sco.sh +++ b/hints/sco.sh @@ -1,42 +1,188 @@ # sco.sh # Courtesy of Joel Rosi-Schwartz - +############################################################### # Additional SCO version info from # Peter Wolfe -# Last revised # Fri Jul 19 14:54:25 EDT 1996 # and again Tue Sep 29 16:37:25 EDT 1998 # by Andy Dougherty - +# Mostly rewritten on +# Tue Jan 19 23:00:00 CET 1999 +# by Francois Desarmenien +############################################################### +# +# To use cc, use sh Configure # To use gcc, use sh Configure -Dcc=gcc -# To use icc, use sh Configure -Dcc=icc +# +# Default on 3.2v4 is to use static link (dynamic loading unsupported). +# Default on 3.2v5 is to use dynamic loading. +# To use static linkink instead, use to sh Configure -Dusedl=n +# +# Warning: - to use dynamic loading with gcc, you need gcc 2.8.0 or later +# ******** - to compile with older releases of gcc, use Configure -Dusedl=n +# or it wont compile properly +# +############################################################### +# NOTES: +# ----- +# +# I Have removed inclusion of ODBM_File for OSR5 +# because it core dumps and make tests fails. +# +# Support for icc compiler has been removed, because it 'breaks' +# a lot of code :-( +# +# It's *always* a good idea to first make a static link to be sure to +# have all symbols resolved with the current choice of libraries, since +# with dynamic linking, unresolved symbols are allowed an will be detected +# only at runtime (when you try to load the module or worse, when you call +# the symbol) +# +# The best choice of compiler on OSR 5 (3.2v5.*) seems to be gcc >= 2.8.0: +# -You cannot optimize with genuine sco cc (miniperl core dumps), +# so Perl is faster if compiled with gcc. +# -Even optimized for speed, gcc generated code is smaller (!!!) +# -gcc is free +# -I use ld to link which is distributed with the core OS distribution, so you +# don't need to buy the developement kit, just find someone kind enough to +# give you a binary release of gcc. +# +# +############################################################### # figure out what SCO version we are. The output of uname -X is # something like: # System = SCO_SV # Node = xxxxx # Release = 3.2v5.0.0 # KernelID = 95/08/08 -# Machine = Pentium +# Machine = Pentium # BusType = ISA # Serial = xxxxx # Users = 5-user # OEM# = 0 # Origin# = 1 -# NumCPU = 1 +# NumCPU = 1 # Use /bin/uname (because GNU uname may be first in $PATH and # it does not support -X) to figure out what SCO version we are: -case `/bin/uname -X | egrep '^Release'` in -*3.2v4.*) scorls=3 ;; # I don't know why this is 3 instead of 4. -*3.2v5.*) scorls=5 ;; -*) scorls=5 ;; # Hope the future will be compatible. +# Matching '^Release' is broken by locale setting: +# matching '3.2v' should be enough -- FD +case `/bin/uname -X | egrep '3\.2v'` in +*3.2v4.*) scorls=3 ;; # OSR 3 +*3.2v5.*) scorls=5 ;; # OSR 5 +*) + # Future of SCO OSR is SCO UnixWare: there should not be new OSR releases + echo "************************************************************" >&4 + echo "" >&4 + echo " sco.sh hints file only supports:" >&4 + echo "" >&4 + echo " - SCO Unix 3.2v4.x (OSR 3)" >&4 + echo " - SCO Unix 3.2v5.x (OSR 5)" >&4 + echo "" >&4 + echo "" >&4 + echo " For UnixWare, use svr4.sh hints instead" >&4 + echo "" >&4 + echo "***********************************************************" >&4 + exit +;; esac +############################################################### +# Common fixes for all compilers an releases: + +############################################################### +# What is true for SCO5 is true for SCO3 too today, so let's have a single +# symbol for both +ccflags="-U M_XENIX -D PERL_SCO" + +############################################################### +# Compilers options section: +if test "$scorls" = "3" +then + dlext='' + case "$cc" in + gcc) optimize='-O2' ;; + *) ccflags="$ccflags -W0 -quiet" + optimize='-O' ;; + esac +else + ############################################################### + # Need this in release 5 because of changed fpu exeption rules + ccflags="$ccflags -D PERL_SCO5" + + ############################################################### + # In Release 5, always compile ELF objects + case "$cc" in + gcc) + ccflags="$ccflags -melf" + optimize='-O2' + ;; + *) + ccflags="$ccflags -w0 -belf" + optimize='-O0' + ;; + esac + ############################################################### + # Dynamic loading section: + # + # We use ld to build shared libraries as it is always available + # and seems to work better than GNU's one on SCO + # + # ccdlflags : must tell the linker to export all global symbols + # cccdlflags: must tell the compiler to generate relocatable code + # lddlflags : must tell the linker to output a shared library + # + # /usr/local/lib is added for convenience, since 'foreign' libraries + # are usually put there in sco + # + if test "$usedl" != "n"; then + ld='ld' + case "$cc" in + gcc) + ccdlflags='-Xlinker -Bexport -L/usr/local/lib' + cccdlflags='-fpic' + lddlflags='-G -L/usr/local/lib' + ;; + *) + ccdlflags='-Bexport -L/usr/local/lib' + cccdlflags='-Kpic' + lddlflags='-G -L/usr/local/lib' + ;; + esac + + ############################################################### + # Use dynamic loading + usedl='define' + dlext='so' + dlsrc='dl_dlopen.xs' + + ############################################################### + # Force to define those symbols, as they are #defines and not + # catched by Configure, and they are useful + d_dlopen='define' + d_dlerror='define' + fi +fi + + +############################################################### +# Various hints, common to all releases, to have it work better: + +############################################################### +# We need to remove libdl, as libdl.so exists, but ld complains +# it can't find libdl.a ! Bug or feature ? :-) +libswanted=`echo " $libswanted " | sed -e 's/ dl / /'` +set X $libswanted +shift +libswanted="$*" + +############################################################### # Try to use libintl.a since it has strcoll and strxfrm libswanted="intl $libswanted" + +############################################################### # Try to use libdbm.nfs.a since it has dbmclose. -# if test -f /usr/lib/libdbm.nfs.a ; then libswanted=`echo "dbm.nfs $libswanted " | sed -e 's/ dbm / /'` set X $libswanted @@ -44,64 +190,19 @@ if test -f /usr/lib/libdbm.nfs.a ; then libswanted="$*" fi +############################################################### +# We disable ODBM_File if OSR5 because it's mostly broken +# but keep it for ODT3 as it seems to work. +if test "$scorls" = "5"; then + i_dbm='undef' +fi + +############################################################### # We don't want Xenix cross-development libraries glibpth=`echo $glibpth | sed -e 's! /usr/lib/386 ! !' -e 's! /lib/386 ! !'` xlibpth='' -# Common fix for all compilers. -ccflags="$ccflags -U M_XENIX" - -# Set flags for optimization and warning levels. -case "$cc" in -*gcc*) case "$optimize" in - '') optimize='-O2' ;; - esac - ;; -scocc) ;; # Anybody know anything about this? -*) # icc or cc -- only relevant difference is safe level of - # optimization. Apparently. - case $scorls in - 3) ccflags="$ccflags -W0 -quiet" ;; - *) ccflags="$ccflags -w0 -DPERL_SCO5" ;; - esac - case "$optimize" in - '') case "$cc" in - icc) optimize="-O1" ;; - *) optimize="-O0" ;; - esac - ;; - esac - ;; -esac - -# DYNAMIC LOADING: Dynamic loading won't work with scorls=3. -# It ought to work with Release = 3.2v5.0.0 or later. -if test "$scorls" = "3" -a "X$usedl" = "X"; then - usedl=$undef -else - # I do not know exactly which of these are essential, - # but this set has been recommended. --AD - # These ought to be patched back into metaconfig, but the - # current metaconfig units don't touch ccflags. - # Unfortunately, the default on SCO is to produce COFF output, but - # ELF is needed for dynamic loading, and the cc man page recommends - # "Always specify option -b elf if ELF and COFF files might be mixed." - # Therefore, we'll compile everything with -b elf. - case "$cc" in - *gcc*) ;; - *) ccflags="$ccflags -b elf" ;; - esac - cccdlflags=none - ccdlflags='-W l,-Bexport' - lddlflags="$lddlflags -b elf -G" - ldflags="$ldflags -b elf -W l,-Bexport" - dlext='so' - dlsrc='dl_dlopen.xs' - d_dlerror='define' - d_dlopen='define' - usedl='define' -fi - +############################################################### # I have received one report that nm extraction doesn't work if you're # using the scocc compiler. This system had the following 'myconfig' # uname='xxx xxx 3.2 2 i386 ' @@ -111,15 +212,22 @@ case "$usenm" in '') usenm='false' ;; esac +############################################################### # If you want to use nm, you'll probably have to use nm -p. The # following does that for you: nm_opt='-p' +############################################################### # I have received one report that you can't include utime.h in # pp_sys.c. Uncomment the following line if that happens to you: # i_utime=undef +############################################################### # Perl 5.003_05 and later try to include both and # in pp_sys.c, but that fails due to a redefinition of struct timeval. # This will generate a WHOA THERE. Accept the default. i_sysselct=$undef + + +############################################################### +#END of hint file