diff options
author | tv <tv@pkgsrc.org> | 2004-08-16 03:12:02 +0000 |
---|---|---|
committer | tv <tv@pkgsrc.org> | 2004-08-16 03:12:02 +0000 |
commit | 57110d93e190241a4a50d7bb2088cbbe4a09f74b (patch) | |
tree | d3ef27c84757240e297925eded8d32835bd5e1b2 | |
parent | 3a9380afa6d628b40915d22797437169206e10db (diff) | |
download | pkgsrc-57110d93e190241a4a50d7bb2088cbbe4a09f74b.tar.gz |
Add new variable LIBTOOL_LA_FILES, which may be used instead of listing
all of the .a, .la, .so, and .so.* files in the PLIST. This will
autogenerate the PLIST entries based on the informaion in the .la file.
This include print-PLIST support; if LIBTOOL_LA_FILES contains an
installed .la, its entries will be elided from the output PLIST template.
-rw-r--r-- | mk/bsd.pkg.mk | 8 | ||||
-rwxr-xr-x | mk/scripts/transform-la | 59 |
2 files changed, 66 insertions, 1 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index bb80c8b23df..ad0571ebc31 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.mk,v 1.1489 2004/08/16 01:56:03 schmonz Exp $ +# $NetBSD: bsd.pkg.mk,v 1.1490 2004/08/16 03:12:02 tv Exp $ # # This file is in the public domain. # @@ -407,6 +407,11 @@ BUILD_DEPENDS+= libtool-base>=${LIBTOOL_REQD}:../../devel/libtool-base CONFIGURE_ENV+= LIBTOOL="${LIBTOOL} ${LIBTOOL_FLAGS}" MAKE_ENV+= LIBTOOL="${LIBTOOL} ${LIBTOOL_FLAGS}" LIBTOOL_OVERRIDE?= libtool */libtool */*/libtool +.if defined(LIBTOOL_LA_FILES) +GENERATE_PLIST+= ${SH} ../../mk/scripts/transform-la ${PREFIX} ${LIBTOOL_LA_FILES}; +_FILTER_LIBTOOL_LA_FILES= | ${GREP} -vxF \ + `${SH} ../../mk/scripts/transform-la ${PREFIX} ${LIBTOOL_LA_FILES} | ${SED} -e 's,^,-e ,'` +.endif .endif .if defined(BUILD_USES_MSGFMT) && \ @@ -4495,6 +4500,7 @@ print-PLIST: *) genlinks=0 ;; \ esac; \ ${FIND} ${PREFIX}/. -xdev -newer ${EXTRACT_COOKIE} \! -type d -print\ + ${_FILTER_LIBTOOL_LA_FILES} \ | ${SORT} \ | ${AWK} ' \ { sub("${PREFIX}/\\./", ""); } \ diff --git a/mk/scripts/transform-la b/mk/scripts/transform-la new file mode 100755 index 00000000000..1248bd3624c --- /dev/null +++ b/mk/scripts/transform-la @@ -0,0 +1,59 @@ +#!/bin/sh +# +# Copyright (c) 2004 The NetBSD Foundation, Inc. +# All rights reserved. +# +# This code is derived from software contributed to The NetBSD Foundation +# by Todd Vierling. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by the NetBSD +# Foundation, Inc. and its contributors. +# 4. Neither the name of The NetBSD Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +PREFIX="$1"; shift + +for la in $*; do + basedir=$(dirname $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 + } + + # 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 + fi + + echo "$la" + for lib in $library_names $old_library; do + echo "$basedir/$lib" + done +done |