From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 16 01:01:20 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id C7B9E1065679; Thu, 16 Sep 2010 01:01:20 +0000 (UTC) Date: Thu, 16 Sep 2010 01:01:20 +0000 From: Alexander Best To: freebsd-hackers@freebsd.org Message-ID: <20100916010120.GA49997@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="W/nzBZO5zC0uMSeA" Content-Disposition: inline Subject: traling whitespace in CFLAGS if make.conf:CPUTYPE is not defined/empty X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 01:01:20 -0000 --W/nzBZO5zC0uMSeA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. cheers. alex -- a13x --W/nzBZO5zC0uMSeA Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="bsd.cpu.mk-and-kern.pre.mk.diff" diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk index e3ad18b..fa7fb32 100644 --- a/share/mk/bsd.cpu.mk +++ b/share/mk/bsd.cpu.mk @@ -6,6 +6,7 @@ .if !defined(CPUTYPE) || empty(CPUTYPE) _CPUCFLAGS = +NO_CPU_CFLAGS = . if ${MACHINE_ARCH} == "i386" MACHINE_CPU = i486 . elif ${MACHINE_ARCH} == "amd64" diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index d4bdc1f..9929176 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -23,6 +23,10 @@ NM?= nm OBJCOPY?= objcopy SIZE?= size +.if !defined(CPUTYPE) || empty(CPUTYPE) +_CPUCFLAGS = +NO_CPU_COPTFLAGS = +.endif .if ${CC:T:Micc} == "icc" COPTFLAGS?= -O .else --W/nzBZO5zC0uMSeA--