summaryrefslogtreecommitdiff
path: root/mk/internal
diff options
context:
space:
mode:
authorrillig <rillig>2006-07-15 23:58:52 +0000
committerrillig <rillig>2006-07-15 23:58:52 +0000
commitea086260a3ba9a8e4ebc4eedb518ba14c24c0bc4 (patch)
treea4b93f8fac3a6f560860ad528f5b8c399b8d67b1 /mk/internal
parentbb4fe20437133bc5c01c09b51dc237baf87389d4 (diff)
downloadpkgsrc-ea086260a3ba9a8e4ebc4eedb518ba14c24c0bc4.tar.gz
Split the variable BUILD_DEFS into those that are defined by packages
and those that are defined by the infrastructure (_BUILD_DEFS). This allows the build-defs-message target to be moved to the end of bsd.pkg.mk. Now it prints the correct result even in unprivileged builds, which had been wrong due to the order in which the files have been included. For example, ${UNPRIVILEGED_USER} was displayed as (not defined) although its value was defined, which could be checked with "bmake show-var". Tested with one package that _does_ define BUILD_DEFS and with one that doesn't. The behavior stays the same.
Diffstat (limited to 'mk/internal')
-rw-r--r--mk/internal/build-defs-message.mk37
1 files changed, 37 insertions, 0 deletions
diff --git a/mk/internal/build-defs-message.mk b/mk/internal/build-defs-message.mk
new file mode 100644
index 00000000000..7cd032c6121
--- /dev/null
+++ b/mk/internal/build-defs-message.mk
@@ -0,0 +1,37 @@
+# $NetBSD: build-defs-message.mk,v 1.1 2006/07/15 23:58:52 rillig Exp $
+#
+
+# The build-defs-message target shows the variables that can be configured
+# by the pkgsrc user in mk.conf.
+#
+
+.PHONY: build-defs-message
+pre-depends-hook: build-defs-message
+.if empty(PKGSRC_SHOW_BUILD_DEFS:M[yY][eE][sS])
+build-defs-message:
+.elif !target(build-defs-message)
+build-defs-message: ${WRKDIR}
+. 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}
+. if !defined(${var})
+ @${ECHO} " * ${var} (not defined)"
+. elif defined(${var}) && empty(${var})
+ @${ECHO} " * ${var} (defined)"
+. else
+ @${ECHO} " * ${var} = ${${var}}"
+. 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"
+ @${ECHO} "the changes."
+ @${ECHO} "=========================================================================="
+ @${TOUCH} ${WRKDIR}/.bdm_done
+. endif
+. endif
+.endif