Bug 61757

Summary: FreeBSD 4.9 barfs on an empty _CPUCFLAGS with WITHOUT_CPUC_CFLAGS
Product: Ports & Packages Reporter: James E. Housley <jeh>
Component: Individual Port(s)Assignee: Port Management Team <portmgr>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description James E. Housley 2004-01-23 01:10:16 UTC
	: It seems your recent commit to devel/i386-rtems-g77 breaks INDEX:
	: 
	: lemur# make -V CFLAGS
	: RE substitution error: empty (sub)expression
	: Variable CFLAGS is recursive.
	: 
	: Can you look into this?
	: 
	: CHeers,
	: -erwin
	: 

That is fixed.  Are you good with makefiles?  The problem, at least on 4.9, seems to be if _CPUCFLAGS is empty or not defined this error happens.  I have tried all the possible ways I can think of to test for _CPUCFLAGS being empty to prevent the subsitution from happening and none worked.

.if defined(WITHOUT_CPU_CFLAGS) && ${_CPUCFLAGS} != ""

.if defined(WITHOUT_CPU_CFLAGS) && defined(_CPUCFLAGS)

.if defined(WITHOUT_CPU_CFLAGS) && "${_CPUCFLAGS}x" != "x"

.if defined(WITHOUT_CPU_CFLAGS) && !empty(_CPUCFLAGS)

Unless this can be fixed this will have to be removed or converted to a messier:

CFLAGS:=        ${CFLAGS:C/-mcpu=[^ ]*//:C/-march=[^ ]*//:C/-mtune=[^ ]*//}
CXXFLAGS:=      ${CXXFLAGS:C/-mcpu=[^ ]*//:C/-march=[^ ]*//:C/-mtune=[^ ]*//}

How-To-Repeat: 	Create a simple port Makefile that sets WITHOUT_CPU_CFLAGS=YES
	and on a 4.9 machine without and _CPUCFLAGS defined.  I believe
	this worked fine on 5.1
Comment 1 jeh freebsd_committer freebsd_triage 2004-01-23 01:10:54 UTC
Responsible Changed
From-To: freebsd-ports-bugs->portmgr

Assign to portmgr
Comment 2 Joe Marcus Clarke freebsd_committer freebsd_triage 2004-01-31 04:31:43 UTC
State Changed
From-To: open->analyzed

A fix for this is currently being tested on bento.
Comment 3 Joe Marcus Clarke freebsd_committer freebsd_triage 2004-02-04 05:33:39 UTC
State Changed
From-To: analyzed->closed

This should be fixed now.