head	1.10;
access;
symbols
	pkgsrc-2013Q2:1.10.0.50
	pkgsrc-2013Q2-base:1.10
	pkgsrc-2012Q4:1.10.0.48
	pkgsrc-2012Q4-base:1.10
	pkgsrc-2011Q4:1.10.0.46
	pkgsrc-2011Q4-base:1.10
	pkgsrc-2011Q2:1.10.0.44
	pkgsrc-2011Q2-base:1.10
	pkgsrc-2009Q4:1.10.0.42
	pkgsrc-2009Q4-base:1.10
	pkgsrc-2008Q4:1.10.0.40
	pkgsrc-2008Q4-base:1.10
	pkgsrc-2008Q3:1.10.0.38
	pkgsrc-2008Q3-base:1.10
	cube-native-xorg:1.10.0.36
	cube-native-xorg-base:1.10
	pkgsrc-2008Q2:1.10.0.34
	pkgsrc-2008Q2-base:1.10
	pkgsrc-2008Q1:1.10.0.32
	pkgsrc-2008Q1-base:1.10
	pkgsrc-2007Q4:1.10.0.30
	pkgsrc-2007Q4-base:1.10
	pkgsrc-2007Q3:1.10.0.28
	pkgsrc-2007Q3-base:1.10
	pkgsrc-2007Q2:1.10.0.26
	pkgsrc-2007Q2-base:1.10
	pkgsrc-2007Q1:1.10.0.24
	pkgsrc-2007Q1-base:1.10
	jlam-pkgviews:1.10.0.22
	jlam-pkgviews-base:1.10
	pkgsrc-2006Q4:1.10.0.20
	pkgsrc-2006Q4-base:1.10
	pkgsrc-2006Q3:1.10.0.18
	pkgsrc-2006Q3-base:1.10
	pkgsrc-2006Q2:1.10.0.16
	pkgsrc-2006Q2-base:1.10
	pkgsrc-2006Q1:1.10.0.14
	pkgsrc-2006Q1-base:1.10
	pkgsrc-2005Q4:1.10.0.12
	pkgsrc-2005Q4-base:1.10
	pkgsrc-2005Q3:1.10.0.10
	pkgsrc-2005Q3-base:1.10
	pkgsrc-2005Q2:1.10.0.8
	pkgsrc-2005Q2-base:1.10
	pkgsrc-2005Q1:1.10.0.6
	pkgsrc-2005Q1-base:1.10
	pkgsrc-2004Q4:1.10.0.4
	pkgsrc-2004Q4-base:1.10
	pkgsrc-2004Q3:1.10.0.2
	pkgsrc-2004Q3-base:1.10
	pkgsrc-2004Q2:1.9.0.12
	pkgsrc-2004Q2-base:1.9
	pkgsrc-2004Q1:1.9.0.10
	pkgsrc-2004Q1-base:1.9
	pkgsrc-2003Q4:1.9.0.8
	pkgsrc-2003Q4-base:1.9
	pkgviews-base:1.9
	pkgviews-mk:1.9.0.6
	pkgviews:1.9.0.4
	pkgviews-mk-base:1.9
	netbsd-1-6-1:1.9.0.2
	netbsd-1-6-1-base:1.9
	buildlink2-base:1.1
	buildlink2:1.1.0.2;
locks; strict;
comment	@# @;


1.10
date	2004.07.06.22.49.18;	author wiz;	state dead;
branches;
next	1.9;

1.9
date	2002.12.26.17.08.57;	author jlam;	state Exp;
branches
	1.9.4.1;
next	1.8;

1.8
date	2002.12.22.19.02.44;	author jlam;	state Exp;
branches;
next	1.7;

1.7
date	2002.10.30.00.23.00;	author jlam;	state Exp;
branches;
next	1.6;

1.6
date	2002.09.28.23.46.42;	author jlam;	state Exp;
branches;
next	1.5;

1.5
date	2002.09.18.00.46.59;	author jlam;	state Exp;
branches;
next	1.4;

1.4
date	2002.09.07.07.33.15;	author jlam;	state Exp;
branches;
next	1.3;

1.3
date	2002.09.03.21.36.18;	author jlam;	state Exp;
branches;
next	1.2;

1.2
date	2002.08.22.08.21.29;	author jlam;	state Exp;
branches;
next	1.1;

1.1
date	2002.06.06.06.34.37;	author jlam;	state dead;
branches
	1.1.2.1;
next	;

1.9.4.1
date	2002.12.26.17.08.57;	author jlam;	state dead;
branches;
next	1.9.4.2;

1.9.4.2
date	2002.12.26.17.08.58;	author jlam;	state Exp;
branches;
next	;

1.1.2.1
date	2002.06.06.06.34.37;	author jlam;	state Exp;
branches;
next	1.1.2.2;

1.1.2.2
date	2002.06.21.21.43.20;	author jlam;	state Exp;
branches;
next	1.1.2.3;

1.1.2.3
date	2002.06.29.20.02.41;	author jlam;	state Exp;
branches;
next	1.1.2.4;

1.1.2.4
date	2002.06.29.20.09.24;	author jlam;	state Exp;
branches;
next	1.1.2.5;

1.1.2.5
date	2002.06.29.20.17.57;	author jlam;	state Exp;
branches;
next	1.1.2.6;

1.1.2.6
date	2002.06.30.18.17.37;	author jlam;	state Exp;
branches;
next	1.1.2.7;

1.1.2.7
date	2002.06.30.19.03.30;	author jlam;	state Exp;
branches;
next	;


desc
@@


1.10
log
@Retire buildlink2, now that all packages using it have been converted to
buildlink3.
@
text
@# $NetBSD: post-cache,v 1.9 2002/12/26 17:08:57 jlam Exp $

*)	;;
esac
@


1.9
log
@Rewrite wrapper scripts so that it is possible to add wrapper-specific
logic and caching in a more natural way.
@
text
@d1 1
a1 1
# $NetBSD$
@


1.9.4.1
log
@file post-cache was added on branch pkgviews on 2002-12-26 17:08:58 +0000
@
text
@d1 4
@


1.9.4.2
log
@Rewrite wrapper scripts so that it is possible to add wrapper-specific
logic and caching in a more natural way.
@
text
@a0 4
# $NetBSD: post-cache,v 1.9 2002/12/26 17:08:57 jlam Exp $

*)	;;
esac
@


1.8
log
@The buildlink2 problems on non-NetBSD platform seem to be related to
correct manipulation of variables containing values with escaped
metacharacters by the shell.  The new code only does partial caching, which
doesn't cache "special" arguments that contain escaped metacharacters or
other oddly quoted values.  On certain platforms listed in _BLNK_CACHE_ALL
in bsd.buildlink2.mk, we do full caching, which has enormous speed benefits
since it avoids an extra sed invocation per "special" argument.

Known working platforms:

	MacOS X 10.1.5 (schmonz)
	MacOS X 10.2 (grant)
	NetBSD 1.6 [full caching] (jlam)
	OpenBSD (cjep)
	Solaris 8 (grant)
	Solaris 9 (salo)
@
text
@d1 1
a1 1
# $NetBSD: post-cache,v 1.7 2002/10/30 00:23:00 jlam Exp $
d3 1
a3 52
*)
	# $qarg contains a correctly-quoted $arg
	case $arg in
	*[\`\"\$\\]*)
		qarg=`@@ECHO@@ "X$arg" | $Xsed -e "$sed_quote_subst"`
		quotedarg=yes
		;;
	*)
		qarg="$arg"
		;;
	esac
	case $qarg in
		*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
		qarg="\"$qarg\""
		quotedarg=yes
		;;
	esac
	searcharg="$qarg"

	case $arg in
	-D*)
		arg="$qarg"
		addtocache=yes
		;;
        -[ILRl]*|-Wl,*|/usr/lib/lib*|@@LOCALBASE@@/*/lib*|@@X11BASE@@/*/lib*)
		arg=`@@ECHO@@ "X$qarg" | $Xsed @@_BLNK_TRANSFORM_SED@@`
		addtocache=yes
		;;
	*)
		arg="$qarg"
		addtocache=no
		;;
	esac
	case $updatecache,$addtocache,$cacheall,$quotedarg in
	yes,yes,yes,*|yes,yes,no,no)
		case $arg in
		*[\`\"\$\\]*)
			cachearg=`@@ECHO@@ "X$arg" | $Xsed -e "$sed_quote_subst"`
			;;
		*)
			cachearg="$arg"
			;;
		esac
		@@CAT@@ >> $cache << EOF
$searcharg)
	arg="$cachearg"
	;;
EOF
		cacheupdated=yes
		;;
	esac
	;;
@


1.7
log
@Move the sed command in _BLNK_{,UN}TRANSFORM_SED into a sed command files
.transform.sed and .untransform.sed that are generated by a new
gen-transform.sh shell script.  This avoids all of the silliness with
exceeding the length of the value of a make variable that brought about
breaking the original _BLNK_TRANSFORM_SED into _BLNK_TRANSFORM_SED.[1-4].
It's also vastly easier to understand the gen-transform.sh script as
opposed to the juxtaposition of make and sed regular expressions, a.k.a.
massive eyesores, that were in bsd.buildlink.mk.

Also fix the directory protection scheme so that it might actually work
if the pkgsrc directory is a subdirectory of /usr/pkg (${LOCALBASE}).

Lastly, filter out /usr/X11R6 (${X11BASE}) if the package doesn't define
USE_X11.  This should catch packages that use X11 without announcing it,
and avoids one way you can circumvent buildlink2.
@
text
@d1 1
a1 1
# $NetBSD: post-cache,v 1.6 2002/09/28 23:46:42 jlam Exp $
d4 1
d7 8
a14 2
		arg=`@@ECHO@@ X$arg | $Xsed -e "$sed_quote_subst"`
		case $arg in
d16 14
a29 10
			arg="\"$arg\""
			;;
		esac
		case $updatecache in
		yes)
			newarg=`@@ECHO@@ X$arg | $Xsed -e "$sed_quote_subst"`
			@@ECHO@@ "$arg) arg=\"$newarg\" ;; #1" >> $cache
			cacheupdated=yes
			;;
		esac
d31 3
a33 9
	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
		arg="\"$arg\""
		case $updatecache in
		yes)
			newarg=`@@ECHO@@ X$arg | $Xsed -e "$sed_quote_subst"`
			@@ECHO@@ "$arg) arg=\"$newarg\" ;; #2" >> $cache
			cacheupdated=yes
			;;
		esac
d35 3
a37 2
	-D*)
		arg=`@@ECHO@@ X$arg | $Xsed -e "$sed_quote_subst"`
d39 2
a40 2
		*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
			arg="\"$arg\""
d42 2
a43 17
		esac
		case $updatecache in
		yes)
			newarg=`@@ECHO@@ X$arg | $Xsed -e "$sed_quote_subst"`
			@@ECHO@@ "$arg) arg=\"$newarg\" ;; #3" >> $cache
			cacheupdated=yes
			;;
		esac
		;;
        -[ILRl]*|-Wl,*|/usr/lib/lib*|@@LOCALBASE@@/*/lib*|@@X11BASE@@/*/lib*)
		newarg=`@@ECHO@@ "X$arg" | $Xsed \
			@@_BLNK_TRANSFORM_SED@@ \
		`
		case $updatecache in
		yes)
			@@ECHO@@ "$arg) arg=\"$newarg\" ;; #4" >> $cache
			cacheupdated=yes
d46 6
a51 1
		arg="$newarg"
@


1.6
log
@* Split _BLNK_TRANSFORM_SED into 4 variables, as even with 3 it was
  overflowing the make variable size limit.

* Rename _BLNK_WRAP_ENV to _BLNK_WRAP_SETENV, and use _BLNK_WRAP_ENV to
  set the shell environment for the wrappee.  Allow BUILDLINK_WRAPPER_ENV
  to add to the shell environment.
@
text
@d1 1
a1 1
# $NetBSD: post-cache,v 1.5 2002/09/18 00:46:59 jlam Exp $
d47 1
a47 4
			@@_BLNK_TRANSFORM_SED.1@@ \
			@@_BLNK_TRANSFORM_SED.2@@ \
			@@_BLNK_TRANSFORM_SED.3@@ \
			@@_BLNK_TRANSFORM_SED.4@@ \
@


1.5
log
@Modifications and additions to create a dummy libtool archive to represent
a system library so that we can prefer a system library to a pkgsrc one
when building with pkgsrc.
@
text
@d1 1
a1 1
# $NetBSD: post-cache,v 1.4 2002/09/07 07:33:15 jlam Exp $
d50 1
@


1.4
log
@Filter out -R and -Wl.-R arguments that point to /usr/local as well as
just -I and -L (modulo if LOCALBASE == /usr/local).
@
text
@d1 1
a1 1
# $NetBSD: post-cache,v 1.3 2002/09/03 21:36:18 jlam Exp $
d45 1
a45 1
        -[ILRl]*|-Wl,*|@@LOCALBASE@@/*/lib*|@@X11BASE@@/*/lib*)
@


1.3
log
@Add a missing shell wildcard which was causing the expression to not
catch arguments with symbols that are special to the shell.  This should
fix pkg/18156 by Matthias Scheler.
@
text
@d1 1
a1 1
# $NetBSD: post-cache,v 1.2 2002/08/22 08:21:29 jlam Exp $
d45 1
a45 1
        -[ILl]*|-Wl,*|@@LOCALBASE@@/*/lib*|@@X11BASE@@/*/lib*)
@


1.2
log
@Merge pkgsrc/mk from the buildlink2 branch back into the main trunk.
@
text
@d1 1
a1 1
# $NetBSD: post-cache,v 1.1.2.7 2002/06/30 19:03:30 jlam Exp $
d5 1
a5 1
	*[\`\"\$\\])
@


1.1
log
@file post-cache was initially added on branch buildlink2.
@
text
@d1 61
@


1.1.2.1
log
@* Reimplement the wrapper script system so that it examines each argument
  and translates it into its buildlink equivalent, with caching to reduce
  the penalty of the translation.  This makes the wrappers robust against
  having quotes or spaces in the arguments, e.g. -DCPP=\"cc\ -E\".  A more
  complete description of the wrapper script system may be found in
  mk/buildlink2/README.

* Push the libtool fixes into a separate main wrapper script so that the
  archives are fixed as part of the creation of the libtool archive, and so
  from make(1)'s point of view, the libtool archive is created atomically.
  This prevents accidentally triggerring rebuilds of uninstalled libtool
  archives that depend on other uninstalled libtool archives during the
  installation process.

* Use a new variable name convention in the buildlink framework:

	_LT_* are private libtool-related variables
	LIBTOOL are publicly-usable libtool-related variables
	_BLNK_* are private buildlink-related variables
	BUILDLINK_* are publicly-usable buildlink-related variables
@
text
@a0 12
*)
        newarg=`echo "X$arg" | $Xsed					\
		-e "$sed_quote_subst"					\
		-e "$sed_whitespace_subst"				\
		@@_BLNK_TRANSFORM_SED.1@@					\
		@@_BLNK_TRANSFORM_SED.2@@					\
		@@_BLNK_TRANSFORM_SED.3@@`
	@@ECHO@@ "'$arg') newarg='$newarg' ;;" >> $cache
	cacheupdated=yes
	;;
esac
args="$args $newarg"
@


1.1.2.2
log
@* Split the libtool script into a main script and a helper script.  The
  helper script is separated to prevent parsing until its needed.  Also
  specially handle the --mode=install case for libtool as we don't really
  care to cache the arguments in those cases.

* Use a more correct strategy for properly quoting and caching arguments
  in the wrapper scripts.  This fixes building php4, kdelibs2, and imlib.
@
text
@a0 2
# $NetBSD$

d2 8
a9 29
	case $arg in
	*[\`\"\$\\])
		arg=`@@ECHO@@ X$arg | $Xsed -e "$sed_quote_subst"`
		case $arg in
		*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
			arg="\"$arg\""
			;;
		esac
		newarg=`@@ECHO@@ X$arg | $Xsed -e "$sed_quote_subst"`
		@@ECHO@@ "$arg) arg=\"$newarg\" ;; #1" >> $cache
		cacheupdated=yes
		;;
	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
		arg="\"$arg\""
		newarg=`@@ECHO@@ X$arg | $Xsed -e "$sed_quote_subst"`
		@@ECHO@@ "$arg) arg=\"$newarg\" ;; #2" >> $cache
		cacheupdated=yes
		;;
        -[ILl]*|@@LOCALBASE@@/*/lib*|@@X11BASE@@/*/lib*)
		newarg=`@@ECHO@@ "X$arg" | $Xsed \
			@@_BLNK_TRANSFORM_SED.1@@ \
			@@_BLNK_TRANSFORM_SED.2@@ \
			@@_BLNK_TRANSFORM_SED.3@@ \
		`
		@@ECHO@@ "$arg) arg=\"$newarg\" ;; #3" >> $cache
		arg="$newarg"
		cacheupdated=yes
		;;
	esac
d12 1
@


1.1.2.3
log
@Provide way to prevent updating the wrapper argument cache by setting
BUILDLINK_UPDATE_CACHE=no in the environment.  We typically want to do
this during the configure process to prevent poisoning the cache with
stuff we don't want or with stuff that might break the wrapper scripts.
Also add a way to clear the cache by doing "make clear-buildlink-cache".
@
text
@d1 1
a1 1
# $NetBSD: post-cache,v 1.1.2.2 2002/06/21 21:43:20 jlam Exp $
d12 3
a14 7
		case $updatecache in
		yes)
			newarg=`@@ECHO@@ X$arg | $Xsed -e "$sed_quote_subst"`
			@@ECHO@@ "$arg) arg=\"$newarg\" ;; #1" >> $cache
			cacheupdated=yes
			;;
		esac
d18 3
a20 7
		case $updatecache in
		yes)
			newarg=`@@ECHO@@ X$arg | $Xsed -e "$sed_quote_subst"`
			@@ECHO@@ "$arg) arg=\"$newarg\" ;; #2" >> $cache
			cacheupdated=yes
			;;
		esac
d28 1
d30 1
a30 6
		case $updatecache in
		yes)
			@@ECHO@@ "$arg) arg=\"$newarg\" ;; #3" >> $cache
			cacheupdated=yes
			;;
		esac
@


1.1.2.4
log
@Don't let empty args poison the cache.
@
text
@d1 1
a1 1
# $NetBSD: post-cache,v 1.1.2.3 2002/06/29 20:02:41 jlam Exp $
d39 2
a40 4
			if [ -n "$arg" ]; then
				@@ECHO@@ "$arg) arg=\"$newarg\" ;; #3" >> $cache
				cacheupdated=yes
			fi
@


1.1.2.5
log
@Back out previous.  The problem arose because I misordered the command
statements.  Reorder so that we set "arg" to its transformed value after
we add it to the cache.
@
text
@d1 1
a1 1
# $NetBSD: post-cache,v 1.1.2.4 2002/06/29 20:09:24 jlam Exp $
d36 1
d39 4
a42 2
			@@ECHO@@ "$arg) arg=\"$newarg\" ;; #3" >> $cache
			cacheupdated=yes
a44 1
		arg="$newarg"
@


1.1.2.6
log
@Add a default case (duh!) so that any arguments that fall through are still
quoted and handled properly.
@
text
@d1 1
a1 1
# $NetBSD: post-cache,v 1.1.2.5 2002/06/29 20:17:57 jlam Exp $
a42 15
		;;
	*)
		arg=`@@ECHO@@ X$arg | $Xsed -e "$sed_quote_subst"`
		case $arg in
		*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
			arg="\"$arg\""
			;;
		esac
		case $updatecache in
		yes)
			newarg=`@@ECHO@@ X$arg | $Xsed -e "$sed_quote_subst"`
			@@ECHO@@ "$arg) arg=\"$newarg\" ;; #4" >> $cache
			cacheupdated=yes
			;;
		esac
@


1.1.2.7
log
@Using the default case, while correct, was too slow.  Instead of that, we
now just specially process and cache -D* as those are most likely to have
odd levels of quoting.  We also run _BLNK_TRANSFORM on -Wl,* arguments as
we're probably going to be handling those specially for Darwin.
@
text
@d1 1
a1 1
# $NetBSD: post-cache,v 1.1.2.6 2002/06/30 18:17:37 jlam Exp $
d30 15
a44 1
	-D*)
a53 13
			@@ECHO@@ "$arg) arg=\"$newarg\" ;; #3" >> $cache
			cacheupdated=yes
			;;
		esac
		;;
        -[ILl]*|-Wl,*|@@LOCALBASE@@/*/lib*|@@X11BASE@@/*/lib*)
		newarg=`@@ECHO@@ "X$arg" | $Xsed \
			@@_BLNK_TRANSFORM_SED.1@@ \
			@@_BLNK_TRANSFORM_SED.2@@ \
			@@_BLNK_TRANSFORM_SED.3@@ \
		`
		case $updatecache in
		yes)
a57 1
		arg="$newarg"
@


