2008-01-04 02:46:24 +01:00
|
|
|
# $NetBSD: bsd.configure.mk,v 1.11 2008/01/04 01:46:26 rillig Exp $
|
2006-07-05 08:09:15 +02:00
|
|
|
#
|
|
|
|
# This Makefile fragment is included by bsd.pkg.mk and provides all
|
|
|
|
# variables and targets related to configuring packages for building.
|
|
|
|
#
|
|
|
|
# The following are the "public" targets provided by this module:
|
|
|
|
#
|
|
|
|
# configure
|
|
|
|
#
|
|
|
|
# The following targets may be overridden in a package Makefile:
|
|
|
|
#
|
|
|
|
# pre-configure, do-configure, post-configure
|
|
|
|
#
|
|
|
|
|
2006-07-07 23:24:27 +02:00
|
|
|
_COOKIE.configure= ${WRKDIR}/.configure_done
|
2006-07-05 08:09:15 +02:00
|
|
|
|
|
|
|
######################################################################
|
|
|
|
### configure (PUBLIC)
|
|
|
|
######################################################################
|
|
|
|
### configure is a public target to configure the software for building.
|
|
|
|
###
|
|
|
|
.PHONY: configure
|
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".
2006-07-06 00:21:02 +02:00
|
|
|
.if !defined(NO_CONFIGURE)
|
2008-01-04 02:46:24 +01:00
|
|
|
. include "configure.mk"
|
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".
2006-07-06 00:21:02 +02:00
|
|
|
.elif !target(configure)
|
2006-07-07 23:24:27 +02:00
|
|
|
. if exists(${_COOKIE.configure})
|
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".
2006-07-06 00:21:02 +02:00
|
|
|
configure:
|
|
|
|
@${DO_NADA}
|
2006-07-22 18:31:35 +02:00
|
|
|
. elif defined(_PKGSRC_BARRIER)
|
2007-03-07 02:27:27 +01:00
|
|
|
configure: wrapper _configure-cookie
|
2006-07-07 15:39:52 +02:00
|
|
|
. else
|
|
|
|
configure: barrier
|
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".
2006-07-06 00:21:02 +02:00
|
|
|
. endif
|
2006-07-05 08:09:15 +02:00
|
|
|
.endif
|
|
|
|
|
2007-03-07 02:27:27 +01:00
|
|
|
# Creates the "configure" cookie file.
|
|
|
|
_configure-cookie: .PHONY
|
|
|
|
${RUN} [ ! -f ${_COOKIE.configure} ] # XXX: What's the purpose of this assertion?
|
|
|
|
${RUN} ${MKDIR} ${_COOKIE.configure:H}
|
|
|
|
${RUN} ${ECHO} ${PKGNAME} > ${_COOKIE.configure}
|