diff options
author | rh <rh@pkgsrc.org> | 2002-05-11 08:11:46 +0000 |
---|---|---|
committer | rh <rh@pkgsrc.org> | 2002-05-11 08:11:46 +0000 |
commit | 5b728a2271201c615635f3efa11c0f910f3e63c9 (patch) | |
tree | e016e27e1cf2b45fd983d0c3e6fd829324bcfe94 /pkgtools | |
parent | 436a4000d2ddd1b188eef8d60fdea53eb98383cc (diff) | |
download | pkgsrc-5b728a2271201c615635f3efa11c0f910f3e63c9.tar.gz |
Update createbuildlink to 1.3. Changes are:
* create BUILDLINK_CONFIG_WRAPPER_SED patterns if required
* interpret "Makefile.common" as well as "Makefile" for packages
that share common information
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/createbuildlink/Makefile | 4 | ||||
-rwxr-xr-x | pkgtools/createbuildlink/files/createbuildlink | 44 |
2 files changed, 41 insertions, 7 deletions
diff --git a/pkgtools/createbuildlink/Makefile b/pkgtools/createbuildlink/Makefile index 68f567a83f6..aeeb7c8efc8 100644 --- a/pkgtools/createbuildlink/Makefile +++ b/pkgtools/createbuildlink/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.3 2002/05/05 23:23:34 rh Exp $ +# $NetBSD: Makefile,v 1.4 2002/05/11 08:11:46 rh Exp $ # -DISTNAME= createbuildlink-1.2 +DISTNAME= createbuildlink-1.3 CATEGORIES= pkgtools sysutils MASTER_SITES= # Nothing DISTFILES= # Nothing diff --git a/pkgtools/createbuildlink/files/createbuildlink b/pkgtools/createbuildlink/files/createbuildlink index 50a9834ef5d..76714186802 100755 --- a/pkgtools/createbuildlink/files/createbuildlink +++ b/pkgtools/createbuildlink/files/createbuildlink @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: createbuildlink,v 1.3 2002/05/05 23:23:35 rh Exp $ +# $NetBSD: createbuildlink,v 1.4 2002/05/11 08:11:47 rh Exp $ # # Copyright (c) 2002 The NetBSD Foundation, Inc. # All rights reserved. @@ -39,7 +39,7 @@ # Create an initial buildlink.mk from a package's Makefile and PLIST # -REV=`echo '$Revision: 1.3 $' | sed 's/\\$//g'` +REV=`echo '$Revision: 1.4 $' | sed 's/\\$//g'` tmpdir=/tmp makefile=Makefile sedrules=$tmpdir/sedrules.buildlink.$$ @@ -138,15 +138,23 @@ done echo "" ## +## try to find any included Makefile.common's +## +commons=`grep '^.include.*Makefile.common\"' $makefile | \ + sed 's/^.*"\(.*\)".*/\1/'` + +## ## buildlinked dependencies ## -grep '^.include.*\.\.\/.*\/.*/buildlink.mk\"' $makefile +for i in $makefile $commons ; do + [ ! -f $i ] || grep '^.include.*\.\.\/.*\/.*/buildlink.mk\"' $i +done ## ## check for pkgconfig style config files ## pkgconfigs=`grep "^lib/pkgconfig/.*.pc" $PLIST` -inplist=`grep "^.include.*devel/pkgconfig/buildlink.mk" $makefile` +inplist=`grep "^.include.*devel/pkgconfig/buildlink.mk" $makefile $commons` [ -z "$pkgconfigs" -o -n "$inplist" ] || echo ".include \"../../devel/pkgconfig/buildlink.mk\"" ## @@ -184,9 +192,35 @@ for i in $configs ; do done ## +## config wrappers for include and library directories +## +if [ -n "$configs" ]; then + for i in `grep "^include/[^/]*/.*\.h" $PLIST | \ + sed -e 's|/[^/]*\.h$||' | sort | uniq`; do + dir=$i + while [ "$dir" != "include" ] ; do + echo "BUILDLINK_CONFIG_WRAPPER_SED+= \\" + echo "-e \"s|-I[ ]*\${BUILDLINK_PREFIX.$PKGNOVER}/$dir|-I\${BUILDLINK_DIR}/$dir|g\"" + dir=`echo $dir | sed 's|/[^/]*$||'` + done + done + + for i in `grep "^lib/.*\.a$" $PLIST | \ + sed -e 's|/[^/]*\.a$||' | sort | uniq`; do + dir=$i + while [ "$dir" != "lib" ] ; do + echo "BUILDLINK_CONFIG_WRAPPER_SED+= \\" + echo "-e \"s|-L[ ]*\${BUILDLINK_PREFIX.$PKGNOVER}/$dir|-L\${BUILDLINK_DIR}/$dir|g\"" + dir=`echo $dir | sed 's|/[^/]*$||'` + done + done + echo "" +fi + +## ## environment variables to help dependent packages find config scripts ## -if [ ! -z "$configs" ]; then +if [ -n "$configs" ]; then echo '.if defined(USE_CONFIG_WRAPPER)' for i in $configs ; do cfg=`echo $i | sed 's|.*/||'` |