pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/buildlink3 Avoid build loops by ensuring that a pac...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/4fdf68938540
branches:  trunk
changeset: 470639:4fdf68938540
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Thu Mar 11 05:13:31 2004 +0000

description:
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:

 mk/buildlink3/bsd.buildlink3.mk |  25 +++++++++++++++++++------
 1 files changed, 19 insertions(+), 6 deletions(-)

diffs (51 lines):

diff -r 7570a5f8fca9 -r 4fdf68938540 mk/buildlink3/bsd.buildlink3.mk
--- a/mk/buildlink3/bsd.buildlink3.mk   Thu Mar 11 04:23:34 2004 +0000
+++ b/mk/buildlink3/bsd.buildlink3.mk   Thu Mar 11 05:13:31 2004 +0000
@@ -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 @@
 .  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



Home | Main Index | Thread Index | Old Index