From turutani@scphys.kyoto-u.ac.jp  Thu May  2 06:26:14 2013
Return-Path: <turutani@scphys.kyoto-u.ac.jp>
Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
	by hub.freebsd.org (Postfix) with ESMTP id 66570689
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  2 May 2013 06:26:14 +0000 (UTC)
	(envelope-from turutani@scphys.kyoto-u.ac.jp)
Received: from smtp-auth.kuins.kyoto-u.ac.jp (smtp-auth.kuins.kyoto-u.ac.jp [133.3.248.237])
	by mx1.freebsd.org (Postfix) with ESMTP id 0C2D2167B
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  2 May 2013 06:26:13 +0000 (UTC)
Received: from smtp-auth.kuins.kyoto-u.ac.jp (smtp-auth.kuins.kyoto-u.ac.jp [127.0.0.1])
	by postfix.imss70 (Postfix) with ESMTP id 5842C2EC003;
	Thu,  2 May 2013 15:06:25 +0900 (JST)
Received: from h120.65.226.10.32118.vlan.kuins.net (p8143-ipngn100403kyoto.kyoto.ocn.ne.jp [180.19.95.143])
	by smtp-auth.kuins.kyoto-u.ac.jp (Postfix) with ESMTP id 3CFA82EC001;
	Thu,  2 May 2013 15:06:25 +0900 (JST)
Received: from h120.65.226.10.32118.vlan.kuins.net (localhost [127.0.0.1])
	by h120.65.226.10.32118.vlan.kuins.net (8.14.6/8.14.6/20071004-1) with ESMTP id r4266L0E085571;
	Thu, 2 May 2013 15:06:21 +0900 (JST)
	(envelope-from turutani@h120.65.226.10.32118.vlan.kuins.net)
Received: (from turutani@localhost)
	by h120.65.226.10.32118.vlan.kuins.net (8.14.6/8.14.6/Submit) id r4266KrF085570;
	Thu, 2 May 2013 15:06:20 +0900 (JST)
	(envelope-from turutani)
Message-Id: <201305020606.r4266KrF085570@h120.65.226.10.32118.vlan.kuins.net>
Date: Thu, 2 May 2013 15:06:20 +0900 (JST)
From: Tsurutani Naoki <turutani@scphys.kyoto-u.ac.jp>
Reply-To: Tsurutani Naoki <turutani@scphys.kyoto-u.ac.jp>
To: FreeBSD-gnats-submit@freebsd.org
Cc: turutani@scphys.kyoto-u.ac.jp
Subject: building print/c2ps fails with CFLAGS in /etc/make.conf
X-Send-Pr-Version: 3.114
X-GNATS-Notify:

>Number:         178292
>Category:       ports
>Synopsis:       building print/c2ps fails with CFLAGS in /etc/make.conf
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    hrs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 02 06:30:00 UTC 2013
>Closed-Date:    Thu May 02 07:12:50 UTC 2013
>Last-Modified:  Thu May  2 07:20:00 UTC 2013
>Originator:     Tsurutani Naoki
>Release:        FreeBSD 8.4-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD h120.65.226.10.32118.vlan.kuins.net 8.4-PRERELEASE FreeBSD 8.4-PRERELEASE #26 r249149: Fri Apr 5 22:13:25 JST 2013 turutani@h120.65.226.10.32118.vlan.kuins.net:/usr/local/work/usr/obj/usr/src/sys/POLYMER i386


	
>Description:
	building print/c2ps fails with CFLAGS in /etc/make.conf.
	
>How-To-Repeat:
	% egrep "^CFLAGS" /etc/make.conf
	CFLAGS= -O -pipe
	% cd /usr/ports/print/c2ps
	% make
	...
	===>  Configuring for c2ps-4.0_3
	===>  Building for c2ps-4.0_3
	cc -DDEFAULT=\"Courier\" -DCOMMENT=\"Helvetica-Oblique\" -DSTRINGS=\"Courier-Oblique\" -DPREPROC=\"Courier-BoldOblique\" -DKEYWORD=\"Courier-Bold\" -DTYPE=\"Courier-Bold\" -DLNUMBER=\"Times-Roman\" -DFUNCTION=\"Bookman-LightItalic\" -DDIM=0.75 -O -pipe -o c2ps c2ps.c -L/usr/local/lib -lm -lpaper
	c2ps.c:1825:19: error: paper.h: No such file or directory
	*** Error code 1
	
	Stop in /usr/local/work/usr/ports/print/c2ps/work/c2ps-4.0.
	*** Error code 1
	
	Stop in /usr/ports/print/c2ps.
	*** Error code 1
	
	Stop in /usr/ports/print/c2ps.
	%
	
>Fix:
	CFLAGS set in /etc/make.conf is ignored while building c2ps.
	Here is a patch:

--- Makefile.orig	2013-04-28 02:52:39.000000000 +0900
+++ Makefile	2013-05-02 14:54:58.000000000 +0900
@@ -13,7 +13,6 @@
 
 LIB_DEPENDS=	paper:${PORTSDIR}/print/libpaper
 
-CFLAGS+=	-I${LOCALBASE}/include
 MAN1=		c2ps.1
 PLIST_FILES=	bin/c2ps
 
--- files/patch-Makefile.orig	2013-04-28 01:00:26.000000000 +0900
+++ files/patch-Makefile	2013-05-02 14:42:47.000000000 +0900
@@ -1,23 +1,24 @@
 --- Makefile.orig	1997-05-16 00:50:56.000000000 +0900
 +++ Makefile	2013-04-27 18:57:47.000000000 +0900
-@@ -2,12 +2,12 @@
+@@ -2,12 +2,13 @@
  # Last modified: Sat Apr 19 1997
  
  RM	= 	rm -f
 -CC	=	gcc
 -CCFLAGS =       -O
 +CC?	=	gcc
-+CCFLAGS?=       -O
++CFLAGS?=       -O
  
 -PREFIX	=	/usr/local
-+PREFIX?=	/usr/local
++PREFIX =	${LOCALBASE}
  BIN	=	$(PREFIX)/bin
 -MAN	=	$(PREFIX)/man/man1
 +MAN	=	${MAN1PREFIX}/man/man1
++CFLAGS+=	-I${PREFIX}/include
  
  # you may predefine some of the default settings
  DEFAULT_FONT	= \"Courier\"
-@@ -31,23 +31,20 @@
+@@ -31,23 +32,20 @@
   -DSTRINGS=$(STRINGS_FONT) -DPREPROC=$(PREPROC_FONT)\
   -DKEYWORD=$(KEYWORD_FONT) -DTYPE=$(TYPE_FONT)\
   -DLNUMBER=$(LNUMBER_FONT) -DFUNCTION=$(FUNCTION_FONT)\
	


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->hrs 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu May 2 06:30:08 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=178292 
State-Changed-From-To: open->closed 
State-Changed-By: hrs 
State-Changed-When: Thu May 2 07:12:21 UTC 2013 
State-Changed-Why:  
Should be fixed now.  Thank you for your report! 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/178292: commit references a PR
Date: Thu,  2 May 2013 07:12:25 +0000 (UTC)

 Author: hrs
 Date: Thu May  2 07:12:12 2013
 New Revision: 317079
 URL: http://svnweb.freebsd.org/changeset/ports/317079
 
 Log:
   Fix a build breakage when CFLAGS is defined in make.conf.
   
   PR:	ports/178292
 
 Modified:
   head/print/c2ps/Makefile
   head/print/c2ps/files/patch-Makefile
 
 Modified: head/print/c2ps/Makefile
 ==============================================================================
 --- head/print/c2ps/Makefile	Thu May  2 07:09:17 2013	(r317078)
 +++ head/print/c2ps/Makefile	Thu May  2 07:12:12 2013	(r317079)
 @@ -13,7 +13,7 @@ COMMENT=	A PostScript pretty-printer for
  
  LIB_DEPENDS=	paper:${PORTSDIR}/print/libpaper
  
 -CFLAGS+=	-I${LOCALBASE}/include
 +MAKE_ENV=	CCFLAGS="${CFLAGS} -I${LOCALBASE}/include"
  MAN1=		c2ps.1
  PLIST_FILES=	bin/c2ps
  
 
 Modified: head/print/c2ps/files/patch-Makefile
 ==============================================================================
 --- head/print/c2ps/files/patch-Makefile	Thu May  2 07:09:17 2013	(r317078)
 +++ head/print/c2ps/files/patch-Makefile	Thu May  2 07:12:12 2013	(r317079)
 @@ -1,5 +1,5 @@
  --- Makefile.orig	1997-05-16 00:50:56.000000000 +0900
 -+++ Makefile	2013-04-27 18:57:47.000000000 +0900
 ++++ Makefile	2013-05-02 15:48:59.000000000 +0900
  @@ -2,12 +2,12 @@
   # Last modified: Sat Apr 19 1997
   
 @@ -39,7 +39,7 @@
   
   compile:	c2ps.c
  -	$(CC) $(PREP_OPTIONS) $(CCFLAGS) -o c2ps c2ps.c
 -+	$(CC) $(PREP_OPTIONS) $(CFLAGS) -o c2ps c2ps.c -L${LOCALBASE}/lib -lm -lpaper
 ++	$(CC) $(PREP_OPTIONS) $(CCFLAGS) -o c2ps c2ps.c -L${LOCALBASE}/lib -lm -lpaper
   
   clean:
   	$(RM) c2ps *.o core *~
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 
>Unformatted:
