2013-06-14 13:04:32 +00:00
|
|
|
# These variables are used in port makefiles to define the options for a port.
|
|
|
|
#
|
2021-04-21 10:39:09 +00:00
|
|
|
# OPTIONS_DEFINE - List of options this port accepts
|
|
|
|
# OPTIONS_DEFINE_${ARCH} - List of options this port accepts and are
|
2014-06-18 07:13:26 +00:00
|
|
|
# specific to ${ARCH}
|
|
|
|
# OPTIONS_DEFAULT - List of options activated by default
|
2012-07-16 11:38:36 +00:00
|
|
|
# OPTIONS_DEFAULT_${ARCH} - List of options activated by default for a
|
2014-06-18 07:13:26 +00:00
|
|
|
# given arch
|
2012-07-16 11:38:36 +00:00
|
|
|
#
|
2014-06-18 07:13:26 +00:00
|
|
|
# ${OPTION}_DESC - Description of the ${OPTION}
|
2012-07-16 11:38:36 +00:00
|
|
|
#
|
2014-06-18 07:13:26 +00:00
|
|
|
# OPTIONS_SINGLE - List of single-choice grouped options: 1 and
|
|
|
|
# only 1 among N
|
|
|
|
# OPTIONS_RADIO - List of radio-choice grouped options: 0 or 1
|
|
|
|
# among N
|
|
|
|
# OPTIONS_MULTI - List of multiple-choice grouped options: at
|
|
|
|
# least 1 among N
|
|
|
|
# OPTIONS_GROUP - List of group-choice grouped options: 0 or
|
|
|
|
# more among N
|
2012-07-16 11:38:36 +00:00
|
|
|
#
|
2012-12-10 10:14:05 +00:00
|
|
|
# OPTIONS_SINGLE_${NAME} - List of OPTIONS grouped as single choice (for
|
2014-06-18 07:13:26 +00:00
|
|
|
# the single named as ${NAME} as defined in
|
|
|
|
# OPTIONS_SINGLE)
|
2012-12-10 10:14:05 +00:00
|
|
|
# OPTIONS_RADIO_${NAME} - List of OPTIONS grouped as radio choice (for
|
2014-06-18 07:13:26 +00:00
|
|
|
# the radio named as ${NAME} as defined in
|
|
|
|
# OPTIONS_RADIO)
|
2012-12-10 10:14:05 +00:00
|
|
|
# OPTIONS_MULTI_${NAME} - List of OPTIONS grouped as multiple-choice
|
2014-06-18 07:13:26 +00:00
|
|
|
# (for the multi named as ${NAME} as defined in
|
|
|
|
# OPTIONS_MULTI)
|
2012-12-10 10:14:05 +00:00
|
|
|
# OPTIONS_GROUP_${NAME} - List of OPTIONS grouped as group-choice (for
|
2014-06-18 07:13:26 +00:00
|
|
|
# the group named as ${NAME} as defined in
|
|
|
|
# OPTIONS_GROUP)
|
2013-06-14 13:04:32 +00:00
|
|
|
#
|
2014-06-18 07:13:26 +00:00
|
|
|
# OPTIONS_EXCLUDE - List of options unsupported (useful for slave ports)
|
2013-06-14 13:04:32 +00:00
|
|
|
# OPTIONS_EXCLUDE_${ARCH} - List of options unsupported on a given ${ARCH}
|
2015-03-26 17:31:20 +00:00
|
|
|
# OPTIONS_EXCLUDE_${OPSYS} - List of options unsupported on a given ${OPSYS}
|
2016-11-24 14:45:58 +00:00
|
|
|
# OPTIONS_EXCLUDE_${OPSYS}_${OSREL:R} - List of options unsupported on a given
|
2019-11-07 16:30:12 +00:00
|
|
|
# ${OPSYS} and major version (11/12/13...)
|
2014-06-18 07:13:26 +00:00
|
|
|
# OPTIONS_SLAVE - This is designed for slave ports, it removes an
|
|
|
|
# option from the options list inherited from the
|
|
|
|
# master port and it always adds it to PORT_OPTIONS
|
|
|
|
# meaning activated
|
2013-06-14 13:04:32 +00:00
|
|
|
#
|
|
|
|
# These variables can be used in make.conf to configure options. They are
|
|
|
|
# processed in the order listed below, i.e. later variables override the effects
|
|
|
|
# of previous variables. Options saved using the options dialog are processed
|
|
|
|
# right before OPTIONS_SET_FORCE. When building a port a dialog to configure
|
|
|
|
# options will only appear if there are new options, i.e. options which have not
|
|
|
|
# been configured before either using the option dialog in a previous build or
|
|
|
|
# using the variables below. You can force the dialog to appear by running
|
|
|
|
# "make config".
|
|
|
|
#
|
2014-06-18 07:13:26 +00:00
|
|
|
# OPTIONS_SET - List of options to enable for all ports.
|
|
|
|
# OPTIONS_UNSET - List of options to disable for all ports.
|
2013-07-25 11:47:11 +00:00
|
|
|
# ${OPTIONS_NAME}_SET - List of options to enable for a specific port.
|
|
|
|
# ${OPTIONS_NAME}_UNSET - List of options to disable for a specific port.
|
2013-06-14 13:04:32 +00:00
|
|
|
#
|
2014-06-18 07:13:26 +00:00
|
|
|
# OPTIONS_SET_FORCE - List of options to enable for all ports.
|
2013-06-14 13:04:32 +00:00
|
|
|
# OPTIONS_UNSET_FORCE - List of options to disable for all ports.
|
2013-07-25 11:47:11 +00:00
|
|
|
# ${OPTIONS_NAME}_SET_FORCE - List of options to enable for a specific port.
|
|
|
|
# ${OPTIONS_NAME}_UNSET_FORCE
|
2014-06-18 07:13:26 +00:00
|
|
|
# - List of options to disable for a specific port.
|
2012-12-10 10:14:05 +00:00
|
|
|
#
|
2013-06-14 13:04:32 +00:00
|
|
|
# These variables can be used on the command line. They override the effects of
|
|
|
|
# the make.conf variables above.
|
2013-04-29 14:49:18 +00:00
|
|
|
#
|
2014-06-18 07:13:26 +00:00
|
|
|
# WITH - Set options from the command line
|
|
|
|
# WITHOUT - Unset options from the command line
|
2013-08-01 12:32:52 +00:00
|
|
|
#
|
|
|
|
#
|
2015-12-14 22:44:39 +00:00
|
|
|
# These variables are strictly informational (read-only). They indicate the
|
|
|
|
# current state of the selected options; they are space-delimited lists.
|
|
|
|
#
|
|
|
|
# SELECTED_OPTIONS - list of options set "on"
|
|
|
|
# DESELECTED_OPTIONS - list of options set "off"
|
|
|
|
#
|
|
|
|
#
|
2013-10-01 16:27:52 +00:00
|
|
|
# The following knobs are there to simplify the handling of OPTIONS in simple
|
2013-08-01 12:32:52 +00:00
|
|
|
# cases :
|
|
|
|
#
|
2014-06-18 07:13:26 +00:00
|
|
|
# OPTIONS_SUB When defined it will add to PLIST_SUB:
|
|
|
|
# Option enabled ${opt}=""
|
|
|
|
# Option disabled ${opt}="@comment "
|
2013-08-01 12:32:52 +00:00
|
|
|
#
|
|
|
|
# ${opt}_CONFIGURE_ON When option is enabled, it will add its content to
|
2014-06-18 07:13:26 +00:00
|
|
|
# the CONFIGURE_ARGS.
|
2013-08-01 12:32:52 +00:00
|
|
|
# ${opt}_CONFIGURE_OFF When option is disabled, it will add its content to
|
2014-06-18 07:13:26 +00:00
|
|
|
# the CONFIGURE_ARGS.
|
2013-08-01 12:32:52 +00:00
|
|
|
# ${opt}_CONFIGURE_ENABLE Will add to CONFIGURE_ARGS:
|
2014-06-18 07:13:26 +00:00
|
|
|
# Option enabled --enable-${content}
|
|
|
|
# Option disabled --disable-${content}
|
2013-08-01 12:32:52 +00:00
|
|
|
# ${opt}_CONFIGURE_WITH Will add to CONFIGURE_ARGS:
|
2014-06-18 07:13:26 +00:00
|
|
|
# Option enabled --with-${content}
|
|
|
|
# Option disabled --without-${content}
|
2013-10-30 16:54:09 +00:00
|
|
|
#
|
2014-06-18 07:13:26 +00:00
|
|
|
# ${opt}_CMAKE_ON When option is enabled, it will add its content to
|
|
|
|
# the CMAKE_ARGS.
|
|
|
|
# ${opt}_CMAKE_OFF When option is disabled, it will add its content to
|
|
|
|
# the CMAKE_ARGS.
|
2013-08-01 12:32:52 +00:00
|
|
|
#
|
2016-06-25 22:23:37 +00:00
|
|
|
# ${opt}_CMAKE_BOOL Will add to CMAKE_ARGS:
|
|
|
|
# Option enabled -D${content}:BOOL=true
|
|
|
|
# Option disabled -D${content}:BOOL=false
|
2016-06-26 16:23:37 +00:00
|
|
|
# ${opt}_CMAKE_BOOL_OFF Will add to CMAKE_ARGS:
|
|
|
|
# Option enabled -D${content}:BOOL=false
|
|
|
|
# Option disabled -D${content}:BOOL=true
|
2016-06-25 22:23:37 +00:00
|
|
|
#
|
2014-06-18 07:13:26 +00:00
|
|
|
# ${opt}_QMAKE_ON When option is enabled, it will add its content to
|
|
|
|
# the QMAKE_ARGS.
|
|
|
|
# ${opt}_QMAKE_OFF When option is disabled, it will add its content to
|
|
|
|
# the QMAKE_ARGS.
|
2013-11-22 10:59:03 +00:00
|
|
|
#
|
2017-04-17 18:55:56 +00:00
|
|
|
# ${opt}_MESON_ON When option is enabled, it will add its
|
|
|
|
# content to MESON_ARGS.
|
|
|
|
# ${opt}_MESON_OFF When option is disabled, it will add its
|
|
|
|
# content to MESON_ARGS.
|
|
|
|
#
|
|
|
|
# ${opt}_MESON_TRUE Will add to MESON_ARGS:
|
2017-04-17 20:24:46 +00:00
|
|
|
# Option enabled -D${content}=true
|
|
|
|
# Option disabled -D${content}=false
|
2017-04-17 18:55:56 +00:00
|
|
|
# ${opt}_MESON_FALSE Will add to MESON_ARGS:
|
2017-04-17 20:24:46 +00:00
|
|
|
# Option enabled -D${content}=false
|
|
|
|
# Option disabled -D${content}=true
|
2017-04-17 18:55:56 +00:00
|
|
|
#
|
2017-06-09 18:12:54 +00:00
|
|
|
# ${opt}_MESON_YES Will add to MESON_ARGS:
|
|
|
|
# Option enabled -D${content}=yes
|
|
|
|
# Option disabled -D${content}=no
|
|
|
|
# ${opt}_MESON_NO Will add to MESON_ARGS:
|
|
|
|
# Option enabled -D${content}=no
|
|
|
|
# Option disabled -D${content}=yes
|
|
|
|
#
|
2019-02-25 22:07:54 +00:00
|
|
|
# ${opt}_MESON_ENABLED Will add to MESON_ARGS:
|
|
|
|
# Option enabled -D${content}=enabled
|
|
|
|
# Option disabled -D${content}=disabled
|
|
|
|
# ${opt}_MESON_DISABLED Will add to MESON_ARGS:
|
|
|
|
# Option enabled -D${content}=disabled
|
|
|
|
# Option disabled -D${content}=enabled
|
|
|
|
#
|
2015-08-18 11:00:57 +00:00
|
|
|
# ${opt}_IMPLIES When opt is enabled, options named in IMPLIES will
|
|
|
|
# get enabled too.
|
|
|
|
# ${opt}_PREVENTS When opt is enabled, if any options in PREVENTS are
|
|
|
|
# also enabled, it will produce an error.
|
2015-08-24 13:07:31 +00:00
|
|
|
# ${opt}_PREVENTS_MSG Provides a message explaining why the options
|
|
|
|
# cannot be selected together.
|
2015-08-18 11:00:57 +00:00
|
|
|
#
|
2013-10-04 11:38:13 +00:00
|
|
|
# ${opt}_USE= FOO=bar When option is enabled, it will enable
|
2014-06-18 07:13:26 +00:00
|
|
|
# USE_FOO+= bar
|
|
|
|
# If you need more than one option, you can do
|
|
|
|
# FOO=bar,baz and you'll get USE_FOO=bar baz
|
2015-01-22 12:18:00 +00:00
|
|
|
# ${opt}_USE_OFF= FOO=bar When option is disabled, it will enable
|
|
|
|
# USE_FOO+= bar
|
2013-10-04 11:38:13 +00:00
|
|
|
#
|
2015-08-28 16:18:32 +00:00
|
|
|
# ${opt}_VARS= FOO=bar When option is enabled, it will set
|
2015-08-28 12:28:13 +00:00
|
|
|
# FOO= bar
|
2015-08-28 16:18:32 +00:00
|
|
|
# ${opt}_VARS= FOO+=bar When option is enabled, it will append
|
2015-08-28 12:28:13 +00:00
|
|
|
# FOO+= bar
|
2015-08-28 16:18:32 +00:00
|
|
|
# ${opt}_VARS_OFF= FOO=bar When option is disabled, it will set
|
2015-08-28 12:28:13 +00:00
|
|
|
# FOO= bar
|
2015-08-28 16:18:32 +00:00
|
|
|
# ${opt}_VARS_OFF= FOO+=bar When option is disabled, it will append
|
2015-08-28 12:28:13 +00:00
|
|
|
# FOO+= bar
|
|
|
|
#
|
2014-03-03 18:56:44 +00:00
|
|
|
# For each of the depends target PKG FETCH EXTRACT PATCH BUILD LIB RUN,
|
2013-10-04 10:03:23 +00:00
|
|
|
# defining ${opt}_${deptype}_DEPENDS will add its content to the actual
|
2014-01-27 22:53:24 +00:00
|
|
|
# dependency when the option is enabled. Defining
|
|
|
|
# ${opt}_${deptype}_DEPENDS_OFF will add its content to the actual dependency
|
2014-09-22 12:09:08 +00:00
|
|
|
# when the option is disabled.
|
2016-08-31 13:28:05 +00:00
|
|
|
#
|
|
|
|
# For each of the variables in _OPTIONS_FLAGS below, defining
|
|
|
|
# ${opt}_${variable} will add its content to the actual variable when the
|
|
|
|
# option is enabled. Defining ${opt}_${variable}_OFF will add its content to
|
|
|
|
# the actual variable when the option is disabled.
|
2012-05-29 09:54:27 +00:00
|
|
|
|
|
|
|
##
|
|
|
|
# Set all the options available for the ports, beginning with the
|
|
|
|
# global ones and ending with the ones decided by the maintainer.
|
2013-06-14 12:59:02 +00:00
|
|
|
|
2012-12-10 10:14:05 +00:00
|
|
|
.if !defined(OPTIONSMKINCLUDED)
|
|
|
|
OPTIONSMKINCLUDED= bsd.options.mk
|
2012-05-29 09:54:27 +00:00
|
|
|
|
2016-12-25 12:46:14 +00:00
|
|
|
OPTIONS_NAME?= ${PKGORIGIN:S/\//_/}
|
2013-06-26 07:22:06 +00:00
|
|
|
OPTIONS_FILE?= ${PORT_DBDIR}/${OPTIONS_NAME}/options
|
2012-05-29 09:54:27 +00:00
|
|
|
|
2022-08-08 18:07:00 +00:00
|
|
|
_OPTIONS_FLAGS= ALL_TARGET BROKEN CABAL_EXECUTABLES CATEGORIES CFLAGS CONFIGURE_ENV \
|
|
|
|
CONFLICTS CONFLICTS_BUILD CONFLICTS_INSTALL CPPFLAGS CXXFLAGS \
|
|
|
|
DESKTOP_ENTRIES DISTFILES EXTRA_PATCHES EXTRACT_ONLY \
|
2018-03-03 06:50:15 +00:00
|
|
|
GH_ACCOUNT GH_PROJECT GH_SUBDIR GH_TAGNAME GH_TUPLE \
|
bsd.sites.mk: Support tag names with USE_GITLAB
Since quite some time, it's possible to download generated tarballs from
gitlab for a tag name without knowing the corresponding git hash. This
is preferable because you have a single source of truth about the
software version.
Support this by replacing GL_COMMIT with GL_TAGNAME which also accepts a
commit hash, similar to USE_GITHUB. Unfortunately, there's a catch, the
DISTFILE must be named exactly: ${GL_PROJECT}-${GL_TAGNAME}.tar.bz2,
otherwise it extracts in a directory that contains the commit hash. So,
we can't add the gitlab account or the revision suffix to make it work.
Therefore, detect whether GL_TAGNAME contains a commit hash, and if it
does, use the old behavior of deriving DISTNAME and DISTFILES.
Document in CHANGES, also add a DEV_WARNING similar to USE_GITHUB when
there's an URL in MASTER_SITES that looks like a gitlab URL. With
support for tags, there shouldn't be any reason left to hardcode such an
URL in MASTER_SITES.
PR: 248967
Approved by: portmgr (tcberner, mentor)
Differential Revision: https://reviews.freebsd.org/D37077
2022-10-21 07:10:41 +00:00
|
|
|
GL_ACCOUNT GL_PROJECT GL_SITE GL_SUBDIR GL_TAGNAME GL_TUPLE \
|
2018-03-03 06:50:15 +00:00
|
|
|
IGNORE INFO INSTALL_TARGET LDFLAGS LIBS MAKE_ARGS MAKE_ENV \
|
2016-08-31 12:50:36 +00:00
|
|
|
MASTER_SITES PATCHFILES PATCH_SITES PLIST_DIRS PLIST_FILES \
|
2016-03-15 15:28:50 +00:00
|
|
|
PLIST_SUB PORTDOCS PORTEXAMPLES SUB_FILES SUB_LIST \
|
2019-05-09 14:39:30 +00:00
|
|
|
TEST_TARGET USE_CABAL USES BINARY_ALIAS
|
2018-12-06 20:33:20 +00:00
|
|
|
_OPTIONS_DEPENDS= PKG FETCH EXTRACT PATCH BUILD LIB RUN TEST
|
2019-04-18 14:28:07 +00:00
|
|
|
_ALL_OPTIONS_HELPERS= ${_OPTIONS_DEPENDS:S/$/_DEPENDS/} \
|
|
|
|
${_OPTIONS_DEPENDS:S/$/_DEPENDS_OFF/} \
|
|
|
|
${_OPTIONS_FLAGS:S/$/_OFF/} ${_OPTIONS_FLAGS} \
|
2019-05-09 14:39:30 +00:00
|
|
|
CABAL_FLAGS CMAKE_BOOL CMAKE_BOOL_OFF CMAKE_OFF CMAKE_ON \
|
2019-04-18 14:28:07 +00:00
|
|
|
CONFIGURE_ENABLE CONFIGURE_OFF CONFIGURE_ON \
|
|
|
|
CONFIGURE_WITH IMPLIES MESON_ARGS MESON_DISABLED \
|
|
|
|
MESON_ENABLED MESON_FALSE MESON_OFF MESON_ON MESON_TRUE \
|
2024-01-01 21:53:32 +00:00
|
|
|
PREVENTS PREVENTS_MSG QMAKE_OFF QMAKE_ON \
|
|
|
|
SUBPACKAGES SUBPACKAGES_OFF USE USE_OFF VARS VARS_OFF
|
Rewrite the target ordering code.
The targets now have priority assigned to them, and, when the dependency
ordering magic is done at the end of bsd.port.mk, they are sorted
according to their priority.
This allows USES to add targets easily and have them run whenever they
want without touching bsd.port.mk.
To add a target that runs just before post-configure run, do:
_USES_configure+= 695:my-post-configure
my-post-configure:
do something
To fine tune when the target is ran, look at the values in the *_SEQ
variables at the end of bsd.port.mk, and the other USES.
Allow ports Makefiles to override the priority of targets with the
TARGET_ORDER_OVERRIDE variable. For example, to get post-install
running earlier, (its default is 700) do:
TARGET_ORDER_OVERRIDE= 650:post-install
While there, add options target helpers for the do-* targets when they
exist.
Reviewed by: antoine, bapt
Exp-run by: antoine
Sponsored by: Absolight
Differential Revision: https://reviews.freebsd.org/D3099
2015-08-17 13:31:25 +00:00
|
|
|
|
|
|
|
# The format here is target_family:priority:target-type
|
|
|
|
_OPTIONS_TARGETS= fetch:300:pre fetch:500:do fetch:700:post \
|
|
|
|
extract:300:pre extract:500:do extract:700:post \
|
|
|
|
patch:300:pre patch:500:do patch:700:post \
|
|
|
|
configure:300:pre configure:500:do configure:700:post \
|
|
|
|
build:300:pre build:500:do build:700:post \
|
|
|
|
install:300:pre install:500:do install:700:post \
|
Implemented complete support for test target.
You can now `make test' on any port to run test sequence, no-op by default.
If a port defines TEST_TARGET, it'll run sub-make with specified target,
usually `check' or `test', useful if upstream supports that. The port may
instead define custom do-test target, as well as usual satellite targets:
{pre,do,post}-test, {pre,do,post}-test-OPT, {pre,do,post}-test-OPT-off
`make test' builds and stages port first, so test may use both WRKDIR and
STAGEDIR, and both BUILD and RUN depends are available for test target.
Additionally, TEST_DEPENDS is now properly supported and may be used to
define additional depends specifically for testing.
Framework may define default tests for specific cases. For instance,
perl5.mk and cran.mk already provide default test target on their own.
This commit also converts my ports which have tests to this new framework.
Approved by: portmgr (bapt)
Differential Revision: D3680
2015-09-28 17:20:42 +00:00
|
|
|
test:300:pre test:500:do test:700:post \
|
Rewrite the target ordering code.
The targets now have priority assigned to them, and, when the dependency
ordering magic is done at the end of bsd.port.mk, they are sorted
according to their priority.
This allows USES to add targets easily and have them run whenever they
want without touching bsd.port.mk.
To add a target that runs just before post-configure run, do:
_USES_configure+= 695:my-post-configure
my-post-configure:
do something
To fine tune when the target is ran, look at the values in the *_SEQ
variables at the end of bsd.port.mk, and the other USES.
Allow ports Makefiles to override the priority of targets with the
TARGET_ORDER_OVERRIDE variable. For example, to get post-install
running earlier, (its default is 700) do:
TARGET_ORDER_OVERRIDE= 650:post-install
While there, add options target helpers for the do-* targets when they
exist.
Reviewed by: antoine, bapt
Exp-run by: antoine
Sponsored by: Absolight
Differential Revision: https://reviews.freebsd.org/D3099
2015-08-17 13:31:25 +00:00
|
|
|
package:300:pre package:500:do package:700:post \
|
|
|
|
stage:800:post
|
2014-03-03 18:47:37 +00:00
|
|
|
|
2012-07-16 11:38:36 +00:00
|
|
|
# Add per arch options
|
2022-04-24 10:00:20 +00:00
|
|
|
. for opt in ${OPTIONS_DEFINE_${ARCH}}
|
|
|
|
. if empty(OPTIONS_DEFINE:M${opt})
|
2012-07-16 11:38:36 +00:00
|
|
|
OPTIONS_DEFINE+= ${opt}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. endfor
|
2012-07-16 11:38:36 +00:00
|
|
|
|
|
|
|
# Add per arch defaults
|
2024-03-22 18:35:37 +00:00
|
|
|
. if defined(OPTIONS_DEFAULT_${ARCH})
|
2013-06-10 08:39:14 +00:00
|
|
|
OPTIONS_DEFAULT+= ${OPTIONS_DEFAULT_${ARCH}}
|
2024-03-22 18:35:37 +00:00
|
|
|
. else
|
|
|
|
OPTIONS_DEFAULT+= ${OPTIONS_DEFAULT_OTHER_ARCHS}
|
|
|
|
. endif
|
2012-07-16 11:38:36 +00:00
|
|
|
|
2015-11-13 13:50:35 +00:00
|
|
|
_ALL_EXCLUDE= ${OPTIONS_EXCLUDE_${ARCH}} ${OPTIONS_EXCLUDE} \
|
2016-11-24 14:45:58 +00:00
|
|
|
${OPTIONS_SLAVE} ${OPTIONS_EXCLUDE_${OPSYS}} \
|
|
|
|
${OPTIONS_EXCLUDE_${OPSYS}_${OSREL:R}}
|
2015-11-13 13:50:35 +00:00
|
|
|
|
2022-04-24 10:00:20 +00:00
|
|
|
. for opt in ${OPTIONS_DEFINE:O:u}
|
|
|
|
. if !${_ALL_EXCLUDE:M${opt}}
|
|
|
|
. for opt_implied in ${${opt}_IMPLIES}
|
|
|
|
. if ${_ALL_EXCLUDE:M${opt_implied}}
|
2016-05-03 18:36:29 +00:00
|
|
|
_ALL_EXCLUDE+= ${opt}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
. endif
|
|
|
|
. endfor
|
2016-05-03 18:36:29 +00:00
|
|
|
|
2018-09-10 14:40:57 +00:00
|
|
|
# Remove options the port maintainer doesn't want, part 1
|
2022-04-24 10:00:20 +00:00
|
|
|
. for opt in ${_ALL_EXCLUDE:O:u}
|
2013-04-29 14:49:18 +00:00
|
|
|
OPTIONS_DEFAULT:= ${OPTIONS_DEFAULT:N${opt}}
|
2013-06-10 08:37:14 +00:00
|
|
|
OPTIONS_DEFINE:= ${OPTIONS_DEFINE:N${opt}}
|
2022-04-24 10:00:20 +00:00
|
|
|
. for otype in SINGLE RADIO MULTI GROUP
|
|
|
|
. for m in ${OPTIONS_${otype}}
|
2013-06-10 09:19:38 +00:00
|
|
|
OPTIONS_${otype}_${m}:= ${OPTIONS_${otype}_${m}:N${opt}}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endfor
|
2013-06-10 09:19:38 +00:00
|
|
|
. endfor
|
2013-04-29 14:49:18 +00:00
|
|
|
. endfor
|
2012-05-29 09:54:27 +00:00
|
|
|
|
2013-06-05 17:21:32 +00:00
|
|
|
# Remove empty SINGLE/GROUP/RADIO/MULTI
|
|
|
|
# Can be empty because of exclude/slaves
|
2022-04-24 10:00:20 +00:00
|
|
|
. for otype in SINGLE RADIO MULTI GROUP
|
|
|
|
. for m in ${OPTIONS_${otype}}
|
|
|
|
. if empty(OPTIONS_${otype}_${m})
|
2013-06-10 09:19:38 +00:00
|
|
|
OPTIONS_${otype}:= ${OPTIONS_${otype}:N${m}}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. endfor
|
2013-06-10 09:19:38 +00:00
|
|
|
. endfor
|
2013-06-05 17:21:32 +00:00
|
|
|
|
2013-06-10 08:37:14 +00:00
|
|
|
# Sort options
|
|
|
|
ALL_OPTIONS:= ${OPTIONS_DEFINE:O:u}
|
|
|
|
OPTIONS_DEFAULT:= ${OPTIONS_DEFAULT:O:u}
|
|
|
|
|
2012-07-16 22:36:44 +00:00
|
|
|
# complete list
|
|
|
|
COMPLETE_OPTIONS_LIST= ${ALL_OPTIONS}
|
2022-04-24 10:00:20 +00:00
|
|
|
. for otype in SINGLE RADIO MULTI GROUP
|
|
|
|
. for m in ${OPTIONS_${otype}}
|
2013-06-10 09:27:19 +00:00
|
|
|
COMPLETE_OPTIONS_LIST+= ${OPTIONS_${otype}_${m}}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endfor
|
2013-06-10 09:27:19 +00:00
|
|
|
. endfor
|
2012-07-16 22:36:44 +00:00
|
|
|
|
2018-09-10 14:40:57 +00:00
|
|
|
# Some options are always enabled by default.
|
2022-04-24 10:00:20 +00:00
|
|
|
. for _opt in DOCS NLS EXAMPLES IPV6
|
|
|
|
. if ${COMPLETE_OPTIONS_LIST:M${_opt}}
|
2018-09-10 14:40:57 +00:00
|
|
|
PORT_OPTIONS+= ${_opt}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. endfor
|
2018-09-10 14:40:57 +00:00
|
|
|
|
|
|
|
# Remove options the port maintainer doesn't want, part 2
|
2022-04-24 10:00:20 +00:00
|
|
|
. for opt in ${_ALL_EXCLUDE:O:u}
|
2018-09-10 14:40:57 +00:00
|
|
|
PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endfor
|
2018-09-10 14:40:57 +00:00
|
|
|
|
2012-05-29 09:54:27 +00:00
|
|
|
## Now create the list of activated options
|
2022-04-24 10:00:20 +00:00
|
|
|
. if defined(OPTIONS_OVERRIDE)
|
2012-05-29 09:54:27 +00:00
|
|
|
# Special case $OPTIONS_OVERRIDE; if it is defined forget about anything done
|
|
|
|
# before
|
2013-06-14 12:59:02 +00:00
|
|
|
NEW_OPTIONS=
|
2012-05-29 09:54:27 +00:00
|
|
|
PORT_OPTIONS:= ${OPTIONS_OVERRIDE}
|
2022-04-24 10:00:20 +00:00
|
|
|
. else
|
2013-06-14 12:59:02 +00:00
|
|
|
NEW_OPTIONS= ${COMPLETE_OPTIONS_LIST}
|
2012-05-29 09:54:27 +00:00
|
|
|
|
|
|
|
## Set default options defined by the port maintainer
|
2013-06-14 13:00:48 +00:00
|
|
|
PORT_OPTIONS+= ${OPTIONS_DEFAULT}
|
2012-05-29 09:54:27 +00:00
|
|
|
|
|
|
|
## Set system-wide defined options (set by user in make.conf)
|
2022-04-24 10:00:20 +00:00
|
|
|
. for opt in ${OPTIONS_SET}
|
|
|
|
. if !empty(COMPLETE_OPTIONS_LIST:M${opt})
|
2012-05-29 09:54:27 +00:00
|
|
|
PORT_OPTIONS+= ${opt}
|
2013-06-14 12:59:02 +00:00
|
|
|
NEW_OPTIONS:= ${NEW_OPTIONS:N${opt}}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. endfor
|
2012-05-29 09:54:27 +00:00
|
|
|
|
|
|
|
## Remove the options excluded system-wide (set by user in make.conf)
|
2022-04-24 10:00:20 +00:00
|
|
|
. for opt in ${OPTIONS_UNSET}
|
2012-05-29 09:54:27 +00:00
|
|
|
PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
|
2013-06-14 12:59:02 +00:00
|
|
|
NEW_OPTIONS:= ${NEW_OPTIONS:N${opt}}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endfor
|
2012-05-29 09:54:27 +00:00
|
|
|
|
2013-06-26 07:22:06 +00:00
|
|
|
## Set the options specified per-port (set by user in make.conf)
|
2022-04-24 10:00:20 +00:00
|
|
|
. for opt in ${${OPTIONS_NAME}_SET}
|
|
|
|
. if !empty(COMPLETE_OPTIONS_LIST:M${opt})
|
2013-06-26 07:22:06 +00:00
|
|
|
PORT_OPTIONS+= ${opt}
|
2013-07-25 11:47:11 +00:00
|
|
|
NEW_OPTIONS:= ${NEW_OPTIONS:N${opt}}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. endfor
|
2013-06-26 07:22:06 +00:00
|
|
|
|
|
|
|
## Unset the options excluded per-port (set by user in make.conf)
|
2022-04-24 10:00:20 +00:00
|
|
|
. for opt in ${${OPTIONS_NAME}_UNSET}
|
2013-06-26 07:22:06 +00:00
|
|
|
PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
|
2013-07-25 11:47:11 +00:00
|
|
|
NEW_OPTIONS:= ${NEW_OPTIONS:N${opt}}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endfor
|
2013-06-26 07:22:06 +00:00
|
|
|
|
|
|
|
## options files (from dialog)
|
2022-04-24 10:00:20 +00:00
|
|
|
. if exists(${OPTIONS_FILE}) && !make(rmconfig)
|
2013-06-26 07:22:06 +00:00
|
|
|
. include "${OPTIONS_FILE}"
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
2013-10-30 16:54:09 +00:00
|
|
|
. sinclude "${OPTIONS_FILE}.local"
|
2012-05-29 09:54:27 +00:00
|
|
|
|
2015-08-17 14:20:40 +00:00
|
|
|
_OPTIONS_UNIQUENAME= ${PKGNAMEPREFIX}${PORTNAME}
|
2022-04-24 10:00:20 +00:00
|
|
|
. for _k in SET UNSET SET_FORCE UNSET_FORCE
|
|
|
|
. if defined(${_OPTIONS_UNIQUENAME}_${_k})
|
2015-08-17 14:20:40 +00:00
|
|
|
WARNING+= "You are using ${_OPTIONS_UNIQUENAME}_${_k} which is not supported any more, use:"
|
|
|
|
WARNING+= "${OPTIONS_NAME}_${_k}= ${${_OPTIONS_UNIQUENAME}_${_k}}"
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. endfor
|
2015-08-17 14:20:40 +00:00
|
|
|
|
2012-05-29 09:54:27 +00:00
|
|
|
## Finish by using the options set by the port config dialog, if any
|
2022-04-24 10:00:20 +00:00
|
|
|
. for opt in ${OPTIONS_FILE_SET}
|
|
|
|
. if !empty(COMPLETE_OPTIONS_LIST:M${opt})
|
2012-05-29 09:54:27 +00:00
|
|
|
PORT_OPTIONS+= ${opt}
|
2013-06-14 12:59:02 +00:00
|
|
|
NEW_OPTIONS:= ${NEW_OPTIONS:N${opt}}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. endfor
|
2012-05-29 09:54:27 +00:00
|
|
|
|
2022-04-24 10:00:20 +00:00
|
|
|
. for opt in ${OPTIONS_FILE_UNSET}
|
2012-05-29 09:54:27 +00:00
|
|
|
PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
|
2013-06-14 12:59:02 +00:00
|
|
|
NEW_OPTIONS:= ${NEW_OPTIONS:N${opt}}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endfor
|
2012-05-29 09:54:27 +00:00
|
|
|
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
2012-05-29 09:54:27 +00:00
|
|
|
|
2013-04-29 14:49:18 +00:00
|
|
|
## FORCE
|
|
|
|
## Set system-wide defined options (set by user in make.conf)
|
|
|
|
. for opt in ${OPTIONS_SET_FORCE}
|
|
|
|
. if !empty(COMPLETE_OPTIONS_LIST:M${opt})
|
|
|
|
PORT_OPTIONS+= ${opt}
|
2013-06-14 12:59:02 +00:00
|
|
|
NEW_OPTIONS:= ${NEW_OPTIONS:N${opt}}
|
2013-04-29 14:49:18 +00:00
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
|
|
|
|
## Remove the options excluded system-wide (set by user in make.conf)
|
|
|
|
. for opt in ${OPTIONS_UNSET_FORCE}
|
|
|
|
PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
|
2013-06-14 12:59:02 +00:00
|
|
|
NEW_OPTIONS:= ${NEW_OPTIONS:N${opt}}
|
2013-04-29 14:49:18 +00:00
|
|
|
. endfor
|
|
|
|
|
2013-07-25 11:47:11 +00:00
|
|
|
## Set the options specified per-port (set by user in make.conf)
|
|
|
|
. for opt in ${${OPTIONS_NAME}_SET_FORCE}
|
|
|
|
. if !empty(COMPLETE_OPTIONS_LIST:M${opt})
|
|
|
|
PORT_OPTIONS+= ${opt}
|
|
|
|
NEW_OPTIONS:= ${NEW_OPTIONS:N${opt}}
|
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
|
|
|
|
## Unset the options excluded per-port (set by user in make.conf)
|
|
|
|
. for opt in ${${OPTIONS_NAME}_UNSET_FORCE}
|
|
|
|
PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
|
|
|
|
NEW_OPTIONS:= ${NEW_OPTIONS:N${opt}}
|
|
|
|
. endfor
|
2013-04-29 14:49:18 +00:00
|
|
|
|
|
|
|
|
2012-10-05 13:43:45 +00:00
|
|
|
## Cmdline always win over the rest
|
2022-04-24 10:00:20 +00:00
|
|
|
. for opt in ${WITH}
|
|
|
|
. if !empty(COMPLETE_OPTIONS_LIST:M${opt})
|
2012-10-05 13:43:45 +00:00
|
|
|
PORT_OPTIONS+= ${opt}
|
2013-06-14 12:59:02 +00:00
|
|
|
NEW_OPTIONS:= ${NEW_OPTIONS:N${opt}}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. endfor
|
2012-10-05 13:43:45 +00:00
|
|
|
|
2022-04-24 10:00:20 +00:00
|
|
|
. for opt in ${WITHOUT}
|
2012-10-05 13:43:45 +00:00
|
|
|
PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
|
2013-06-14 12:59:02 +00:00
|
|
|
NEW_OPTIONS:= ${NEW_OPTIONS:N${opt}}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endfor
|
2013-04-29 14:49:18 +00:00
|
|
|
|
2015-08-18 11:00:57 +00:00
|
|
|
## Enable options implied by other options
|
|
|
|
# _PREVENTS is handled in bsd.port.mk:pre-check-config
|
2015-08-21 12:02:50 +00:00
|
|
|
## 1) Build dependency chain in A.B format:
|
|
|
|
_DEPCHAIN=
|
2022-04-24 10:00:20 +00:00
|
|
|
. for opt in ${COMPLETE_OPTIONS_LIST}
|
|
|
|
. for o in ${${opt}_IMPLIES}
|
2015-08-21 12:02:50 +00:00
|
|
|
_DEPCHAIN+= ${opt}.$o
|
2022-04-24 10:00:20 +00:00
|
|
|
. endfor
|
2015-08-18 11:00:57 +00:00
|
|
|
. endfor
|
2015-08-21 12:02:50 +00:00
|
|
|
## 2) Check each dependency pair and if LHS is in PORT_OPTIONS then add RHS.
|
|
|
|
## All of RHS of "RHS.*" (i.e. indirect dependency) are also added for
|
|
|
|
## fast convergence.
|
|
|
|
_PORT_OPTIONS:= ${PORT_OPTIONS}
|
2022-04-24 10:00:20 +00:00
|
|
|
. for _count in _0 ${COMPLETE_OPTIONS_LIST}
|
2015-08-21 13:05:20 +00:00
|
|
|
count= ${_count}
|
2015-08-21 12:02:50 +00:00
|
|
|
### Check if all of the nested dependency are resolved already.
|
2022-04-24 10:00:20 +00:00
|
|
|
. if ${count} == _0 || ${_PORT_OPTIONS} != ${PORT_OPTIONS}
|
2015-08-21 12:02:50 +00:00
|
|
|
PORT_OPTIONS:= ${_PORT_OPTIONS}
|
2022-04-24 10:00:20 +00:00
|
|
|
. for dc in ${_DEPCHAIN}
|
|
|
|
. for opt in ${_PORT_OPTIONS}
|
2015-08-21 12:02:50 +00:00
|
|
|
_opt=${opt}
|
|
|
|
### Add all of direct and indirect dependency only if
|
|
|
|
### they are not in ${PORT_OPTIONS}.
|
2022-04-24 10:00:20 +00:00
|
|
|
. if !empty(_opt:M${dc:R})
|
|
|
|
. for d in ${dc:E} ${_DEPCHAIN:M${dc:E}.*:E}
|
|
|
|
. if empty(_PORT_OPTIONS:M$d)
|
2015-08-21 12:02:50 +00:00
|
|
|
_PORT_OPTIONS+= $d
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
. endif
|
|
|
|
. endfor
|
2015-08-21 12:02:50 +00:00
|
|
|
. endfor
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. endfor
|
2015-08-18 11:00:57 +00:00
|
|
|
|
2013-06-14 13:00:48 +00:00
|
|
|
# Finally, add options required by slave ports
|
|
|
|
PORT_OPTIONS+= ${OPTIONS_SLAVE}
|
|
|
|
|
|
|
|
# Sort options and eliminate duplicates
|
|
|
|
PORT_OPTIONS:= ${PORT_OPTIONS:O:u}
|
2012-10-05 13:43:45 +00:00
|
|
|
|
2018-09-10 13:16:27 +00:00
|
|
|
_REALLY_ALL_POSSIBLE_OPTIONS:= ${COMPLETE_OPTIONS_LIST} ${_ALL_EXCLUDE}
|
|
|
|
_REALLY_ALL_POSSIBLE_OPTIONS:= ${_REALLY_ALL_POSSIBLE_OPTIONS:O:u}
|
|
|
|
|
|
|
|
# Handle PORTDOCS and PORTEXAMPLES
|
2022-04-24 10:00:20 +00:00
|
|
|
. for _type in DOCS EXAMPLES
|
|
|
|
. if !empty(_REALLY_ALL_POSSIBLE_OPTIONS:M${_type})
|
|
|
|
. if empty(PORT_OPTIONS:M${_type})
|
2018-09-10 13:16:27 +00:00
|
|
|
PLIST_SUB+= PORT${_type}="@comment "
|
2022-04-24 10:00:20 +00:00
|
|
|
. else
|
2018-09-10 13:16:27 +00:00
|
|
|
PLIST_SUB+= PORT${_type}=""
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. endif
|
|
|
|
. endfor
|
2012-05-29 15:35:30 +00:00
|
|
|
|
2022-04-24 10:00:20 +00:00
|
|
|
. if defined(NO_OPTIONS_SORT)
|
2013-06-10 08:37:14 +00:00
|
|
|
ALL_OPTIONS= ${OPTIONS_DEFINE}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
2012-06-01 09:06:15 +00:00
|
|
|
|
2022-04-24 10:00:20 +00:00
|
|
|
. for target in ${_OPTIONS_TARGETS:C/:.*//:u}
|
Rewrite the target ordering code.
The targets now have priority assigned to them, and, when the dependency
ordering magic is done at the end of bsd.port.mk, they are sorted
according to their priority.
This allows USES to add targets easily and have them run whenever they
want without touching bsd.port.mk.
To add a target that runs just before post-configure run, do:
_USES_configure+= 695:my-post-configure
my-post-configure:
do something
To fine tune when the target is ran, look at the values in the *_SEQ
variables at the end of bsd.port.mk, and the other USES.
Allow ports Makefiles to override the priority of targets with the
TARGET_ORDER_OVERRIDE variable. For example, to get post-install
running earlier, (its default is 700) do:
TARGET_ORDER_OVERRIDE= 650:post-install
While there, add options target helpers for the do-* targets when they
exist.
Reviewed by: antoine, bapt
Exp-run by: antoine
Sponsored by: Absolight
Differential Revision: https://reviews.freebsd.org/D3099
2015-08-17 13:31:25 +00:00
|
|
|
_OPTIONS_${target}?=
|
2022-04-24 10:00:20 +00:00
|
|
|
. endfor
|
2015-07-01 12:11:16 +00:00
|
|
|
|
2024-01-01 21:53:32 +00:00
|
|
|
# Handle subpackages before the rest to be able to handle options helpers
|
|
|
|
# with subpackages
|
|
|
|
. for opt in ${_REALLY_ALL_POSSIBLE_OPTIONS}
|
|
|
|
. if ${PORT_OPTIONS:M${opt}}
|
|
|
|
. if defined(${opt}_SUBPACKAGES)
|
|
|
|
SUBPACKAGES+= ${${opt}_SUBPACKAGES}
|
|
|
|
. endif
|
|
|
|
. else
|
|
|
|
. if defined(${opt}_SUBPACKAGES_OFF)
|
|
|
|
SUBPACKAGES+= ${${opt}_SUBPACKAGES_OFF}
|
|
|
|
. endif
|
|
|
|
. endif
|
|
|
|
. endfor
|
2022-04-24 10:00:20 +00:00
|
|
|
. for opt in ${_REALLY_ALL_POSSIBLE_OPTIONS}
|
2013-06-14 13:41:37 +00:00
|
|
|
# PLIST_SUB
|
|
|
|
PLIST_SUB?=
|
2014-03-25 18:19:44 +00:00
|
|
|
SUB_LIST?=
|
2022-04-24 10:00:20 +00:00
|
|
|
. if defined(OPTIONS_SUB)
|
|
|
|
. if ! ${PLIST_SUB:M${opt}=*}
|
|
|
|
. if ${PORT_OPTIONS:M${opt}}
|
2014-02-27 16:39:25 +00:00
|
|
|
PLIST_SUB:= ${PLIST_SUB} ${opt}="" NO_${opt}="@comment "
|
2022-04-24 10:00:20 +00:00
|
|
|
. else
|
2014-02-27 16:39:25 +00:00
|
|
|
PLIST_SUB:= ${PLIST_SUB} ${opt}="@comment " NO_${opt}=""
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
2013-06-14 13:41:37 +00:00
|
|
|
. endif
|
2022-04-24 10:00:20 +00:00
|
|
|
. if ! ${SUB_LIST:M${opt}=*}
|
|
|
|
. if ${PORT_OPTIONS:M${opt}}
|
2014-03-25 18:19:44 +00:00
|
|
|
SUB_LIST:= ${SUB_LIST} ${opt}="" NO_${opt}="@comment "
|
2022-04-24 10:00:20 +00:00
|
|
|
. else
|
2014-03-25 18:19:44 +00:00
|
|
|
SUB_LIST:= ${SUB_LIST} ${opt}="@comment " NO_${opt}=""
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
2014-03-25 18:19:44 +00:00
|
|
|
. endif
|
|
|
|
. endif
|
2013-06-14 13:41:37 +00:00
|
|
|
|
2022-04-24 10:00:20 +00:00
|
|
|
. if ${PORT_OPTIONS:M${opt}}
|
|
|
|
. if defined(${opt}_USE)
|
|
|
|
. for option in ${${opt}_USE:C/=.*//:O:u}
|
2016-10-12 12:19:55 +00:00
|
|
|
_u= ${option}
|
|
|
|
USE_${_u:tu}+= ${${opt}_USE:M${option}=*:C/.*=//g:C/,/ /g}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endfor
|
|
|
|
. endif
|
|
|
|
. if defined(${opt}_VARS)
|
|
|
|
. for var in ${${opt}_VARS:C/=.*//:O:u}
|
2015-10-01 07:56:36 +00:00
|
|
|
_u= ${var}
|
2022-04-24 10:00:20 +00:00
|
|
|
. if ${_u:M*+}
|
2015-10-01 07:56:36 +00:00
|
|
|
${_u:C/.$//:tu}+= ${${opt}_VARS:M${var}=*:C/[^+]*\+=//:C/^"(.*)"$$/\1/}
|
2022-04-24 10:00:20 +00:00
|
|
|
. else
|
2015-10-01 07:56:36 +00:00
|
|
|
${_u:tu}= ${${opt}_VARS:M${var}=*:C/[^=]*=//:C/^"(.*)"$$/\1/}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
. endif
|
|
|
|
. if defined(${opt}_CONFIGURE_ENABLE)
|
2015-12-29 17:01:42 +00:00
|
|
|
CONFIGURE_ARGS+= ${${opt}_CONFIGURE_ENABLE:S/^/--enable-/}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. if defined(${opt}_CONFIGURE_WITH)
|
2015-12-29 17:01:42 +00:00
|
|
|
CONFIGURE_ARGS+= ${${opt}_CONFIGURE_WITH:S/^/--with-/}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. if defined(${opt}_CMAKE_BOOL)
|
2016-06-25 22:23:37 +00:00
|
|
|
CMAKE_ARGS+= ${${opt}_CMAKE_BOOL:C/.*/-D&:BOOL=true/}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. if defined(${opt}_CMAKE_BOOL_OFF)
|
2016-06-26 16:23:37 +00:00
|
|
|
CMAKE_ARGS+= ${${opt}_CMAKE_BOOL_OFF:C/.*/-D&:BOOL=false/}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. if defined(${opt}_MESON_TRUE)
|
2017-04-17 18:55:56 +00:00
|
|
|
MESON_ARGS+= ${${opt}_MESON_TRUE:C/.*/-D&=true/}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. if defined(${opt}_MESON_FALSE)
|
2017-04-17 20:24:46 +00:00
|
|
|
MESON_ARGS+= ${${opt}_MESON_FALSE:C/.*/-D&=false/}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. if defined(${opt}_MESON_YES)
|
2017-06-09 18:12:54 +00:00
|
|
|
MESON_ARGS+= ${${opt}_MESON_YES:C/.*/-D&=yes/}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. if defined(${opt}_MESON_NO)
|
2017-06-09 18:12:54 +00:00
|
|
|
MESON_ARGS+= ${${opt}_MESON_NO:C/.*/-D&=no/}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. if defined(${opt}_MESON_ENABLED)
|
2019-02-25 22:07:54 +00:00
|
|
|
MESON_ARGS+= ${${opt}_MESON_ENABLED:C/.*/-D&=enabled/}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. if defined(${opt}_MESON_DISABLED)
|
2019-02-25 22:07:54 +00:00
|
|
|
MESON_ARGS+= ${${opt}_MESON_DISABLED:C/.*/-D&=disabled/}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. if defined(${opt}_CABAL_FLAGS)
|
2019-05-09 14:39:30 +00:00
|
|
|
CABAL_FLAGS+= ${${opt}_CABAL_FLAGS}
|
2013-11-22 10:59:03 +00:00
|
|
|
. endif
|
2022-04-24 10:00:20 +00:00
|
|
|
. for configure in CONFIGURE CMAKE MESON QMAKE
|
|
|
|
. if defined(${opt}_${configure}_ON)
|
|
|
|
${configure}_ARGS+= ${${opt}_${configure}_ON}
|
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
. for flags in ${_OPTIONS_FLAGS}
|
|
|
|
. if defined(${opt}_${flags})
|
2013-06-14 13:41:37 +00:00
|
|
|
${flags}+= ${${opt}_${flags}}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
. for deptype in ${_OPTIONS_DEPENDS}
|
|
|
|
. if defined(${opt}_${deptype}_DEPENDS)
|
2013-06-14 13:41:37 +00:00
|
|
|
${deptype}_DEPENDS+= ${${opt}_${deptype}_DEPENDS}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
2024-01-01 21:53:32 +00:00
|
|
|
. for p in ${SUBPACKAGES}
|
|
|
|
. if defined(${opt}_${deptype}_DEPENDS.${p})
|
2024-02-03 12:11:52 +00:00
|
|
|
${deptype}_DEPENDS.${p}+= ${${opt}_${deptype}_DEPENDS.${p}}
|
2024-01-01 21:53:32 +00:00
|
|
|
. endif
|
|
|
|
. endfor
|
2022-04-24 10:00:20 +00:00
|
|
|
. endfor
|
|
|
|
. for target in ${_OPTIONS_TARGETS}
|
Rewrite the target ordering code.
The targets now have priority assigned to them, and, when the dependency
ordering magic is done at the end of bsd.port.mk, they are sorted
according to their priority.
This allows USES to add targets easily and have them run whenever they
want without touching bsd.port.mk.
To add a target that runs just before post-configure run, do:
_USES_configure+= 695:my-post-configure
my-post-configure:
do something
To fine tune when the target is ran, look at the values in the *_SEQ
variables at the end of bsd.port.mk, and the other USES.
Allow ports Makefiles to override the priority of targets with the
TARGET_ORDER_OVERRIDE variable. For example, to get post-install
running earlier, (its default is 700) do:
TARGET_ORDER_OVERRIDE= 650:post-install
While there, add options target helpers for the do-* targets when they
exist.
Reviewed by: antoine, bapt
Exp-run by: antoine
Sponsored by: Absolight
Differential Revision: https://reviews.freebsd.org/D3099
2015-08-17 13:31:25 +00:00
|
|
|
_target= ${target:C/:.*//}
|
|
|
|
_prio= ${target:C/.*:(.*):.*/\1/}
|
|
|
|
_type= ${target:C/.*://}
|
|
|
|
_OPTIONS_${_target}:= ${_OPTIONS_${_target}} ${_prio}:${_type}-${_target}-${opt}-on
|
2022-04-24 10:00:20 +00:00
|
|
|
. endfor
|
|
|
|
. else
|
|
|
|
. if defined(${opt}_USE_OFF)
|
|
|
|
. for option in ${${opt}_USE_OFF:C/=.*//:O:u}
|
2016-10-12 12:19:55 +00:00
|
|
|
_u= ${option}
|
|
|
|
USE_${_u:tu}+= ${${opt}_USE_OFF:M${option}=*:C/.*=//g:C/,/ /g}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endfor
|
|
|
|
. endif
|
|
|
|
. if defined(${opt}_VARS_OFF)
|
|
|
|
. for var in ${${opt}_VARS_OFF:C/=.*//:O:u}
|
2015-10-01 07:56:36 +00:00
|
|
|
_u= ${var}
|
2022-04-24 10:00:20 +00:00
|
|
|
. if ${_u:M*+}
|
2015-10-01 07:56:36 +00:00
|
|
|
${_u:C/.$//:tu}+= ${${opt}_VARS_OFF:M${var}=*:C/[^+]*\+=//:C/^"(.*)"$$/\1/}
|
2022-04-24 10:00:20 +00:00
|
|
|
. else
|
2015-10-01 07:56:36 +00:00
|
|
|
${_u:tu}= ${${opt}_VARS_OFF:M${var}=*:C/[^=]*=//:C/^"(.*)"$$/\1/}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
. endif
|
|
|
|
. if defined(${opt}_CONFIGURE_ENABLE)
|
2015-12-29 16:19:55 +00:00
|
|
|
CONFIGURE_ARGS+= ${${opt}_CONFIGURE_ENABLE:S/^/--disable-/:C/=.*//}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. if defined(${opt}_CONFIGURE_WITH)
|
2015-12-29 17:01:42 +00:00
|
|
|
CONFIGURE_ARGS+= ${${opt}_CONFIGURE_WITH:S/^/--without-/:C/=.*//}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. if defined(${opt}_CMAKE_BOOL)
|
2016-06-25 22:23:37 +00:00
|
|
|
CMAKE_ARGS+= ${${opt}_CMAKE_BOOL:C/.*/-D&:BOOL=false/}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. if defined(${opt}_CMAKE_BOOL_OFF)
|
2016-06-26 16:23:37 +00:00
|
|
|
CMAKE_ARGS+= ${${opt}_CMAKE_BOOL_OFF:C/.*/-D&:BOOL=true/}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. if defined(${opt}_MESON_TRUE)
|
2017-04-17 20:24:46 +00:00
|
|
|
MESON_ARGS+= ${${opt}_MESON_TRUE:C/.*/-D&=false/}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. if defined(${opt}_MESON_FALSE)
|
2017-04-17 20:24:46 +00:00
|
|
|
MESON_ARGS+= ${${opt}_MESON_FALSE:C/.*/-D&=true/}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. if defined(${opt}_MESON_YES)
|
2017-06-09 18:12:54 +00:00
|
|
|
MESON_ARGS+= ${${opt}_MESON_YES:C/.*/-D&=no/}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. if defined(${opt}_MESON_NO)
|
2017-06-09 18:12:54 +00:00
|
|
|
MESON_ARGS+= ${${opt}_MESON_NO:C/.*/-D&=yes/}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. if defined(${opt}_MESON_ENABLED)
|
2019-02-25 22:07:54 +00:00
|
|
|
MESON_ARGS+= ${${opt}_MESON_ENABLED:C/.*/-D&=disabled/}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. if defined(${opt}_MESON_DISABLED)
|
2019-02-25 22:07:54 +00:00
|
|
|
MESON_ARGS+= ${${opt}_MESON_DISABLED:C/.*/-D&=enabled/}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. if defined(${opt}_CABAL_FLAGS)
|
2019-05-09 14:39:30 +00:00
|
|
|
CABAL_FLAGS+= -${${opt}_CABAL_FLAGS}
|
2013-11-22 10:59:03 +00:00
|
|
|
. endif
|
2022-04-24 10:00:20 +00:00
|
|
|
. for configure in CONFIGURE CMAKE MESON QMAKE
|
|
|
|
. if defined(${opt}_${configure}_OFF)
|
|
|
|
${configure}_ARGS+= ${${opt}_${configure}_OFF}
|
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
. for flags in ${_OPTIONS_FLAGS}
|
|
|
|
. if defined(${opt}_${flags}_OFF)
|
2014-01-27 22:53:24 +00:00
|
|
|
${flags}+= ${${opt}_${flags}_OFF}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
. for deptype in ${_OPTIONS_DEPENDS}
|
|
|
|
. if defined(${opt}_${deptype}_DEPENDS_OFF)
|
2014-01-27 22:53:24 +00:00
|
|
|
${deptype}_DEPENDS+= ${${opt}_${deptype}_DEPENDS_OFF}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
2024-01-01 21:53:32 +00:00
|
|
|
. for p in ${SUBPACKAGES}
|
|
|
|
. if defined(${opt}_${deptype}_DEPENDS_OFF.${p})
|
2024-02-03 12:11:52 +00:00
|
|
|
${deptype}_DEPENDS.${p}+= ${${opt}_${deptype}_DEPENDS_OFF.${p}}
|
2024-01-01 21:53:32 +00:00
|
|
|
. endif
|
|
|
|
. endfor
|
2022-04-24 10:00:20 +00:00
|
|
|
. endfor
|
|
|
|
. for target in ${_OPTIONS_TARGETS}
|
Rewrite the target ordering code.
The targets now have priority assigned to them, and, when the dependency
ordering magic is done at the end of bsd.port.mk, they are sorted
according to their priority.
This allows USES to add targets easily and have them run whenever they
want without touching bsd.port.mk.
To add a target that runs just before post-configure run, do:
_USES_configure+= 695:my-post-configure
my-post-configure:
do something
To fine tune when the target is ran, look at the values in the *_SEQ
variables at the end of bsd.port.mk, and the other USES.
Allow ports Makefiles to override the priority of targets with the
TARGET_ORDER_OVERRIDE variable. For example, to get post-install
running earlier, (its default is 700) do:
TARGET_ORDER_OVERRIDE= 650:post-install
While there, add options target helpers for the do-* targets when they
exist.
Reviewed by: antoine, bapt
Exp-run by: antoine
Sponsored by: Absolight
Differential Revision: https://reviews.freebsd.org/D3099
2015-08-17 13:31:25 +00:00
|
|
|
_target= ${target:C/:.*//}
|
|
|
|
_prio= ${target:C/.*:(.*):.*/\1/}
|
|
|
|
_type= ${target:C/.*://}
|
|
|
|
_OPTIONS_${_target}:= ${_OPTIONS_${_target}} ${_prio}:${_type}-${_target}-${opt}-off
|
2022-04-24 10:00:20 +00:00
|
|
|
. endfor
|
|
|
|
. endif
|
|
|
|
. endfor
|
2013-06-14 13:41:37 +00:00
|
|
|
|
2019-04-18 14:28:07 +00:00
|
|
|
# Collect which options helpers are defined at this point for
|
|
|
|
# bsd.sanity.mk later to make sure no other options helper is
|
|
|
|
# defined after bsd.port.options.mk.
|
|
|
|
_OPTIONS_HELPERS_SEEN=
|
2022-04-24 10:00:20 +00:00
|
|
|
. for opt in ${_REALLY_ALL_POSSIBLE_OPTIONS}
|
|
|
|
. for helper in ${_ALL_OPTIONS_HELPERS}
|
|
|
|
. if defined(${opt}_${helper})
|
2019-04-18 14:28:07 +00:00
|
|
|
_OPTIONS_HELPERS_SEEN+= ${opt}_${helper}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. endfor
|
2019-04-18 14:28:07 +00:00
|
|
|
. endfor
|
|
|
|
|
2015-12-14 22:44:39 +00:00
|
|
|
.undef (SELECTED_OPTIONS)
|
|
|
|
.undef (DESELECTED_OPTIONS)
|
2017-11-15 19:13:50 +00:00
|
|
|
# Wait to expand PORT_OPTIONS until the last moment in case something modifies
|
|
|
|
# the selected OPTIONS after bsd.port.options.mk is included. This uses
|
|
|
|
# bmake's :@ for loop.
|
2017-11-16 19:41:20 +00:00
|
|
|
_SELECTED_OPTIONS= ${ALL_OPTIONS:@opt@${PORT_OPTIONS:M${opt}}@}
|
|
|
|
_DESELECTED_OPTIONS= ${ALL_OPTIONS:@opt@${"${PORT_OPTIONS:M${opt}}":?:${opt}}@}
|
2022-04-24 10:00:20 +00:00
|
|
|
. for otype in MULTI GROUP SINGLE RADIO
|
|
|
|
. for m in ${OPTIONS_${otype}}
|
2017-11-16 19:41:20 +00:00
|
|
|
_SELECTED_OPTIONS+= ${OPTIONS_${otype}_${m}:@opt@${PORT_OPTIONS:M${opt}}@}
|
|
|
|
_DESELECTED_OPTIONS+= ${OPTIONS_${otype}_${m}:@opt@${"${PORT_OPTIONS:M${opt}}":?:${opt}}@}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endfor
|
2015-12-14 22:44:39 +00:00
|
|
|
. endfor
|
2017-11-16 19:41:20 +00:00
|
|
|
SELECTED_OPTIONS= ${_SELECTED_OPTIONS:O:u}
|
|
|
|
DESELECTED_OPTIONS= ${_DESELECTED_OPTIONS:O:u}
|
2015-12-14 22:44:39 +00:00
|
|
|
|
2013-06-14 13:41:37 +00:00
|
|
|
.endif
|