From nobody@FreeBSD.org  Sun Mar  8 20:18:38 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EFB14106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  8 Mar 2009 20:18:38 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id DDD8A8FC1F
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  8 Mar 2009 20:18:38 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n28KIcKu021968
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 8 Mar 2009 20:18:38 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n28KIcIa021967;
	Sun, 8 Mar 2009 20:18:38 GMT
	(envelope-from nobody)
Message-Id: <200903082018.n28KIcIa021967@www.freebsd.org>
Date: Sun, 8 Mar 2009 20:18:38 GMT
From: Anonymous <swell.k@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] devel/apr: add CC and CFLAGS to CONFIGURE_ENV
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         132432
>Category:       ports
>Synopsis:       [patch] devel/apr: add CC and CFLAGS to CONFIGURE_ENV
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pgollucci
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 08 20:20:02 UTC 2009
>Closed-Date:    Wed Jun 10 05:54:07 UTC 2009
>Last-Modified:  Wed Jun 10 06:00:12 UTC 2009
>Originator:     Anonymous
>Release:        FreeBSD 8.0-CURRENT amd64
>Organization:
>Environment:
>Description:
The port *silently* overrides CC and CFLAGS unless set from environment or cmdline.
>How-To-Repeat:
Add CC=gcc44 and CFLAGS=-O0 to make.conf and build the port.

%%%
$ printf 'CC=gcc44\nCFLAGS=-O0\n' >/etc/make.conf
$ cd devel/apr; make
..
/bin/sh /usr/ports/devel/apr/work/apr-1.3.3/libtool --silent --mode=compile gcc -g -O2   -DHAVE_CONFIG_H    -I./include -I/usr/ports/devel/apr/work/apr-1.3.3/include/arch/unix -I./include/arch/unix -I/usr/ports/devel/apr/work/apr-1.3.3/include/arch/unix -I/usr/ports/devel/apr/work/apr-1.3.3/include  -o passwd/apr_getpass.lo -c passwd/apr_getpass.c && touch passwd/apr_getpass.lo
^C
$ make -V CC -V CFLAGS
gcc44
-O0
%%%

Same with default CC=cc and CFLAGS='-O2 -pipe -fno-strict-aliasing'.

These are known to work:
$ env CC=gcc44 CFLAGS=-O0 make
$ make CC=gcc44 CFLAGS=-O0

>Fix:


Patch attached with submission follows:

Index: devel/apr/Makefile
===================================================================
RCS file: /home/csup/ports/devel/apr/Makefile,v
retrieving revision 1.77
diff -u -p -r1.77 Makefile
--- devel/apr/Makefile	18 Jan 2009 19:43:53 -0000	1.77
+++ devel/apr/Makefile	8 Mar 2009 19:46:54 -0000
@@ -43,6 +43,7 @@ APU_WRKDIR=	${WRKDIR}/apr-util-${APU_VER
 PLIST_SUB=	SHLIB_MAJOR="${SHLIB_MAJOR}"
 SHLIB_MAJOR=	3
 
+CONFIGURE_ENV=	CC="${CC}" CXX="${CXX}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}"
 APR_CONF_ARGS=	
 APU_CONF_ARGS=	--with-apr=${APR_WRKDIR} \
 			--with-expat=${LOCALBASE} \


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->pgollucci 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sun Mar 8 20:20:50 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=132432 

From: "Philip M. Gollucci" <pgollucci@p6m7g8.com>
To: bug-followup@FreeBSD.org, swell.k@gmail.com
Cc:  
Subject: Re: ports/132432: [patch] devel/apr: add CC and CFLAGS to CONFIGURE_ENV
Date: Fri, 24 Apr 2009 02:56:22 -0400

 why does it need CXX and CXXFLAGS its all C code no C++ here.
 -- 
 ------------------------------------------------------------------------
 Philip M. Gollucci (philip@ridecharge.com)
 did: 703.579.6947, o: 703.549.2050x206
 Senior System Admin - RideCharge Inc.
 http://ridecharge.com
 1024D/DB9B8C1C B90B FBC3 A3A1 C71A 8E70  3F8C 75B8 8FFB DB9B 8C1C
 
 Work like you don't need the money,
 love like you'll never get hurt,
 and dance like nobody's watching.
State-Changed-From-To: open->closed 
State-Changed-By: pgollucci 
State-Changed-When: Wed Jun 10 05:54:06 UTC 2009 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=132432 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/132432: commit references a PR
Date: Wed, 10 Jun 2009 05:53:44 +0000 (UTC)

 pgollucci    2009-06-10 05:53:27 UTC
 
   FreeBSD ports repository
 
   Modified files:
     devel/apr            Makefile 
   Added files:
     devel/apr/files      patch-apr-util-1.3.7__apu-config.in 
   Log:
   - Respect CC/CCFLAGS [1]
   - use -pthread instead of -lpthread [2]
   - It was only ever accidental that -ldb showed up in apu-config --libs
     Subversion doesn't actually even use it (apr_dbm*).
     APR/Util is supposed to auto load the backed db library without the app
     ever know which one it was.  Subversion uses db _directly_.
     Subversion 1.6.3 should account for this. [3]
   - Convert to bsd.options.mk
   - Bump PORTREVISION
   
   PR:             ports/135396 [3], ports/134453 [2], ports/132432 [1]
   Submitted by:   dev@apr.apache.org (wrowe, bojan) [3],
                   b.f. [2],  Anonymous <swell.k@gmail.com> [1]
   
   Revision  Changes    Path
   1.81      +9 -3      ports/devel/apr/Makefile
   1.1       +39 -0     ports/devel/apr/files/patch-apr-util-1.3.7__apu-config.in (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
