diff options
Diffstat (limited to 'mk')
-rw-r--r-- | mk/buildlink2/fake-la | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/mk/buildlink2/fake-la b/mk/buildlink2/fake-la index 09d975dad10..a663671ccbd 100644 --- a/mk/buildlink2/fake-la +++ b/mk/buildlink2/fake-la @@ -1,7 +1,8 @@ -#!@BUILDLINK_SHELL@ +#!/bin/sh # -# $NetBSD: fake-la,v 1.6 2003/09/15 21:52:51 skrll Exp $ +# $NetBSD: fake-la,v 1.7 2003/12/03 18:37:35 erh Exp $ +AR="@AR@" AWK="@AWK@" BASENAME="@BASENAME@" CC="@CC@" @@ -47,6 +48,34 @@ case $libname in libbase=`${ECHO} $libname | ${SED} -e "s/\.[0-9.]*\.dylib$//"` version=`${ECHO} $libname | ${SED} -e "s/^[^.]*\.\([0-9]*\.[0-9]*\)\.dylib/\1/;s/\./:/g"` ;; + *.a) + libbase=`${ECHO} $libname | ${SED} -e "s/\.a$//"` + ltlib="$realdir/$libbase.la" + # If there's already a libtool .la file, use it. + if ${TEST} -e "$ltlib" ; then + current=`${SED} -n -e'/^current=[[:digit:]]/{ s/^current=//; p; };' "$ltlib"` + rev=`${SED} -n -e'/^revision=[[:digit:]]/{ s/^revision=//; p; };' "$ltlib"` + current=$(($current + 0)) + rev=$(($rev + 0)) + version="$current.$rev" + else + # Try looking inside the archive + sublibname=`${AR} t "$reallib" | ${AWK} ' /.*\.so\..*/ { print $1 ; exit } '` + case $sublibname in + *.so.*) + version=`${ECHO} "$sublibname" | ${SED} -e "s/.*\.so\.//;s/\./:/g"` + ;; + *) + version="0" + ;; + esac + fi + ;; + *) + # bail out + ${ECHO} "$0: unknown library type for $libname" + exit 1 + ;; esac if ${TEST} ! -f $tmpdir/inst/$libbase.la; then |