ports/95589: [PATCH] make showconfig failed if $(OPTIONS) variable is not set
Kevin Leung
hysoka at gmail.com
Mon Apr 10 15:10:21 UTC 2006
>Number: 95589
>Category: ports
>Synopsis: [PATCH] make showconfig failed if $(OPTIONS) variable is not set
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Mon Apr 10 15:10:18 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator: Kevin Leung
>Release: 6.1-PRERELEASE
>Organization:
>Environment:
FreeBSD farm 6.1-PRERELEASE FreeBSD 6.1-PRERELEASE #0: Sun Apr 2 05:45:53 HKT 2006 root at farm:/usr/obj/usr/src/sys/OPTIMIZE i386
>Description:
Many ports use WITH_ and WITHOUT_ variables to define the build behaviour. But only very few of them actually define OPTIONS variable. As a result, "make showconfig" does not really show the config, and it is tedious to find out available build variables (WITH_ and WITHOUT_) for each port.
>How-To-Repeat:
cd /usr/ports/emulators/qemu
make config
make showconfig
>Fix:
Apply the following patch to /usr/ports/Mk/bsd.port.mk
With this patch `make config' will tell the user to try `make showconfig' if OPTIONS variable is not set.
`make showconfig' will show WITH_ and WITHOUT_ variables of Makefile.
--- bsd.port.mk.orig Mon Apr 10 22:16:33 2006
+++ bsd.port.mk Mon Apr 10 23:01:36 2006
@@ -5210,6 +5210,7 @@
config:
.if !defined(OPTIONS)
@${ECHO_MSG} "===> No options to configure"
+ @${ECHO_MSG} "===> Try \`make showconfig' to see build variables for this port"
.else
.if ${OPTIONSFILE} != ${_OPTIONSFILE}
@${ECHO_MSG} "===> Using wrong configuration file ${_OPTIONSFILE}"
@@ -5328,6 +5329,13 @@
@${ECHO_MSG} "===> No configuration options are set for this port"
.if defined(OPTIONS)
@${ECHO_MSG} " Use 'make config' to set default values"
+.else
+ @${ECHO_MSG} "===> Showing build variables for this port"
+ @$(AWK) ' \
+ /WITH_|WITHOUT_/ { \
+ match($$0, /(WITH_|WITHOUT_)([A-Z_]+)/); \
+ print(substr($$0, RSTART, RLENGTH)); \
+ }' < $(MAKEFILE) | sort | uniq
.endif
.endif
.endif
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list