HomeFreeBSD

Mk/bsd.options.mk: Introduce SELECTED_OPTIONS, DESELECTED_OPTIONS

Description

Mk/bsd.options.mk: Introduce SELECTED_OPTIONS, DESELECTED_OPTIONS

Until now, the only way to obtain information on the valid port options
and the current selection states is by using the pretty-print-config
target. It would look something like this:

> make -C /usr/ports/lang/gcc5-aux print-print-config
Standard[ +FORT +OBJC +NLS -TESTSUITE -ALLSTAGES -STATIC ] \
Bootstrap[ -BOOTSTRAP ]

To process the total options and the selection state of each option
requires additional processing, e.g. with awk and/or sed. Moreover, if
other information is needed about the port it question, it would require
a second execution of "make" to reveal variable values. There simply is
no other way to obtain the option selection information in a single pass
(this limitation came when options framework was brought in).

This enhancement allows the option selection information to revealed with
make -V so that all port information can be acquired in a single pass.
Moreover, they won't require piping through sed or awk. Two read-only
variables are introduced:

SELECTED_OPTIONS   (list of all "on" options)
DESELECTED_OPTIONS (liss of all "off" options)

Here's an example of a single pass acquisition:

> make -C /usr/dports/lang/gcc5-aux -V PKGNAME -V SELECTED_OPTIONS \
  -V DESELECTED_OPTIONS
gcc5-aux-20150716
NLS OBJC FORT
BOOTSTRAP STATIC ALLSTAGES TESTSUITE

Obviously the grouping information seen in pretty-print-config is lost,
so these new variables will not help if option group information is
required.

Approved by: portmgr (bapt)

Details

Provenance
marinoAuthored on
Parents
rP403742: Make fetchable again.
Branches
Unknown
Tags
Unknown