This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Merge pull request #65 from tonycoz/compiler-find-quadmath
[metaconfig.git] / U / modified / libs.U
index 1cfb66c..bccb6b3 100644 (file)
@@ -1,11 +1,11 @@
 ?RCS: $Id: libs.U,v 3.0.1.6 1997/02/28 16:09:11 ram Exp $
 ?RCS:
 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
-?RCS: 
-?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic License,
 ?RCS: as specified in the README file that comes with the distribution.
 ?RCS: You may reuse parts of this distribution only within the terms of
-?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: that same Artistic License; a copy of which may be found at the root
 ?RCS: of the source tree for dist 3.0.
 ?RCS:
 ?RCS: $Log: libs.U,v $
@@ -65,7 +65,7 @@
 ?X:
 ?X: This order is chosen so that libraries  -lndir, -ldir, -lucb, -lbsd,
 ?X: -lBSD, -lPW, and -lx only get used if there are unresolved
-?X: routines at link time.  Usually, these are backwards compatability
+?X: routines at link time.  Usually, these are backwards compatibility
 ?X: libraries, and may not be as reliable as the standard c library.
 ?X:
 ?X: The -lsocket -linet -lnsl order has been reported to be necessary
@@ -88,8 +88,8 @@
 ?INIT:libswanted=''
 ?INIT:: some systems want to use only the non-versioned libso:s
 ?INIT:ignore_versioned_solibs=''
+?LINT:extern usecbacktrace
 ?LINT:extern libscheck
-?LINT:use libscheck
 ?LINT:extern p
 ?LINT:use uselongdouble
 : Looking for optional libraries
@@ -103,10 +103,13 @@ case "$libswanted" in
 '') libswanted='c_s';;
 esac
 ?X: libsocks has nasty naming scheme.
-?X: This does not work if somebody wants SOCKS 4. 
+?X: This does not work if somebody wants SOCKS 4.
 case "$usesocks" in
 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
 esac
+case "$usecbacktrace" in
+"$define") libswanted="$libswanted bfd" ;;
+esac
 libsfound=''
 libsfiles=''
 libsdirs=''
@@ -121,12 +124,25 @@ for thislib in $libswanted; do
                xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
                $test -f "$xxx" && eval $libscheck
                $test -f "$xxx" && libstyle=shared
+               xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
+               $test -f "$xxx" && eval $libscheck
+               $test -f "$xxx" && libstyle=shared
+           fi
+           if test ! -f "$xxx"; then
+               xxx=$thisdir/lib$thislib.$so$_a
+               $test -f "$xxx" && eval $libscheck
+               $test -f "$xxx" && libstyle="import"
+           fi
+           if test ! -f "$xxx"; then
+               xxx=$thisdir/$thislib.$so$_a
+               $test -f "$xxx" && eval $libscheck
+               $test -f "$xxx" && libstyle="import"
            fi
            if test ! -f "$xxx"; then
                xxx=$thisdir/lib$thislib.$so
                $test -f "$xxx" && eval $libscheck
                $test -f "$xxx" && libstyle=shared
-           fi  
+           fi
            if test ! -f "$xxx"; then
                xxx=$thisdir/lib$thislib$_a
                $test -f "$xxx" && eval $libscheck
@@ -157,18 +173,18 @@ for thislib in $libswanted; do
                case " $dflt " in
                *"-l$thislib "*);;
                *) dflt="$dflt -l$thislib"
-                   libsfound="$libsfound $xxx"
-                   yyy=`basename $xxx`
-                   libsfiles="$libsfiles $yyy"
-                   yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
-                   case " $libsdirs " in
-                   *" $yyy "*) ;;
-                   *) libsdirs="$libsdirs $yyy" ;;
-                   esac
+                  libsfound="$libsfound $xxx"
+                  yyy=`basename $xxx`
+                  libsfiles="$libsfiles $yyy"
+                  yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
+                  case " $libsdirs " in
+                  *" $yyy "*) ;;
+                  *) libsdirs="$libsdirs $yyy" ;;
+                  esac
                   ;;
                esac
                break
-           fi  
+           fi
        done
        if $test ! -f "$xxx"; then
            echo "No -l$thislib."