From nobody@FreeBSD.org  Mon Apr 10 15:07:20 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 4537A16A404
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 10 Apr 2006 15:07:20 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 0E43143D45
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 10 Apr 2006 15:07:20 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k3AF7JWA017106
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 10 Apr 2006 15:07:19 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k3AF7JMV017105;
	Mon, 10 Apr 2006 15:07:19 GMT
	(envelope-from nobody)
Message-Id: <200604101507.k3AF7JMV017105@www.freebsd.org>
Date: Mon, 10 Apr 2006 15:07:19 GMT
From: Kevin Leung <hysoka@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [PATCH] make showconfig failed if $(OPTIONS) variable is not set
X-Send-Pr-Version: www-2.3

>Number:         95589
>Category:       ports
>Synopsis:       [PATCH] make showconfig failed if $(OPTIONS) variable is not set
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    portmgr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Apr 10 15:10:18 GMT 2006
>Closed-Date:    Tue Jun 20 07:29:50 GMT 2006
>Last-Modified:  Tue Jun 20 07:29:50 GMT 2006
>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@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:
Responsible-Changed-From-To: freebsd-ports-bugs->portmgr 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Apr 10 17:30:20 UTC 2006 
Responsible-Changed-Why:  
Patch against bsd.port.mk. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=95589 
State-Changed-From-To: open->closed 
State-Changed-By: linimon 
State-Changed-When: Tue Jun 20 07:28:42 UTC 2006 
State-Changed-Why:  
A similar patch was committed to bsd.port.mk in revision 1.534 from 
ports/97133.  Your patch was apparently overlooked at that time.  Our 
apologies, and thanks for the submission. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=95589 
>Unformatted:
