From jbeich@tormail.net  Mon Nov 28 05:44:07 2011
Return-Path: <jbeich@tormail.net>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0A44D106566C
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 28 Nov 2011 05:44:07 +0000 (UTC)
	(envelope-from jbeich@tormail.net)
Received: from server2.hudsonvalleyhost.com (server2.hudsonvalleyhost.com [66.7.195.77])
	by mx1.freebsd.org (Postfix) with ESMTP id CF1CD8FC0A
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 28 Nov 2011 05:44:06 +0000 (UTC)
Received: from [31.31.36.246] (port=53917 helo=internal.tormail.net)
	by server2.hudsonvalleyhost.com with esmtpsa (TLSv1:RC4-SHA:128)
	(Exim 4.69)
	(envelope-from <jbeich@tormail.net>)
	id 1RUu0a-0016S8-Nb
	for FreeBSD-gnats-submit@freebsd.org; Mon, 28 Nov 2011 00:44:05 -0500
Received: from jbeich by internal.tormail.net with local (Exim 4.63)
	(envelope-from <jbeich@tormail.net>)
	id 1RUu0T-000NVS-VK
	for FreeBSD-gnats-submit@freebsd.org; Mon, 28 Nov 2011 05:44:00 +0000
Message-Id: <1RUu0T-000NVS-VK@internal.tormail.net>
Date: Mon, 28 Nov 2011 11:37:04 +0600
From: Jan Beich <jbeich@tormail.net>
To: FreeBSD-gnats-submit@freebsd.org
Subject: [patch] lang/rexx-wrapper: respect CC/CFLAGS

>Number:         162913
>Category:       ports
>Synopsis:       [patch] lang/rexx-wrapper: respect CC/CFLAGS
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    miwi
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 28 05:50:08 UTC 2011
>Closed-Date:    Sat Jan 14 19:12:12 UTC 2012
>Last-Modified:  Sat Jan 14 19:12:12 UTC 2012
>Originator:     Jan Beich
>Release:        FreeBSD 10.0-CURRENT amd64
>Organization:
>Environment:
>Description:
>How-To-Repeat:
http://pointyhat-west.isc.freebsd.org/errorlogs/amd64-errorlogs/e.9-exp-clang.20111126065358.pointyhat-west/rexx-wrapper-2.4.log
>Fix:
--- cc.diff begins here ---
Index: lang/rexx-wrapper/Makefile
===================================================================
RCS file: /a/.csup/ports/lang/rexx-wrapper/Makefile,v
retrieving revision 1.4
diff -u -p -r1.4 Makefile
--- lang/rexx-wrapper/Makefile	22 Aug 2009 00:24:34 -0000	1.4
+++ lang/rexx-wrapper/Makefile	28 Nov 2011 05:35:56 -0000
@@ -23,4 +23,12 @@ GNU_CONFIGURE=	yes
 CONFIGURE_ARGS=	--with-rexx=regina
 DATADIR=	${PREFIX}/share/rexx${PORTNAME}
 
+post-patch:	.SILENT
+	@${REINPLACE_CMD} -Ee "/^compiler\.unix/s,'.*','${CC:T}'," \
+		-e "s,cc\.cc = .*,cc.${CC:T} = '${CC}'," \
+		-e "/ opt/s/-[Og][^' ]?//" \
+		-e "s,cflags\. = '(.*)',cflags. = '\1 ${CFLAGS}'," \
+		${WRKSRC}/rexxwrap.cmd
+	@${REINPLACE_CMD} 's/-compiler=$$(CC/&:T/' ${WRKSRC}/Makefile.in
+
 .include <bsd.port.mk>
--- cc.diff ends here ---
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->miwi 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Nov 28 05:50:24 UTC 2011 
Responsible-Changed-Why:  
miwi@ wants his PRs (via the GNATS Auto Assign Tool) 

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

From: Jan Beich <jbeich@tormail.net>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: ports/162913: [patch] lang/rexx-wrapper: respect CC/CFLAGS
Date: Wed, 30 Nov 2011 11:30:00 +1100

 --=-=-=
 Content-Type: text/plain
 Content-Disposition: inline
 
 - do not replace compiler list
 - add CC to configur
 - remove `@'
 
 
 --=-=-=
 Content-Type: text/x-patch
 Content-Disposition: attachment; filename=cc.diff
 
 Index: lang/rexx-wrapper/Makefile
 ===================================================================
 RCS file: /a/.csup/ports/lang/rexx-wrapper/Makefile,v
 retrieving revision 1.6
 diff -u -p -r1.6 Makefile
 --- lang/rexx-wrapper/Makefile	29 Nov 2011 18:36:34 -0000	1.6
 +++ lang/rexx-wrapper/Makefile	30 Nov 2011 00:19:47 -0000
 @@ -3,7 +3,7 @@
  # Date created:			Nov 11, 2003
  # Whom:	      			ijliao
  #
 -# $FreeBSD: ports/lang/rexx-wrapper/Makefile,v 1.6 2011/11/29 18:36:34 dim Exp $
 +# $FreeBSD: ports/lang/rexx-wrapper/Makefile,v 1.4 2009/08/22 00:24:34 amdmi3 Exp $
  #
  
  PORTNAME=	wrapper
 @@ -23,4 +23,13 @@ GNU_CONFIGURE=	yes
  CONFIGURE_ARGS=	--with-rexx=regina
  DATADIR=	${PREFIX}/share/rexx${PORTNAME}
  
 +post-patch:	.SILENT
 +	${REINPLACE_CMD} -Ee "/^compiler\.unix/s,',&${CC:T} ," \
 +		-e "/cc\.cc = .*/{p;s,,cc.${CC:T} = '${CC}',;}" \
 +		-e "/ opt/s/-[Og][^' ]?//" \
 +		-e "s,cflags\. = '(.*)',cflags. = '\1 ${CFLAGS}'," \
 +		${WRKSRC}/rexxwrap.cmd
 +	${REINPLACE_CMD} '/^CC_LIST=/s,",&${CC:T} ,' ${WRKSRC}/configur
 +	${REINPLACE_CMD} 's/-compiler=$$(CC/&:T/' ${WRKSRC}/Makefile.in
 +
  .include <bsd.port.mk>
 
 --=-=-=--

Date: Sat, 17 Dec 2011 08:41:57 -0600
From: Jan Beich <jbeich@tormail.net>
To: bug-followup@freebsd.org
Subject: Re: [patch] lang/rexx-wrapper: respect CC/CFLAGS

 Unlike the approach committed by dim@ recently my patch does not favor
 clang but fixes CC irrespectively of compiler, e.g.
 
   $ make CC=gcc46 # vanilla Makefile@r1.6
   [...]
   ===>  Building for rexx-wrapper-2.4
   rexx ./rexxwrap.cmd -program=rexxwrapper -rexxfiles=./rexxwrap.cmd  -compiler=gcc46 -interpreter=regina -srcdir=. -compress
   This is Rexx/Wrapper 2.4 - 21 September 2006
   --------------------------------------------
   ************************************************************
   unsupported compiler specified with -compiler= switch; must be one of: gcc clang cc c89 egcs xlc
   ************************************************************
   *** [rexxwrapper] Error code 1
   1 error
 
   $ make CC=gcc46 # with my patch
   [...]
   ===>  Building for rexx-wrapper-2.4
   rexx ./rexxwrap.cmd -program=rexxwrapper -rexxfiles=./rexxwrap.cmd  -compiler=gcc46 -interpreter=regina -srcdir=. -compress
   This is Rexx/Wrapper 2.4 - 21 September 2006
   --------------------------------------------
   Running configure script...
   creating cache ./config.cache
   updating cache ./config.cache
   creating ./config.status
   creating defined_values
   creating config.h
   Compiling ZLIB modules...compress uncompr deflate inflate adler32 zutil trees inftrees inffast crc32
   Compiling intbuild.c...
   Linking intbuild...
   Running intbuild to produce rexxwrapper.c...
      If you need to dump the original code from the rexxwrapper executable, run:
    rexxwrapper --key=1
   Compiling rexxwrapper.c...
   Compiling getargv0.c...
   Linking rexxwrapper
   Done! rexxwrapper built successfully
State-Changed-From-To: open->feedback 
State-Changed-By: miwi 
State-Changed-When: Sun Dec 18 09:18:37 UTC 2011 
State-Changed-Why:  
can you please resend as attachment thx. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=162913 
State-Changed-From-To: feedback->closed 
State-Changed-By: miwi 
State-Changed-When: Sat Jan 14 19:12:11 UTC 2012 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=162913 
>Unformatted:
