Update createbuildlink to 2.2. Now includes a '-j' option to join together

PLISTed header files in a directory, listing them as '*.h'
This commit is contained in:
rh 2002-10-16 08:50:48 +00:00
parent e865e96f40
commit 30cf40c883
3 changed files with 44 additions and 9 deletions

View file

@ -1,7 +1,7 @@
# $NetBSD: Makefile,v 1.9 2002/09/27 21:19:58 rh Exp $
# $NetBSD: Makefile,v 1.10 2002/10/16 08:50:48 rh Exp $
#
DISTNAME= createbuildlink-2.1
DISTNAME= createbuildlink-2.2
CATEGORIES= pkgtools sysutils
MASTER_SITES= # Nothing
DISTFILES= # Nothing

View file

@ -1,6 +1,6 @@
#!/bin/sh
#
# $NetBSD: createbuildlink,v 1.8 2002/09/27 21:19:59 rh Exp $
# $NetBSD: createbuildlink,v 1.9 2002/10/16 08:50:49 rh Exp $
#
# Copyright (c) 2002 The NetBSD Foundation, Inc.
# All rights reserved.
@ -39,12 +39,30 @@
# Create an initial buildlink2.mk from a package's Makefile and PLIST
#
REV=`echo '$Revision: 1.8 $' | sed 's/\\$//g'`
REV=`echo '$Revision: 1.9 $' | sed 's/\\$//g'`
tmpdir=/tmp
makefile=Makefile
sedrules=$tmpdir/sedrules.buildlink.$$
PLIST=PLIST
args=`getopt j $*`
if [ $? != 0 ]; then
echo "Usage: $0 [-j] > buildlink2.mk"
exit 2
fi
set -- $args
while [ $# -gt 0 ]; do
case "$1" in
-j)
join=YES
;;
--)
shift; break
;;
esac
shift
done
##
## some simple integrity checking
##
@ -120,9 +138,16 @@ EOF
##
## buildlinked includes
##
for i in `grep "^include/" $PLIST` `grep "/Headers/.*\.h" $PLIST` ; do
echo "BUILDLINK_FILES.$PKGNOVER+= $i"
done
if [ $join = "YES" ]; then
for i in `egrep "^include/|/Headers/.*\.h" $PLIST \
| sed -e 's|[^/]*\.h$|*.h|' | sort | uniq`; do
echo "BUILDLINK_FILES.$PKGNOVER+= $i"
done
else
for i in `egrep "^include/|/Headers/.*\.h" $PLIST` ; do
echo "BUILDLINK_FILES.$PKGNOVER+= $i"
done
fi
##
## buildlinked libraries

View file

@ -1,4 +1,4 @@
.\" $NetBSD: createbuildlink.8,v 1.3 2002/09/06 00:36:14 rh Exp $
.\" $NetBSD: createbuildlink.8,v 1.4 2002/10/16 08:50:50 rh Exp $
.\"
.\" Copyright (c) 2002 The NetBSD Foundation, Inc.
.\" All rights reserved.
@ -34,7 +34,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd September 6, 2002
.Dd October 16, 2002
.Dt CREATEBUILDLINK 8
.Os
.Sh NAME
@ -42,6 +42,7 @@
.Nd automatic NetBSD buildlink2.mk generator
.Sh SYNOPSIS
.Nm
.Op Fl j
.Sh DESCRIPTION
.Nm
reads in the
@ -53,6 +54,15 @@ an initial
.Pa buildlink2.mk
file on stdout.
.Pp
The following options are available:
.Bl -tag -width indent
.It Fl j
Join together all .h files in an include directory and list as *.h.
Be careful with this option and only use it if you are sure that the
package in question is the only one providing header files in the PLISTed
directory.
.El
.Pp
While
.Nm
is supposed to help starting create a