diff options
author | jlam <jlam> | 2006-07-05 22:21:02 +0000 |
---|---|---|
committer | jlam <jlam> | 2006-07-05 22:21:02 +0000 |
commit | 339c6c53934769c0df1a7f699a8aa5e1b5f9118a (patch) | |
tree | a30da33e80fce02ecc002e9c7ee00e2f7d9cda05 /mk/configure | |
parent | b0eaf284aab0ecdf90d23be57092a4dd77333bf9 (diff) | |
download | pkgsrc-339c6c53934769c0df1a7f699a8aa5e1b5f9118a.tar.gz |
Flatten out recursive makes into a single re-invocation of make by
introducing the concept of a "barrier". We separate the user-invokable
targets into ones that must happen before the barrier, and ones that
must happen after the barrier. The ones that happen after the barrier
are run in a sub-make process. In this case, the targets that must
be run after the barrier are from the "wrapper" step and beyond. We
rewrite the various "flow" targets, e.g. wrapper, configure, build,
etc., so that they of the right form to use the barrier target.
This now completely removes the concept of PKG_PHASE from pkgsrc. It
is replaced with the concept of "before" and "after" the barrier, and
this state can be checked by testing for the existence of the barrier
cookie file. Because we've removed most of the recursive makes, there
is now nowhere to hook the PKG_ERROR_HANDLER.* commands, so remove
them for now.
As part of this commit, put back the logic that conditionalized the
sources for the various cookie files. Because the sources are all
"phony" targets, they were always run, regardless of whether or not
the cookie file already existed. Now, if a cookie file exists, then
that entire phase associated with that cookie file is skipped.
Lastly, fix a thinko in configure/bsd.configure.mk where setting
NO_CONFIGURE in a package Makefile would manage to skip the "wrapper"
step altogether. Fix this by correctly noting "wrapper" and not
"patch" as the preceding step to "configure".
Diffstat (limited to 'mk/configure')
-rw-r--r-- | mk/configure/bsd.configure.mk | 15 | ||||
-rw-r--r-- | mk/configure/configure.mk | 34 |
2 files changed, 18 insertions, 31 deletions
diff --git a/mk/configure/bsd.configure.mk b/mk/configure/bsd.configure.mk index 901954186fe..a29370c8190 100644 --- a/mk/configure/bsd.configure.mk +++ b/mk/configure/bsd.configure.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.configure.mk,v 1.2 2006/07/05 09:08:35 jlam Exp $ +# $NetBSD: bsd.configure.mk,v 1.3 2006/07/05 22:21:02 jlam Exp $ # # This Makefile fragment is included by bsd.pkg.mk and provides all # variables and targets related to configuring packages for building. @@ -20,12 +20,15 @@ _CONFIGURE_COOKIE= ${WRKDIR}/.configure_done ### configure is a public target to configure the software for building. ### .PHONY: configure -.if defined(NO_CONFIGURE) -. if !target(configure) -configure: patch configure-cookie -. endif -.else +.if !defined(NO_CONFIGURE) . include "${PKGSRCDIR}/mk/configure/configure.mk" +.elif !target(configure) +. if exists(${_CONFIGURE_COOKIE}) +configure: + @${DO_NADA} +. else +configure: wrapper configure-cookie +. endif .endif ###################################################################### diff --git a/mk/configure/configure.mk b/mk/configure/configure.mk index fcf990e9e12..c416d02d08e 100644 --- a/mk/configure/configure.mk +++ b/mk/configure/configure.mk @@ -1,4 +1,4 @@ -# $NetBSD: configure.mk,v 1.2 2006/07/05 09:08:35 jlam Exp $ +# $NetBSD: configure.mk,v 1.3 2006/07/05 22:21:02 jlam Exp $ # # CONFIGURE_SCRIPT is the path to the script to run in order to # configure the software for building. If the path is relative, @@ -48,11 +48,13 @@ _CONFIGURE_TARGETS+= release-configure-lock .PHONY: configure .if !target(configure) -. if !exists(${_CONFIGURE_COOKIE}) -configure: ${_CONFIGURE_TARGETS} -. else +. if exists(${_CONFIGURE_COOKIE}) configure: @${DO_NADA} +. elif exists(${_BARRIER_COOKIE}) +configure: ${_CONFIGURE_TARGETS} +. else +configure: barrier . endif .endif @@ -60,29 +62,11 @@ configure: acquire-configure-lock: acquire-lock release-configure-lock: release-lock +.if exists(${_CONFIGURE_COOKIE}) ${_CONFIGURE_COOKIE}: - ${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${SETENV} ${BUILD_ENV} ${MAKE} ${MAKEFLAGS} real-configure PKG_PHASE=configure || ${PKG_ERROR_HANDLER.configure} - -PKG_ERROR_CLASSES+= configure -PKG_ERROR_MSG.configure= \ - "" \ - "There was an error during the \`\`configure'' phase." \ - "Please investigate the following for more information:" -.if defined(GNU_CONFIGURE) -PKG_ERROR_MSG.configure+= \ - " * config.log" \ - " * ${WRKLOG}" \ - "" + @${DO_NADA} .else -PKG_ERROR_MSG.configure+= \ - " * log of the build" \ - " * ${WRKLOG}" \ - "" -.endif -.if defined(BROKEN_IN) -PKG_ERROR_MSG.configure+= \ - " * This package is broken in ${BROKEN_IN}." \ - " * It may be removed in the next branch unless fixed." +${_CONFIGURE_COOKIE}: real-configure .endif ###################################################################### |