2008-01-04 02:46:24 +01:00
|
|
|
# $NetBSD: configure.mk,v 1.22 2008/01/04 01:46:26 rillig Exp $
|
2007-03-15 12:20:40 +01:00
|
|
|
#
|
|
|
|
# = Package-settable variables =
|
|
|
|
#
|
|
|
|
# CONFIGURE_ENV is the shell environment that is exported to the
|
|
|
|
# configure script.
|
|
|
|
#
|
|
|
|
# CONFIG_SHELL is the shell that is used for interpreting the
|
|
|
|
# configure script.
|
2006-07-05 08:09:15 +02:00
|
|
|
#
|
|
|
|
# CONFIGURE_SCRIPT is the path to the script to run in order to
|
|
|
|
# configure the software for building. If the path is relative,
|
|
|
|
# then it is assumed to be relative to each directory listed in
|
|
|
|
# CONFIGURE_DIRS.
|
|
|
|
#
|
|
|
|
# CONFIGURE_ARGS is the list of arguments that is passed to the
|
|
|
|
# configure script.
|
|
|
|
#
|
2007-07-12 20:59:15 +02:00
|
|
|
# INSTALL_SH_OVERRIDE is a list of files relative to WRKSRC which
|
|
|
|
# should be overridden by the install-sh script from
|
|
|
|
# sysutils/install-sh. If not defined or set to "no", then
|
|
|
|
# no files are overridden.
|
|
|
|
#
|
|
|
|
# Possible values: no, defined, undefined.
|
|
|
|
#
|
|
|
|
# Default value: defined when GNU_CONFIGURE is defined, undefined
|
|
|
|
# otherwise.
|
|
|
|
#
|
2007-01-07 09:50:38 +01:00
|
|
|
# OVERRIDE_GNU_CONFIG_SCRIPTS
|
|
|
|
# Whether to override the GNU config.guess and config.sub scripts
|
|
|
|
# with the pkgsrc versions.
|
|
|
|
#
|
|
|
|
# Possible values: defined, undefined.
|
|
|
|
#
|
|
|
|
# Default value: defined when GNU_CONFIGURE is defined, undefined
|
|
|
|
# otherwise.
|
|
|
|
#
|
2007-01-08 03:26:03 +01:00
|
|
|
# Command-line variables:
|
|
|
|
#
|
|
|
|
# CONFIG_SHELL_FLAGS
|
|
|
|
# Set this to -x when you really need to see all commands that the
|
|
|
|
# configure script executes.
|
|
|
|
#
|
2007-01-07 09:50:38 +01:00
|
|
|
# Keywords: config.guess config.sub
|
|
|
|
#
|
|
|
|
|
2007-03-15 23:54:24 +01:00
|
|
|
_VARGROUPS+= configure
|
|
|
|
_USER_VARS.configure= CONFIG_SHELL_FLAGS
|
|
|
|
_PKG_VARS.configure= CONFIGURE_ENV CONFIG_SHELL CONFIGURE_SCRIPT \
|
|
|
|
CONFIGURE_ARGS OVERRIDE_GNU_CONFIG_SCRIPTS HAS_CONFIGURE \
|
2007-12-12 02:00:38 +01:00
|
|
|
GNU_CONFIGURE PKGCONFIG_OVERRIDE USE_PKGLOCALEDIR \
|
|
|
|
CMAKE_ARGS CMAKE_ARG_PATH
|
2007-03-15 23:54:24 +01:00
|
|
|
|
2006-07-05 08:09:15 +02:00
|
|
|
CONFIGURE_SCRIPT?= ./configure
|
|
|
|
CONFIGURE_ENV+= ${ALL_ENV}
|
|
|
|
CONFIGURE_ARGS?= # empty
|
2007-03-15 12:20:40 +01:00
|
|
|
CONFIG_SHELL?= ${SH}
|
2007-01-08 03:26:03 +01:00
|
|
|
CONFIG_SHELL_FLAGS?= # none
|
2007-12-12 02:00:38 +01:00
|
|
|
CMAKE_ARGS?= # empty
|
|
|
|
CMAKE_ARG_PATH?= .
|
|
|
|
_BUILD_DEFS+= CONFIGURE_ENV CONFIGURE_ARGS CMAKE_ARGS
|
2006-07-05 08:09:15 +02:00
|
|
|
|
|
|
|
.if defined(GNU_CONFIGURE)
|
2008-01-04 02:46:24 +01:00
|
|
|
. include "gnu-configure.mk"
|
2006-07-05 08:09:15 +02:00
|
|
|
.endif
|
|
|
|
.if defined(OVERRIDE_GNU_CONFIG_SCRIPTS)
|
2008-01-04 02:46:24 +01:00
|
|
|
. include "config-override.mk"
|
2006-07-05 08:09:15 +02:00
|
|
|
.endif
|
2007-07-12 20:59:15 +02:00
|
|
|
.if defined(INSTALL_SH_OVERRIDE) && empty(INSTALL_SH_OVERRIDE:M[Nn][Oo])
|
2008-01-04 02:46:24 +01:00
|
|
|
. include "install-sh-override.mk"
|
2007-07-12 20:59:15 +02:00
|
|
|
.endif
|
2006-07-05 08:09:15 +02:00
|
|
|
.if defined(USE_LIBTOOL)
|
2008-01-04 02:46:24 +01:00
|
|
|
. include "libtool-override.mk"
|
2006-07-05 08:09:15 +02:00
|
|
|
.endif
|
|
|
|
.if defined(PKGCONFIG_OVERRIDE)
|
2008-01-04 02:46:24 +01:00
|
|
|
. include "pkg-config-override.mk"
|
2006-07-05 08:09:15 +02:00
|
|
|
.endif
|
2008-01-04 02:46:24 +01:00
|
|
|
.include "replace-interpreter.mk"
|
2006-07-05 08:09:15 +02:00
|
|
|
.if defined(USE_PKGLOCALEDIR)
|
2008-01-04 02:46:24 +01:00
|
|
|
. include "replace-localedir.mk"
|
2006-07-05 08:09:15 +02:00
|
|
|
.endif
|
2007-12-12 02:00:38 +01:00
|
|
|
.if defined(USE_CMAKE)
|
2008-01-04 02:46:24 +01:00
|
|
|
. include "cmake.mk"
|
2007-12-12 02:00:38 +01:00
|
|
|
.endif
|
2006-07-05 08:09:15 +02:00
|
|
|
|
|
|
|
######################################################################
|
|
|
|
### configure (PUBLIC)
|
|
|
|
######################################################################
|
|
|
|
### configure is a public target to configure the sources for building.
|
|
|
|
###
|
2006-07-05 11:08:35 +02:00
|
|
|
_CONFIGURE_TARGETS+= check-vulnerable
|
2006-07-27 15:47:29 +02:00
|
|
|
_CONFIGURE_TARGETS+= wrapper
|
2006-07-05 08:09:15 +02:00
|
|
|
_CONFIGURE_TARGETS+= acquire-configure-lock
|
2006-07-07 23:24:27 +02:00
|
|
|
_CONFIGURE_TARGETS+= ${_COOKIE.configure}
|
2006-07-05 08:09:15 +02:00
|
|
|
_CONFIGURE_TARGETS+= release-configure-lock
|
|
|
|
|
|
|
|
.PHONY: configure
|
|
|
|
.if !target(configure)
|
2006-07-07 23:24:27 +02:00
|
|
|
. if exists(${_COOKIE.configure})
|
2006-07-05 11:08:35 +02:00
|
|
|
configure:
|
|
|
|
@${DO_NADA}
|
2006-07-22 18:31:35 +02:00
|
|
|
. elif defined(_PKGSRC_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
|
|
|
configure: ${_CONFIGURE_TARGETS}
|
|
|
|
. else
|
|
|
|
configure: barrier
|
2006-07-05 11:08:35 +02:00
|
|
|
. endif
|
2006-07-05 08:09:15 +02:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.PHONY: acquire-configure-lock release-configure-lock
|
|
|
|
acquire-configure-lock: acquire-lock
|
|
|
|
release-configure-lock: release-lock
|
|
|
|
|
2006-07-07 23:24:27 +02:00
|
|
|
.if exists(${_COOKIE.configure})
|
|
|
|
${_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
|
|
|
@${DO_NADA}
|
2006-07-05 08:09:15 +02:00
|
|
|
.else
|
2006-07-07 23:24:27 +02:00
|
|
|
${_COOKIE.configure}: real-configure
|
2006-07-05 08:09:15 +02:00
|
|
|
.endif
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
### real-configure (PRIVATE)
|
|
|
|
######################################################################
|
|
|
|
### real-configure is a helper target onto which one can hook all of the
|
|
|
|
### targets that do the actual configuration of the sources.
|
|
|
|
###
|
2006-11-09 03:53:15 +01:00
|
|
|
#
|
|
|
|
# Note: pre-configure-checks-hook comes after pre-configure to allow
|
|
|
|
# packages for fixing bad files with SUBST_STAGE.* = pre-configure.
|
|
|
|
#
|
2006-07-05 08:09:15 +02:00
|
|
|
_REAL_CONFIGURE_TARGETS+= configure-check-interactive
|
|
|
|
_REAL_CONFIGURE_TARGETS+= configure-message
|
|
|
|
_REAL_CONFIGURE_TARGETS+= configure-vars
|
|
|
|
_REAL_CONFIGURE_TARGETS+= pre-configure
|
|
|
|
_REAL_CONFIGURE_TARGETS+= do-configure-pre-hook
|
2007-11-01 09:37:24 +01:00
|
|
|
_REAL_CONFIGURE_TARGETS+= pre-configure-checks-hook
|
2006-07-05 08:09:15 +02:00
|
|
|
_REAL_CONFIGURE_TARGETS+= do-configure
|
|
|
|
_REAL_CONFIGURE_TARGETS+= do-configure-post-hook
|
|
|
|
_REAL_CONFIGURE_TARGETS+= post-configure
|
2007-03-07 02:27:27 +01:00
|
|
|
_REAL_CONFIGURE_TARGETS+= _configure-cookie
|
2006-07-05 08:09:15 +02:00
|
|
|
_REAL_CONFIGURE_TARGETS+= error-check
|
|
|
|
|
|
|
|
.PHONY: real-configure
|
|
|
|
real-configure: ${_REAL_CONFIGURE_TARGETS}
|
|
|
|
|
|
|
|
.PHONY: configure-message
|
|
|
|
configure-message:
|
|
|
|
@${PHASE_MSG} "Configuring for ${PKGNAME}"
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
### configure-check-interactive (PRIVATE)
|
|
|
|
######################################################################
|
|
|
|
### configure-check-interactive checks whether we must do an interactive
|
|
|
|
### configuration or not.
|
|
|
|
###
|
|
|
|
configure-check-interactive:
|
|
|
|
.if !empty(INTERACTIVE_STAGE:Mconfigure) && defined(BATCH)
|
|
|
|
@${ERROR_MSG} "The configure stage of this package requires user interaction"
|
|
|
|
@${ERROR_MSG} "Please configure manually with:"
|
|
|
|
@${ERROR_MSG} " \"cd ${.CURDIR} && ${MAKE} configure\""
|
2007-12-01 12:11:53 +01:00
|
|
|
${RUN} ${FALSE}
|
2006-07-05 08:09:15 +02:00
|
|
|
.else
|
|
|
|
@${DO_NADA}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
### do-configure-pre-hook (PRIVATE)
|
|
|
|
######################################################################
|
|
|
|
### do-configure-pre-hook is a helper target onto which one can hook
|
|
|
|
### all of the targets that should be run after pre-configure but before
|
|
|
|
### do-configure. These targets typically edit the files used by the
|
|
|
|
### do-configure target.
|
|
|
|
###
|
|
|
|
.PHONY: do-configure-pre-hook
|
|
|
|
do-configure-pre-hook:
|
|
|
|
@${DO_NADA}
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
### do-configure-post-hook (PRIVATE)
|
|
|
|
######################################################################
|
|
|
|
### do-configure-post-hook is a helper target onto which one can hook
|
|
|
|
### all of the targets that should be run after do-configure but before
|
|
|
|
### post-configure. These targets typically edit the files generated
|
|
|
|
### by the do-configure target that are used during the build phase.
|
|
|
|
###
|
|
|
|
.PHONY: do-configure-post-hook
|
|
|
|
do-configure-post-hook:
|
|
|
|
@${DO_NADA}
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
### do-configure-script (PRIVATE)
|
|
|
|
######################################################################
|
|
|
|
### do-configure-script runs the configure script to configure the
|
|
|
|
### software for building.
|
|
|
|
###
|
|
|
|
_CONFIGURE_SCRIPT_ENV+= INSTALL=${INSTALL:Q}\ -c\ -o\ ${BINOWN}\ -g\ ${BINGRP}
|
|
|
|
_CONFIGURE_SCRIPT_ENV+= INSTALL_PROGRAM=${INSTALL_PROGRAM:Q}
|
|
|
|
_CONFIGURE_SCRIPT_ENV+= INSTALL_SCRIPT=${INSTALL_SCRIPT:Q}
|
|
|
|
_CONFIGURE_SCRIPT_ENV+= INSTALL_DATA=${INSTALL_DATA:Q}
|
|
|
|
_CONFIGURE_SCRIPT_ENV+= INSTALL_GAME=${INSTALL_GAME:Q}
|
|
|
|
_CONFIGURE_SCRIPT_ENV+= INSTALL_GAME_DATA=${INSTALL_GAME_DATA:Q}
|
|
|
|
_CONFIGURE_SCRIPT_ENV+= ${CONFIGURE_ENV}
|
|
|
|
|
|
|
|
.PHONY: do-configure-script
|
|
|
|
do-configure-script:
|
|
|
|
.for _dir_ in ${CONFIGURE_DIRS}
|
|
|
|
${_PKG_SILENT}${_PKG_DEBUG}${_ULIMIT_CMD} \
|
|
|
|
cd ${WRKSRC} && cd ${_dir_} && \
|
|
|
|
${SETENV} ${_CONFIGURE_SCRIPT_ENV} \
|
2007-01-08 03:26:03 +01:00
|
|
|
${CONFIG_SHELL} ${CONFIG_SHELL_FLAGS} \
|
|
|
|
${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS}
|
2006-07-05 08:09:15 +02:00
|
|
|
.endfor
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
### do-configure-imake (PRIVATE)
|
|
|
|
######################################################################
|
|
|
|
### do-configure-imake runs xmkmf and imake to configure the software
|
|
|
|
### for building.
|
|
|
|
###
|
|
|
|
_CONFIGURE_IMAKE_ENV+= XPROJECTROOT=${X11BASE:Q}
|
|
|
|
_CONFIGURE_IMAKE_ENV+= ${SCRIPTS_ENV}
|
|
|
|
|
|
|
|
.PHONY: do-configure-imake
|
|
|
|
do-configure-imake:
|
|
|
|
.for _dir_ in ${CONFIGURE_DIRS}
|
|
|
|
${_PKG_SILENT}${_PKG_DEBUG} \
|
|
|
|
cd ${WRKSRC} && cd ${_dir_} && \
|
|
|
|
${SETENV} ${_CONFIGURE_IMAKE_ENV} ${XMKMF}
|
|
|
|
.endfor
|
|
|
|
|
2007-12-12 02:00:38 +01:00
|
|
|
######################################################################
|
|
|
|
### do-configure-cmake (PRIVATE)
|
|
|
|
######################################################################
|
|
|
|
### do-configure-cmake runs cmake to configure the software for
|
|
|
|
### building.
|
|
|
|
###
|
|
|
|
_CONFIGURE_CMAKE_ENV+= BUILDLINK_DIR=${BUILDLINK_DIR}
|
|
|
|
_CONFIGURE_CMAKE_ENV+= ${CONFIGURE_ENV}
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: do-configure-cmake
|
|
|
|
do-configure-cmake:
|
|
|
|
.for _dir_ in ${CONFIGURE_DIRS}
|
|
|
|
${_PKG_SILENT}${_PKG_DEBUG}${_ULIMIT_CMD} \
|
|
|
|
cd ${WRKSRC} && cd ${_dir_} && \
|
|
|
|
${SETENV} ${_CONFIGURE_CMAKE_ENV} \
|
|
|
|
cmake ${CMAKE_ARGS} ${CMAKE_ARG_PATH}
|
|
|
|
.endfor
|
|
|
|
|
2006-07-05 08:09:15 +02:00
|
|
|
######################################################################
|
|
|
|
### pre-configure, do-configure, post-configure (PUBLIC, override)
|
|
|
|
######################################################################
|
|
|
|
### {pre,do,post}-configure are the heart of the package-customizable
|
|
|
|
### configure targets, and may be overridden within a package Makefile.
|
|
|
|
###
|
|
|
|
.PHONY: pre-configure do-configure post-configure
|
|
|
|
|
|
|
|
_DO_CONFIGURE_TARGETS+= ${HAS_CONFIGURE:D do-configure-script}
|
|
|
|
_DO_CONFIGURE_TARGETS+= ${USE_IMAKE:D do-configure-imake}
|
2007-12-12 02:00:38 +01:00
|
|
|
_DO_CONFIGURE_TARGETS+= ${USE_CMAKE:D do-configure-cmake}
|
2006-07-05 08:09:15 +02:00
|
|
|
|
|
|
|
.if !target(do-configure)
|
|
|
|
do-configure: ${_DO_CONFIGURE_TARGETS}
|
|
|
|
@${DO_NADA}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !target(pre-configure)
|
|
|
|
pre-configure:
|
|
|
|
@${DO_NADA}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !target(post-configure)
|
|
|
|
post-configure:
|
|
|
|
@${DO_NADA}
|
|
|
|
.endif
|
2007-01-08 03:26:03 +01:00
|
|
|
|
|
|
|
# configure-help:
|
|
|
|
# Runs ${CONFIGURE_SCRIPT} --help. It is mainly intended for
|
|
|
|
# package developers so they can quickly see the options of the
|
|
|
|
# configure script.
|
|
|
|
#
|
|
|
|
configure-help:
|
|
|
|
.for d in ${CONFIGURE_DIRS}
|
|
|
|
${RUN} cd ${WRKSRC} && cd ${d} && ${SETENV} ${_CONFIGURE_SCRIPT_ENV} ${CONFIG_SHELL} ${CONFIGURE_SCRIPT} --help
|
|
|
|
.endfor
|