diff options
author | erh <erh> | 2003-12-03 18:37:35 +0000 |
---|---|---|
committer | erh <erh> | 2003-12-03 18:37:35 +0000 |
commit | 319819872ce5afbc2e031776711e9f9940033bd3 (patch) | |
tree | 8c37bc123f81a61d4560ebde8e235525f127a6cd /mk | |
parent | 4182b301bc542b310db851b1db2ef4bf9e41d3c8 (diff) | |
download | pkgsrc-319819872ce5afbc2e031776711e9f9940033bd3.tar.gz |
Shared libraries on AIX have a ".a" extension. Handle those by either looking
for an existing libtool ".la" library, or looking inside the archive for the
.so file.
Also, fail immediately if passed a library that isn't handled.
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 |