summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authoragc <agc>2003-08-08 08:43:37 +0000
committeragc <agc>2003-08-08 08:43:37 +0000
commita13350bd06343e447ed9634d403e78e544662a33 (patch)
tree5a165d306bbf110bbc57dec899b0201158bc06ef /mk
parentf218084b17e9c89e1a4d5d78a515b1e4c0712183 (diff)
downloadpkgsrc-a13350bd06343e447ed9634d403e78e544662a33.tar.gz
Re-model the BUILD_DEFS display during build: if PKGSRC_SHOW_BUILD_DEFS is
defined, then show the BUILD_DEFS to the user. If not, then just keep quiet. Whilst I'm here, re-indent the cpp-like .if/.else/.endif/.for/.endfor lines properly. Also, remove the ":u" modifier in the build-defs-message code - it's not strictly necessary (duplicate definitions will be displayed, but this isn't a major problem), and it removes the requirement to have a make(1) binary which supports ":u". This should fix PR 22402 from Alan Barrett, and also addresses some concerns raised by Robert Elz.
Diffstat (limited to 'mk')
-rw-r--r--mk/bsd.pkg.defaults.mk9
-rw-r--r--mk/bsd.pkg.mk26
2 files changed, 22 insertions, 13 deletions
diff --git a/mk/bsd.pkg.defaults.mk b/mk/bsd.pkg.defaults.mk
index 9bcef7f02f2..5b87d1dd52d 100644
--- a/mk/bsd.pkg.defaults.mk
+++ b/mk/bsd.pkg.defaults.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.defaults.mk,v 1.171 2003/08/07 16:14:05 agc Exp $
+# $NetBSD: bsd.pkg.defaults.mk,v 1.172 2003/08/08 08:43:39 agc Exp $
#
# A file providing defaults for pkgsrc and the packages collection.
@@ -90,6 +90,13 @@ PKGSRC_MESSAGE_RECIPIENTS?=
# Possible: any login names
# Default: none
+#PKGSRC_SHOW_BUILD_DEFS=
+# Show BUILD_DEFS definitions for a package when it is being built
+# (BUILD_DEFS are extra definitions which govern how some packages are
+# built and behave)
+# Possible: defined, not defined
+# Default: not defined
+
PKGSRC_RUN_TEST?= no
# Run test target before install
# Possible: yes, no
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index c1b40cfdc8c..0059f4914a8 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.1231 2003/08/07 16:14:05 agc Exp $
+# $NetBSD: bsd.pkg.mk,v 1.1232 2003/08/08 08:43:37 agc Exp $
#
# This file is in the public domain.
#
@@ -34,30 +34,32 @@ MAKE_ENV+= USETOOLS="${USETOOLS}"
# Makefile, which are usually not customizable.
.PHONY: pre-extract build-defs-message
pre-extract: build-defs-message
-.if !target(build-defs-message)
+.if !defined(PKGSRC_SHOW_BUILD_DEFS)
+build-defs-message:
+.elif !target(build-defs-message)
build-defs-message: ${WRKDIR}
-.if defined(BUILD_DEFS) && !empty(BUILD_DEFS)
-.if !exists(${WRKDIR}/.bdm_done)
+. if defined(BUILD_DEFS) && !empty(BUILD_DEFS)
+. if !exists(${WRKDIR}/.bdm_done)
@${ECHO} "=========================================================================="
@${ECHO} "The following variables will affect the build process of this package,"
@${ECHO} "${PKGNAME}. Their current value is shown below:"
@${ECHO} ""
-. for var in ${BUILD_DEFS:O:u}
-. if !defined(${var})
+. for var in ${BUILD_DEFS:O}
+. if !defined(${var})
@${ECHO} " * ${var} (not defined)"
-. elif defined(${var}) && empty(${var})
+. elif defined(${var}) && empty(${var})
@${ECHO} " * ${var} (defined)"
-. else
+. else
@${ECHO} " * ${var} = ${${var}}"
-. endif
-. endfor
+. endif
+. endfor
@${ECHO} ""
@${ECHO} "You may want to abort the process now with CTRL+C and change their value"
@${ECHO} "before continuing. Be sure to run \`${MAKE} clean' after the changes."
@${ECHO} "=========================================================================="
@${TOUCH} ${WRKDIR}/.bdm_done
-.endif
-.endif
+. endif
+. endif
.endif
##### Some NetBSD platforms permitted the user to set the binary format while