diff options
author | jlam <jlam@pkgsrc.org> | 2004-03-11 05:13:31 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2004-03-11 05:13:31 +0000 |
commit | 088bbd1c66b8690e0e5405df0839bc2b22a0608e (patch) | |
tree | 213db7f8dcef99d79a446c296bc6dabb4ca610ac /mk/buildlink3 | |
parent | 2064c683ebb6db4f61817f30bda8f578b2321573 (diff) | |
download | pkgsrc-088bbd1c66b8690e0e5405df0839bc2b22a0608e.tar.gz |
Avoid build loops by ensuring that a package can never inadvertantly be
a dependency for itself. This is done by setting IGNORE_PKG.<pkg> if
<pkg> is the current package and then appropriately checking its value.
Diffstat (limited to 'mk/buildlink3')
-rw-r--r-- | mk/buildlink3/bsd.buildlink3.mk | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/mk/buildlink3/bsd.buildlink3.mk b/mk/buildlink3/bsd.buildlink3.mk index 7cf77d2e857..08f10581db6 100644 --- a/mk/buildlink3/bsd.buildlink3.mk +++ b/mk/buildlink3/bsd.buildlink3.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.buildlink3.mk,v 1.108 2004/03/11 00:54:51 jlam Exp $ +# $NetBSD: bsd.buildlink3.mk,v 1.109 2004/03/11 05:13:31 jlam Exp $ # # An example package buildlink3.mk file: # @@ -105,23 +105,36 @@ USE_BUILTIN.${_pkg_}?= no . endif .endfor -# _BLNK_PACKAGES contains all of the unique elements of BUILDLINK_PACKAGES. +# Set IGNORE_PKG.<pkg> if <pkg> is the current package we're building. +# We can then check for this value to avoid build loops. +# +.for _pkg_ in ${BUILDLINK_PACKAGES} +. if !defined(IGNORE_PKG.${_pkg_}) && \ + (${BUILDLINK_PKGSRCDIR.${_pkg_}:C|.*/([^/]*/[^/]*)$|\1|} == ${PKGPATH}) +IGNORE_PKG.${_pkg_}= yes +MAKEFLAGS+= IGNORE_PKG.${_pkg_}=${IGNORE_PKG.${_pkg_}} +. endif +.endfor + +# _BLNK_PACKAGES contains all of the unique elements of BUILDLINK_PACKAGES +# that shouldn't be skipped. # _BLNK_PACKAGES= # empty .for _pkg_ in ${BUILDLINK_PACKAGES} -. if empty(_BLNK_PACKAGES:M${_pkg_}) +. if empty(_BLNK_PACKAGES:M${_pkg_}) && !defined(IGNORE_PKG.${_pkg_}) _BLNK_PACKAGES+= ${_pkg_} . endif .endfor # _BLNK_DEPENDS contains all of the elements of BUILDLINK_DEPENDS that -# name packages for which we aren't using the built-in software and hence -# need to add a dependency. +# that shouldn't be skipped and that name packages for which we aren't +# using the built-in software and hence need to add a dependency. # _BLNK_DEPENDS= # empty .for _pkg_ in ${BUILDLINK_DEPENDS} USE_BUILTIN.${_pkg_}?= no -. if empty(_BLNK_DEPENDS:M${_pkg_}) && !empty(USE_BUILTIN.${_pkg_}:M[nN][oO]) +. if empty(_BLNK_DEPENDS:M${_pkg_}) && !defined(IGNORE_PKG.${_pkg_}) && \ + !empty(USE_BUILTIN.${_pkg_}:M[nN][oO]) _BLNK_DEPENDS+= ${_pkg_} . endif .endfor |