From 53e840964eceea177b218fdea4a4572f539a5785 Mon Sep 17 00:00:00 2001 From: rh Date: Sat, 11 May 2002 11:27:28 +0000 Subject: Update createbuildlink to 1.4. This fixes the following problems: * when creating BUILDLINK_CONFIG_WRAPPER_SED we also need to create a corresponding REPLACE_BUILDLINK_SED to reverse the effects * account for packages that set USE_X11BASE to an empty string. --- pkgtools/createbuildlink/Makefile | 4 ++-- pkgtools/createbuildlink/files/createbuildlink | 33 +++++++++++++++----------- 2 files changed, 21 insertions(+), 16 deletions(-) (limited to 'pkgtools') diff --git a/pkgtools/createbuildlink/Makefile b/pkgtools/createbuildlink/Makefile index aeeb7c8efc8..19bbf925740 100644 --- a/pkgtools/createbuildlink/Makefile +++ b/pkgtools/createbuildlink/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.4 2002/05/11 08:11:46 rh Exp $ +# $NetBSD: Makefile,v 1.5 2002/05/11 11:27:28 rh Exp $ # -DISTNAME= createbuildlink-1.3 +DISTNAME= createbuildlink-1.4 CATEGORIES= pkgtools sysutils MASTER_SITES= # Nothing DISTFILES= # Nothing diff --git a/pkgtools/createbuildlink/files/createbuildlink b/pkgtools/createbuildlink/files/createbuildlink index 76714186802..b50c14a6f52 100755 --- a/pkgtools/createbuildlink/files/createbuildlink +++ b/pkgtools/createbuildlink/files/createbuildlink @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: createbuildlink,v 1.4 2002/05/11 08:11:47 rh Exp $ +# $NetBSD: createbuildlink,v 1.5 2002/05/11 11:27:28 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.4 $' | sed 's/\\$//g'` +REV=`echo '$Revision: 1.5 $' | sed 's/\\$//g'` tmpdir=/tmp makefile=Makefile sedrules=$tmpdir/sedrules.buildlink.$$ @@ -60,6 +60,12 @@ if [ ! -f "$PLIST" ]; then exit 1 fi +## +## try to find any included Makefile.common's +## +commons=`grep '^.include.*Makefile.common\"' $makefile | \ + sed 's/^.*"\(.*\)".*/\1/'` + ## ## package specific variables ## @@ -68,11 +74,12 @@ PKGNAME=`make show-var VARNAME=PKGNAME` PKGVER=`echo $PKGNAME | sed -e 's/^.*-//'` PKGNOVER=`echo $PKGNAME | sed -e 's/-[^-]*$//'` PKGUPPER=`echo $PKGNOVER | tr '[:lower:]' '[:upper:]' | tr - _` +PREFIX=X11PREFIX USE_X11BASE=`make show-var VARNAME=USE_X11BASE` if [ -z "$USE_X11BASE" ]; then - PREFIX=LOCALBASE -else - PREFIX=X11PREFIX + if ! grep -q "^USE_X11BASE" $makefile $commons ; then + PREFIX=LOCALBASE + fi fi ## @@ -137,12 +144,6 @@ done echo "" -## -## try to find any included Makefile.common's -## -commons=`grep '^.include.*Makefile.common\"' $makefile | \ - sed 's/^.*"\(.*\)".*/\1/'` - ## ## buildlinked dependencies ## @@ -187,7 +188,7 @@ for i in $configs ; do echo "BUILDLINK_CONFIG_WRAPPER.$PKGNOVER-$ctg= \\" echo " \${BUILDLINK_DIR}/$i" echo "REPLACE_BUILDLINK_SED+= \\" - echo "-e \"s|\${BUILDLINK_CONFIG_WRAPPER.$PKGNOVER-$ctg}|\${BUILDLINK_CONFIG.$PKGNOVER-$ctg}|g\"" + echo " -e \"s|\${BUILDLINK_CONFIG_WRAPPER.$PKGNOVER-$ctg}|\${BUILDLINK_CONFIG.$PKGNOVER-$ctg}|g\"" echo "" done @@ -200,7 +201,9 @@ if [ -n "$configs" ]; then dir=$i while [ "$dir" != "include" ] ; do echo "BUILDLINK_CONFIG_WRAPPER_SED+= \\" - echo "-e \"s|-I[ ]*\${BUILDLINK_PREFIX.$PKGNOVER}/$dir|-I\${BUILDLINK_DIR}/$dir|g\"" + echo " -e \"s|-I[ ]*\${BUILDLINK_PREFIX.$PKGNOVER}/$dir|-I\${BUILDLINK_DIR}/$dir|g\"" + echo "REPLACE_BUILDLINK_SED+= \\" + echo " -e \"s|-I\${BUILDLINK_DIR}/$dir|-I[ ]*\${BUILDLINK_PREFIX.$PKGNOVER}/$dir|g\"" dir=`echo $dir | sed 's|/[^/]*$||'` done done @@ -210,7 +213,9 @@ if [ -n "$configs" ]; then dir=$i while [ "$dir" != "lib" ] ; do echo "BUILDLINK_CONFIG_WRAPPER_SED+= \\" - echo "-e \"s|-L[ ]*\${BUILDLINK_PREFIX.$PKGNOVER}/$dir|-L\${BUILDLINK_DIR}/$dir|g\"" + echo " -e \"s|-L[ ]*\${BUILDLINK_PREFIX.$PKGNOVER}/$dir|-L\${BUILDLINK_DIR}/$dir|g\"" + echo "REPLACE_BUILDLINK_SED+= \\" + echo " -e \"s|-L\${BUILDLINK_DIR}/$dir|-L[ ]*\${BUILDLINK_PREFIX.$PKGNOVER}/$dir|g\"" dir=`echo $dir | sed 's|/[^/]*$||'` done done -- cgit v1.2.3