Unroll the libs scan thanks to HP-UX.
authorJarkko Hietaniemi <jhi@iki.fi>
Tue, 15 Feb 2000 05:22:09 +0000 (05:22 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Tue, 15 Feb 2000 05:22:09 +0000 (05:22 +0000)
p4raw-id: //depot/cfgperl@5092

Configure
hints/hpux.sh

index d72e1c4..dcf088c 100755 (executable)
--- 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 Mon Feb 14 06:52:21 EET 2000 [metaconfig 3.0 PL70]
+# Generated on Tue Feb 15 03:52:41 EET 2000 [metaconfig 3.0 PL70]
 # (with additional metaconfig patches by perlbug@perl.com)
 
 cat >/tmp/c1$$ <<EOF
@@ -949,10 +949,11 @@ loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
 
 : general looking path for locating libraries
-glibpth="/shlib /usr/shlib /lib/pa20_64 /lib/pa1.1 /usr/lib/large"
-glibpth="$glibpth /lib /usr/lib $xlibpth"
+glibpth="/usr/lib/large /lib/pa1.1 /lib /usr/lib $xlibpth"
 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
+test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
+test -f /shlib/libc.so     && glibpth="/shlib $glibpth"
 
 : Private path used by Configure to find libraries.  Its value
 : is prepended to libpth. This variable takes care of special
@@ -3697,32 +3698,47 @@ $define)
        ;;
 esac
 for thislib in $libswanted; do
-       
-       libname="$thislib"
-       if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`
-          $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X" ; then
-               libstyle=shared
-       elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
-               libstyle=shared
-       elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
-               libstyle=static
-       elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
-               libstyle=static
-       elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
-               libstyle=static
-               libname=${thislib}_s
-       elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
-               libstyle="static"
-       fi
-       if $test -f "$xxx"; then
+       for thisdir in $libpth; do
+           xxx=''
+           if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
+               xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
+               $test -f "$xxx" && eval $libscheck
+               $test -f "$xxx" && libstyle=shared
+           fi
+           if test ! -f "$xxx"; then
+               xxx=$thisdir/lib$thislib.$so
+               $test -f "$xxx" && eval $libscheck
+               $test -f "$xxx" && libstyle=shared
+           fi  
+           if test ! -f "$xxx"; then
+               xxx=$thisdir/lib$thislib$_a
+               $test -f "$xxx" && eval $libscheck
+               $test -f "$xxx" && libstyle=static
+           fi
+           if test ! -f "$xxx"; then
+               xxx=$thisdir/$thislib$_a
+               $test -f "$xxx" && eval $libscheck
+               $test -f "$xxx" && libstyle=static
+           fi
+           if test ! -f "$xxx"; then
+               xxx=$thisdir/lib${thislib}_s$_a
+               $test -f "$xxx" && eval $libscheck
+               $test -f "$xxx" && libstyle=static
+           fi
+           if test ! -f "$xxx"; then
+               xxx=$thisdir/Slib$thislib$_a
+               $test -f "$xxx" && eval $libscheck
+               $test -f "$xxx" && libstyle=static
+           fi
+           if $test -f "$xxx"; then
                case "$libstyle" in
-               shared) echo "Found -l$libname (shared)." ;;
-               static) echo "Found -l$libname." ;;
-               *)      echo "Found -l$libname ($libstyle)." ;;
+               shared) echo "Found -l$thislib (shared)." ;;
+               static) echo "Found -l$thislib." ;;
+               *)      echo "Found -l$thislib ($libstyle)." ;;
                esac
                case " $dflt " in
                *"-l$thislib "*);;
-               *) dflt="$dflt -l$libname"
+               *) dflt="$dflt -l$thislib"
                    libsfound="$libsfound $xxx"
                    yyy=`basename $xxx`
                    libsfiles="$libsfiles $yyy"
@@ -3733,8 +3749,11 @@ for thislib in $libswanted; do
                    esac
                   ;;
                esac
-       else
-               echo "No -l$thislib."
+               break
+           fi  
+       done
+       if $test ! -f "$xxx"; then
+           echo "No -l$thislib."
        fi
 done
 set X $dflt
@@ -6026,7 +6045,7 @@ EOM
     case "$lddlflags" in
     '') case "$osname" in
                        beos) dflt='-nostart' ;;
-                       hpux)  dflt='-b' ;;
+                       hpux)  dflt='-b +vnocompatwarnings' ;;
                        linux|irix*)    dflt='-shared' ;;
                        next)  dflt='none' ;;
                        solaris) dflt='-G' ;;
@@ -14216,12 +14235,30 @@ for xxx in $known_extensions ; do
                ;;
        NDBM_File|ndbm_fil)
                case "$i_ndbm" in
-               $define) avail_ext="$avail_ext $xxx" ;;
+               $define)
+                   case "$osname-$use64bits" in
+                   hpux-define)
+                       case "$libs" in
+                       *-lndbm*) avail_ext="$avail_ext $xxx" ;;
+                       esac
+                       ;;
+                   *) avail_ext="$avail_ext $xxx" ;;
+                   esac
+                   ;;
                esac
                ;;
        ODBM_File|odbm_fil) 
                case "${i_dbm}${i_rpcsvcdbm}" in
-               *"${define}"*) avail_ext="$avail_ext $xxx" ;;
+               *"${define}"*)
+                   case "$osname-$use64bits" in
+                   hpux-define)
+                       case "$libs" in
+                       *-ldbm*) avail_ext="$avail_ext $xxx" ;;
+                       esac
+                       ;;
+                   *) avail_ext="$avail_ext $xxx" ;;
+                   esac
+                   ;;
                esac
                ;;
        POSIX|posix)
index 426ff59..467ceb9 100644 (file)
@@ -61,7 +61,7 @@
 #
 # Lastly, you may want to include the "-z" HP linker flag so that
 # reading from a NULL pointer causes a SEGV.
-ccflags="$ccflags -D_HPUX_SOURCE"
+ccflags="$ccflags -D_HPUX_SOURCE -Wl,-z"
 
 # Check if you're using the bundled C compiler.  This compiler doesn't support
 # ANSI C (the -Aa flag) nor can it produce shared libraries.  Thus we have
@@ -316,14 +316,18 @@ Cannot continue, aborting.
 EOM
                exit 1
        fi
-        ccflags="$ccflags +DD64"
-        ldflags="$ldflags +DD64"
+
        ld=/usr/bin/ld
        ar=/usr/bin/ar
-       loclibpth="/lib/pa20_64 $loclibpth"
+       full_ar=$ar
 
         # The strict ANSI mode (-Aa) doesn't like the LL suffixes.
-       ccflags=`echo $ccflags|sed 's@ -Aa @ -Ae @'`
+       case "$ccflags" in
+       *-Aa*)
+           echo "(Changing from strict ANSI compilation to extended because of 64-bitness)"
+           ccflags=`echo $ccflags|sed 's@ -Aa @ -Ae @'`
+           ;;
+       esac    
 
        set `echo " $libswanted " | sed -e 's@ dl @ @'`
        libswanted="$*"
@@ -332,6 +336,22 @@ EOM
 esac
 EOCBU
 
+case "$use64bits" in
+$define|true|[yY]*)
+    glibpth="`echo $glibpth|sed 's: /lib/pa1.1 : /lib/pa20_64 :'`"
+    ccflags="$ccflags +DD64"
+    ldflags="$ldflags +DD64"
+    libscheck='case "`file $xxx`" in
+*LP64*|*PA-RISC2.0*) ;;
+*) xxx=/no/64-bit$xxx ;;
+esac'
+      ;;
+esac
+
+case "`getconf KERNEL_BITS 2>/dev/null`" in
+*64*) ldflags="$ldflags -Wl,+vnocompatwarnings" ;;
+esac
+
 # This script UU/uselfs.cbu will get 'called-back' by Configure 
 # after it has prompted the user for whether to use 64 bits.
 cat > UU/uselfs.cbu <<'EOCBU'
@@ -342,8 +362,14 @@ $define|true|[yY]*)
        ccflags="$ccflags -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
 
         # The strict ANSI mode (-Aa) doesn't like large files.
-       ccflags=`echo $ccflags|sed 's@ -Aa @ -Ae @'`
+       case "$ccflags" in
+       *-Aa*)
+           echo "(Changing from strict ANSI compilation to extended because of large files)"
+           ccflags=`echo $ccflags|sed 's@ -Aa @ -Ae @'`
+           ;;
+       esac    
        ;;
 esac
 EOCBU
 
+