Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Jul 2012 21:47:52 GMT
From:      Olli Hauer <ohauer@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/170180: [patch] Mk/bsd.options.mk allow make.conf and command line args to apply
Message-ID:  <201207252147.q6PLlqoI091920@freefall.freebsd.org>
Resent-Message-ID: <201207252150.q6PLo6v8092238@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         170180
>Category:       ports
>Synopsis:       [patch] Mk/bsd.options.mk allow make.conf and command line args to apply
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 25 21:50:06 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Olli Hauer <ohauer@FreeBSD.org>
>Release:        FreeBSD 8.3-RELEASE-p3 amd64
>Organization:
>Environment:



>Description:
The new options framework has a major bug.

If for a port "make config" was already done, make.conf and command line params are ignored.

To restore the old behavior simply swap the following block in bsd.options.mk.


### convert WITH and WITHOUT found in make.conf or reloaded from old optionsfile
.for opt in ${ALL_OPTIONS}
...

## Finish by using the options set by the port config dialog, if any
.  for opt in ${OPTIONS_FILE_SET}


Issue reported already on ports@

Additional SLAVE ports can no longer overwrite options set in the MASTER port if "make config" was already done.
If this is possible, please extend the wiki with an working example.


The patch fix only the make.conf / command param issu.

>How-To-Repeat:

$ cd shells/zsh
make config => deselect STATIC

$ make showconfig | grep STATIC
     STATIC=off: Build static executable/libraries

$ make -V LDFLAGS
 -L/usr/local/lib -rpath=/usr/lib:/usr/local/lib

$ make -V LDFLAGS WITH_STATIC=true ( or $ OPTIONS_SET="STATIC" make showconfig )
 -L/usr/local/lib -rpath=/usr/lib:/usr/local/lib

Expected result:
 -L/usr/local/lib -rpath=/usr/lib:/usr/local/lib -static


>Fix:

--- bsd.options.mk.diff begins here ---
Index: bsd.options.mk
===================================================================
--- bsd.options.mk	(revision 301530)
+++ bsd.options.mk	(working copy)
@@ -173,17 +173,6 @@
 .  include "${OPTIONSFILE}.local"
 .  endif
 
-### convert WITH and WITHOUT found in make.conf or reloaded from old optionsfile
-.for opt in ${ALL_OPTIONS}
-.if defined(WITH_${opt})
-PORT_OPTIONS+=	${opt}
-PORT_OPTIONS:=	${PORT_OPTIONS:O:u}
-.endif
-.if defined(WITHOUT_${opt})
-PORT_OPTIONS:=	${PORT_OPTIONS:N${opt}}
-.endif
-.endfor
-
 ## Finish by using the options set by the port config dialog, if any
 .  for opt in ${OPTIONS_FILE_SET}
 .    if !empty(COMPLETE_OPTIONS_LIST:M${opt})
@@ -199,6 +188,17 @@
 
 .endif
 
+### convert WITH and WITHOUT found in make.conf or reloaded from old optionsfile
+.for opt in ${ALL_OPTIONS}
+.if defined(WITH_${opt})
+PORT_OPTIONS+=	${opt}
+PORT_OPTIONS:=	${PORT_OPTIONS:O:u}
+.endif
+.if defined(WITHOUT_${opt})
+PORT_OPTIONS:=	${PORT_OPTIONS:N${opt}}
+.endif
+.endfor
+
 ## Now some compatibility
 .if empty(PORT_OPTIONS:MDOCS)
 NOPORTDOCS=	yes
--- bsd.options.mk.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201207252147.q6PLlqoI091920>