traling whitespace in CFLAGS if make.conf:CPUTYPE is not defined/empty

John Baldwin jhb at freebsd.org
Thu Sep 16 12:38:07 UTC 2010


On Wednesday, September 15, 2010 9:01:20 pm Alexander Best wrote:
> hi there,
> 
> after discovering PR #114082 i noticed that with CPUTYPE not being defined in
> make.conf, `make -VCFLAGS` reports a trailing whitespace for CFLAGS.
> the reason for this is that ${_CPUCFLAGS} gets added to CFLAGS even if it's
> empty.
> 
> the following patch should take care of the problem. i also added the same
> logik to COPTFLAGS. although i wasn't able to trigger the trailing whitespace,
> it should still introduce a cleaner behaviour.

Does the trailing whitespace break anything?  In the past we have had a
non-empty default CPU CFLAGS (e.g. using '-mtune=pentiumpro' on i386 at one
point IIRC) which this change would break.  Unless the trailing whitespace
is causing non-cosmetic problems I'd probably just leave it as it is.

Also, if we were to go with this approach, I would not have changed
kern.pre.mk at all, but set both NO_CPU_CFLAGS and NO_CPU_COPTFLAGS in
bsd.cpu.mk when CPUTYPE was empty.

-- 
John Baldwin


More information about the freebsd-hackers mailing list