Commit graph

38 commits

Author SHA1 Message Date
dillo
a55c83b93b make legacy variables external:
PKG_LEGACY_OPTIONS
	PKG_OPTIONS_DEPRECATED_WARNINGS
2005-06-06 13:54:51 +00:00
dillo
dff8372404 Improve the way option groups are displayed in show-options.
While here, rename _cls_ to _grp_, as they are called groups.
2005-06-04 16:30:19 +00:00
seb
5feada633d Fix variable names in usage example. 2005-06-04 10:11:24 +00:00
dillo
5fa9d959f6 don't requrie PKG_SUPPORTED_OPTIONS to be set when groups are in use 2005-06-03 14:25:47 +00:00
dillo
f91dd9c279 add group options to PKG_SUPPORTED_OPTIONS before includeing
mk/defaults/obsolete.mk so socks and kerberos work when listed in
groups
2005-06-02 21:55:05 +00:00
wiz
0303df72aa Whitespace nit. 2005-06-02 20:43:55 +00:00
dillo
7f874cf6f0 add support for groups of mutually exclusive options via
PKG_OPTIONS_REQUIRED_GROUPS and PKG_OPTIONS_OPTIONAL_GROUPS.
2005-06-02 20:38:09 +00:00
dillo
b05a793493 fix bug in legacy vars handling for option names containing `-',
found by jmmv.
2005-06-01 13:40:14 +00:00
jmmv
33a592167e PKG_FAIL_REASON must be (double-)quoted to achieve the correct output. 2005-05-31 18:25:37 +00:00
wiz
8dfa9a3aa9 Show a deprecated warning even if the deprecated variable is set to
something other than [yY][eE][sS].
If a deprecated warning is defined, interpret it as YES (because some
variables in defaults/mk.conf have defined/not defined as yes/no).

Reviewed by dillo.
2005-05-31 16:03:41 +00:00
rillig
66c9dd0de7 The available options are shown before the dependencies are installed.
Many package options influence the dependencies, so this order is more
likely to be useful.
2005-05-31 15:05:13 +00:00
dillo
8cda012601 Rename describe-options to show-options, replacing the old show-options
target.
2005-05-31 12:10:07 +00:00
dillo
42816a484c To ease cleanup of the options namespace, add code to support legacy
option names:

PKG_OPTIONS_LEGACY_OPTS+=	old:new

If PKG_DEFAULT_OPTIONS or PKG_OPTIONS.foo contains option old (or
-old) it is rewritten to new (or -new) and a warning is issued by
the supported-options-message target.
2005-05-31 11:05:31 +00:00
dillo
7940fef51d set PKG_FAIL_REASON if any unsupported option is listed in PKG_OPTIONS.xxx 2005-05-28 12:14:34 +00:00
dillo
a60e646ed0 fix typo in documentation
add support for negative options in PKG_OPTIONS_LEGACY_VARS (NO_FOO:-foo)
undef temporary variables after for loop
2005-05-25 11:18:35 +00:00
jlam
15cc40e17f The example is missing a definition for PKG_OPTIONS_VAR. 2005-05-19 01:15:57 +00:00
rillig
7168c9aa72 Changed option processing to evaluate the options strictly from left to
right in each variable, starting with the most generic one. Later
definitions override earlier ones. This makes the ``order'' testcase in
regress/pkg-options succeed.
2005-05-16 09:08:29 +00:00
rillig
fc4a97a8d8 Don't process the file if either of PKG_SUPPORTED_OPTIONS or PKG_OPTIONS_VAR
is undefined. This avoids many unnecessary make(1) warnings. As this file
is only intended to be used from packages, don't look for obsolete.mk in
other directories than ../../mk/defaults/.
2005-05-14 02:17:43 +00:00
dillo
56dffda7c7 Rewrite how PKG_OPTIONS is computed:
- PKG_SUGGESTED_OPTIONS (set by pkg maintainer in pkg Makefile)
	lists options enabled by default.
- PKG_DEFAULT_OPTIONS (set by user in /etc/mk.conf)
	enables or disables (when prefixed with `-') options for
	all packages, takes precedence over PKG_SUGGESTED_OPTIONS
- PKG_OPTIONS.foo (set by user in /etc/mk.conf)
	enables or disables (when prefixed with `-') options for
	a specific package, takes precedence over PKG_DEFAULT_OPTIONS
	and PKG_SUGGESTED_OPTIONS

Also simplify conversion of legacy USE_XXX variables to options
via the new PKG_OPTIONS_LEGACY_VARS variable and emit warnings if
legacy variables are in use.

Add a new target describe-options that lists all supported options
with a one-line description, the options enabled by default and
the currently enabled optoions.

Reviewed by jlam and wiz.

XXX: defaults/options.description has to be filled in
XXX: the pkgsrc guide has to be updated
2005-05-08 13:43:30 +00:00
jlam
12e799d380 Make the pretty-printing actually work by passing all of the options on
different lines to the word-wrap script.
2005-04-28 21:58:44 +00:00
jlam
15a56127d9 We don't need to use ${SORT} to sort the options list. VAR:O will do
nicely.
2005-04-28 21:48:14 +00:00
jlam
a80646b20d Defer execution until the value is needed. This avoids needing ${ECHO},
${XARGS}, and ${SORT} until the make targets are executed.
2005-04-28 18:40:35 +00:00
tv
db5bb1ad1d Merge down janitorial change from tv-derecurse branch:
No need to do .som_done dance; just show the message as part of the
pre-extract phase.  If that means showing it more than once if the extract
is interrupted and restarted, no harm done.
2005-01-24 18:04:24 +00:00
adrianp
204ac90729 Fix endif typo 2005-01-15 08:59:28 +00:00
schmonz
c0b159de2e In the show-options target, ensure that PKG_OPTIONS and friends
are non-empty before shelling out to xargs. Silences spurious output
from "pkg_chk -i" and probably others.
2004-12-05 23:23:50 +00:00
grant
c463b8b491 make sure some variables are initialized before using them. 2004-12-05 22:38:06 +00:00
grant
e221a993eb add show-options target which displays the options available, default,
and enabled for the current pkg, eg. mail/sendmail:

available: db2 db4 inet6 ldap sasl sasl2 socketmap starttls tcpwrappers
default: canna esound gif idea inet6 inet6 sj3 tcpwrappers wnn4
enabled: inet6 tcpwrappers
2004-12-05 09:20:48 +00:00
jlam
b87ac57b91 Don't show the currently selected options if there aren't any. 2004-11-28 08:00:51 +00:00
jlam
add5eb0d1d Output the currently selected options after telling the user which
options are available.
2004-11-27 04:50:55 +00:00
jlam
f6447cb638 Default PKG_FAIL_UNSUPPORTED_OPTIONS to "no" to match current practices
for using bsd.options.mk, which is:

	PKG_DEFAULT_OPTIONS=	<common options>
	PKG_OPTIONS.<pkg>=	${PKG_DEFAULT_OPTIONS} <mods to defaults>
2004-09-15 03:59:17 +00:00
jlam
1f9933b155 Match documentation to reality to reflect recent change in semantics for
PKG_DEFAULT_OPTIONS.
2004-08-22 19:42:10 +00:00
jlam
9d5426ff76 Change the way that legacy USE_* and FOO_USE_* options are converted
into the bsd.options.mk framework.  Instead of appending to
${PKG_OPTIONS_VAR}, it appends to PKG_DEFAULT_OPTIONS.  This causes
the default options to be the union of PKG_DEFAULT_OPTIONS and any
old USE_* and FOO_USE_* settings.

This fixes PR pkg/26590.
2004-08-22 19:32:51 +00:00
schmonz
ed6f9f8369 Fix spell-o. 2004-08-10 05:33:05 +00:00
jlam
7d11d16245 Use an awk script to avoid using possibly non-portable shell constructs. 2004-08-07 18:02:05 +00:00
jlam
8810d2a8dd Move addition of PKG_OPTIONS to BUILD_DEFS below the definition of the
build-defs-message target so that PKG_OPTIONS doesn't show up as a
settable variable in the displayed message.
2004-08-05 02:10:20 +00:00
jlam
955bd55d68 Pretty-print the PKG_SUPPORTED_OPTIONS so that we don't overflow a line
of the display.  We now batch them up and print a few per line.  Also,
display the supported options at pre-install-depends time.
2004-08-04 23:25:14 +00:00
jlam
c79cd2859c Display a message with the supported build options at build time. 2004-08-04 09:36:16 +00:00
jlam
85306a8348 bsd.options.mk provides boilerplate code for standard naming conventions
for handling per-package build options.

Before including this file, the following variables should be defined:

	PKG_OPTIONS_VAR
		This is a list of the name of the make(1) variables that
		contain the options the user wishes to select.  This
		variable should be set in a package Makefile.  E.g.,

			PKG_OPTIONS_VAR=	WIBBLE_OPTIONS
		or
			PKG_OPTIONS_VAR=	FOO_OPTIONS BAR_OPTIONS

	PKG_SUPPORTED_OPTIONS
		This is a list of build options supported by the package.
		This variable should be set in a package Makefile.  E.g.,

			PKG_SUPPORTED_OPTIONS=	kerberos ldap ssl

Optionally, the following variables may also be defined:

	PKG_DEFAULT_OPTIONS
		This is a list the options that should be built into
		every package, if that option is supported.  This
		variable should be set in /etc/mk.conf.

	${PKG_OPTIONS_VAR} (the variables named in PKG_OPTIONS_VAR)
		These variables list the selected build options and
		override any default options given in PKG_DEFAULT_OPTIONS.
		If any of the options begin with a '-', then that option
		is always removed from the selected build options, e.g.

			PKG_DEFAULT_OPTIONS=	kerberos ldap sasl
			PKG_OPTIONS_VAR=	WIBBLE_OPTIONS
			WIBBLE_OPTIONS=		${PKG_DEFAULT_OPTIONS} -sasl
			# implies PKG_OPTIONS == "kerberos ldap"
		or
			PKG_OPTIONS_VAR=	WIBBLE_OPTIONS
			WIBBLE_OPTIONS=		kerberos -ldap ldap
			# implies PKG_OPTIONS == "kerberos"

		This variable should be set in /etc/mk.conf.

	PKG_FAIL_UNSUPPORTED_OPTIONS
		If this is set to "yes", then the presence of unsupported
		options in PKG_OPTIONS.<pkg> (see below) causes the build
		to fail.  Set this to "no" to silently ignore unsupported
		options.  Default: "yes".

After including this file, the following variables are defined:

	PKG_OPTIONS
		This is the list of the selected build options, properly
		filtered to remove unsupported and duplicate options.

Example usage:

-------------8<-------------8<-------------8<-------------8<-------------
# Global and legacy options
.if defined(USE_OPENLDAP) || defined(USE_SASL2)
.  if !defined(PKG_OPTIONS.wibble)
.    if defined(USE_OPENLDAP) && !empty(USE_OPENLDAP:M[yY][eE][sS])
PKG_OPTIONS.wibble+=	ldap
.    endif
.    if defined(USE_SASL2) && !empty(USE_SASL2:M[yY][eE][sS])
PKG_OPTIONS.wibble+=	sasl
.    endif
.  endif
.endif

PKG_OPTIONS_VAR=	PKG_OPTIONS.wibble
PKG_SUPPORTED_OPTIONS=	ldap sasl
.include "../../mk/bsd.options.mk"

# Package-specific option-handling

###
### LDAP support
###
.if !empty(PKG_OPTIONS:Mldap)
.  include "../../databases/openldap/buildlink3.mk"
CONFIGURE_ARGS+=	--enable-ldap=${BUILDLINK_PREFIX.openldap}
.endif

###
### SASL authentication
###
.if !empty(PKG_OPTIONS:Msasl)
.  include "../../security/cyrus-sasl2/buildlink3.mk"
CONFIGURE_ARGS+=	--enable-sasl=${BUILDLINK_PREFIX.sasl}
.endif
-------------8<-------------8<-------------8<-------------8<-------------
2004-07-30 20:59:08 +00:00