summaryrefslogtreecommitdiff
path: root/mk/scripts
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2004-09-10 19:51:50 +0000
committerjlam <jlam@pkgsrc.org>2004-09-10 19:51:50 +0000
commit5073201af908ffcc303a3a184c6d544a84d694a1 (patch)
tree3fdaad46d2c93446b39ca1fc62fed7e50fe285bc /mk/scripts
parent54c417c67d03bd6a526957aea3e0b6ad02fa8605 (diff)
downloadpkgsrc-5073201af908ffcc303a3a184c6d544a84d694a1.tar.gz
* Do the *.la expansion within the current _PLIST_AWK_SCRIPT framework.
We no longer require that LIBTOOL_LA_FILES be defined in the package Makefile, and the libtool archives should once again be listed in the PLIST. * Add a new yes/no variable "LIBTOOLIZE_PLIST" to control whether to have bsd.pkg.mk automatically expand *.la files in PLISTs into the true library names represented by the libtool archives. * Rename the "transform-la" script to "print-la-libnames" which more correctly reflects its function. Many thanks to Todd Vierling for the original implementation and for his contructive comments on how to improve the changes in this commit.
Diffstat (limited to 'mk/scripts')
-rwxr-xr-xmk/scripts/print-la-libnames (renamed from mk/scripts/transform-la)48
1 files changed, 31 insertions, 17 deletions
diff --git a/mk/scripts/transform-la b/mk/scripts/print-la-libnames
index 1248bd3624c..647ea0d3c67 100755
--- a/mk/scripts/transform-la
+++ b/mk/scripts/print-la-libnames
@@ -1,4 +1,6 @@
-#!/bin/sh
+# /bin/sh
+#
+# $NetBSD: print-la-libnames,v 1.1 2004/09/10 19:51:51 jlam Exp $
#
# Copyright (c) 2004 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -35,25 +37,37 @@
# POSSIBILITY OF SUCH DAMAGE.
#
-PREFIX="$1"; shift
+: ${ECHO=echo}
+: ${GREP=grep}
+: ${SORT=sort}
-for la in $*; do
- basedir=$(dirname $la)
+for la
+do
+ dir="${la%/*.la}"
library_names=
old_library=
- # the .la file is itself a Bourne-compatible script
- . $PREFIX/$la || {
- echo "$0: cannot read libtool archive $PREFIX/$la" >&2; exit 1
- }
+ case $dir in
+ $la) dir= ;;
+ *) dir="$dir/" ;;
+ esac
+ case $la in
+ /*|./*) lapath="$la" ;;
+ *) lapath="./$la" ;;
+ esac
- # catch where libtool's install wrapper was not properly used
- if [ "$installed" = "no" ]; then
- echo "$0: library $PREFIX/$la was not properly installed" >&2; exit 1
+ if [ -r "$lapath" ] && \
+ ${GREP} -q "libtool library file" "$lapath"; then
+ . "$lapath"
+ if [ "$installed" = "no" ]; then
+ ${ECHO} 1>&2 "$0: \`$lapath' was not properly installed"
+ exit 1
+ fi
+ for lib in $library_names $old_library; do
+ ${ECHO} "$dir$lib"
+ done
+ else
+ ${ECHO} 1>&2 "$0: cannot read libtool archive \`$lapath'"
+ exit 1
fi
-
- echo "$la"
- for lib in $library_names $old_library; do
- echo "$basedir/$lib"
- done
-done
+done | ${SORT} -u