From asa@gascom.ru  Fri Jan 31 00:34:03 2003
Return-Path: <asa@gascom.ru>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 1ADE437B401
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 31 Jan 2003 00:34:03 -0800 (PST)
Received: from mail.gascom.ru (mail.gascom.ru [217.17.160.2])
	by mx1.FreeBSD.org (Postfix) with SMTP id C34A543F43
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 31 Jan 2003 00:34:01 -0800 (PST)
	(envelope-from asa@gascom.ru)
Received: (qmail 90119 invoked from network); 31 Jan 2003 08:31:44 -0000
Received: from asa.gascom.net.ru (HELO ?192.168.100.29?) (192.168.100.29)
  by mail.gascom.ru with SMTP; 31 Jan 2003 08:31:44 -0000
Message-Id: <1044002032.274.64.camel@asa.gascom.net.ru>
Date: 31 Jan 2003 11:33:53 +0300
From: Akifyev Sergey <asa@gascom.ru>
To: FreeBSD-gnats-submit@freebsd.org
Subject: ports Makefile CFLAGS substituted incorrectly

>Number:         47716
>Category:       ports
>Synopsis:       ports Makefile CFLAGS substitution doesn't always work
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan 31 00:40:13 PST 2003
>Closed-Date:    Sat Feb 15 16:46:27 PST 2003
>Last-Modified:  Sat Feb 15 16:46:27 PST 2003
>Originator:     Akifyev Sergey
>Release:        FreeBSD 4.7-RELEASE i386
>Organization:
JSC Gascom
>Environment:
System: FreeBSD asa.gascom.net.ru 4.7-RELEASE FreeBSD 4.7-RELEASE #3:
Mon Jan 27 12:00:27 MSK 2003
asa@asa.gascom.net.ru:/usr/src/sys/compile/KERNEL i386

>Description:
Standard ports system makefile (bsd.port.mk) incorrectly appends CFLAGS
variable from /etc/make.conf to CFLAGS with which port is to be
compiled. It should include one space character before CFLAGS value, to
be sure that it will not produce "glued" arguments. In many ports,
system exported CFLAGS is also appended without space, so it produces
compiler arguments like:
	gcc -Wall -I. -I..-O2 -pipe something.c -o something.o
		      ^^^^^^^
I've discovered this, while building gnome2 port/dependencies.

>How-To-Repeat:
Add following line to /etc/make.conf
	CFLAGS=3D-O2 -pipe
and try to build some ports

>Fix:
Workaround:
Add this line with space included, like:
	CFLAGS=3D -O2 -pipe

Fix:
Add this line to bsd.port.mk (or, maybe, somewhere else?):
	CFLAGS=3D" ${CFLAGS}"

--=20
regards,
Akifyev Sergey <asa@gascom.ru>
JSC Gascom <http://www.gascom.ru>
PGP key available from:
ftp://ftp.gascom.ru/pub/PGP-keys/asa.txt

--=-7+0i/YNyI8R6GpC8YtaH
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)

iD8DBQA+OjTwbu06QwmNwNsRAohiAJ4ikRwPlXa7SBmYmXrsvD0Dq0ZGrQCbB73U
sWcFsu+gqVUCbMaX1V1ok2I=
=k6GA
-----END PGP SIGNATURE-----

--=-7+0i/YNyI8R6GpC8YtaH--

>Release-Note:
>Audit-Trail:

From: "Simon 'corecode' Schubert" <corecode@corecode.ath.cx>
To: Akifyev Sergey <asa@gascom.ru>
Cc: FreeBSD-gnats-submit@FreeBSD.org, ports@FreeBSD.org
Subject: Re: ports/47716: ports Makefile CFLAGS substituted incorrectly
Date: Fri, 31 Jan 2003 14:17:47 +0100

 --H5=.IHLIlhCUqxcM
 Content-Type: text/plain; charset=US-ASCII
 Content-Transfer-Encoding: 7bit
 
 Lately Akifyev Sergey told:
 
 > >Description:
 > Standard ports system makefile (bsd.port.mk) incorrectly appends
 > CFLAGS variable from /etc/make.conf to CFLAGS with which port is to be
 > compiled.
 
 no, this is done in the port's Makefile (most time not even in the port
 Makefile. duh, you know what i mean; the upstream Makefile)
 
 > It should include one space character before CFLAGS value, to be sure
 > that it will not produce "glued" arguments. In many ports, system
 > exported CFLAGS is also appended without space, so it produces
 > compiler arguments like:
 
 then this is a big bug[tm]. ports/upstream Makefiles should be fixed IMO
 
 cheers
   simon
 
 -- 
 /"\   http://corecode.ath.cx/#donate
 \ /
  \     ASCII Ribbon Campaign
 / \  Against HTML Mail and News
 
 --H5=.IHLIlhCUqxcM
 Content-Type: application/pgp-signature
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.1 (FreeBSD)
 
 iD8DBQE+Ond/r5S+dk6z85oRAhonAKCXXLJLICiXVjcRYuL9XADzGpjsKwCeJ55R
 s4cctHjvGE6XyZdyWXmh8HU=
 =HcnK
 -----END PGP SIGNATURE-----
 
 --H5=.IHLIlhCUqxcM--
State-Changed-From-To: open->closed 
State-Changed-By: arved 
State-Changed-When: Sat Feb 15 16:45:07 PST 2003 
State-Changed-Why:  
Not a general ports problem.   

http://www.freebsd.org/cgi/query-pr.cgi?pr=47716 
>Unformatted:
 --=-7+0i/YNyI8R6GpC8YtaH
 Content-Type: text/plain
 Content-Transfer-Encoding: quoted-printable
 
 correctly
