pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/buildlink2 Shared libraries on AIX have a ".a" exte...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/47ac156bcec1
branches:  trunk
changeset: 464054:47ac156bcec1
user:      erh <erh%pkgsrc.org@localhost>
date:      Wed Dec 03 18:37:35 2003 +0000

description:
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:

 mk/buildlink2/fake-la |  33 +++++++++++++++++++++++++++++++--
 1 files changed, 31 insertions(+), 2 deletions(-)

diffs (49 lines):

diff -r 35a540d955cb -r 47ac156bcec1 mk/buildlink2/fake-la
--- a/mk/buildlink2/fake-la     Wed Dec 03 18:33:17 2003 +0000
+++ b/mk/buildlink2/fake-la     Wed Dec 03 18:37:35 2003 +0000
@@ -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 @@
                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



Home | Main Index | Thread Index | Old Index