Subject: Re: c99
To: Jan Schaumann <jschauma@netmeister.org>
From: Roland Illig <rillig@NetBSD.org>
List: tech-pkg
Date: 12/08/2006 06:18:44
This is a multi-part message in MIME format.
--------------080304010407080106050803
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Jan Schaumann wrote:
> Roland Illig <rillig@NetBSD.org> wrote:
>  
> 
>>I would add this to _WRAP_EXTRA_ARGS.CC instead of CFLAGS, since that is 
>>guaranteed to survive even packages that ignore the user's choice for 
>>CFLAGS.
> 
> 
> We should see if we can have the wrapper display _WRAP_EXTRA_ARGS.CC
> when running.  I find it somewhat comfusing if the command-line executed
> shows 'gcc -whatever', but it actually runs 'gcc -std=c99 -whatever'.
> 
> This makes debugging compile-time errors a lot more difficult (see PR
> 35190 for an example).

What about the appended patch? It looks reasonable to me, but I haven't 
tested it thoroughly.

Roland

--------------080304010407080106050803
Content-Type: text/plain;
 name="wrapper.sh.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="wrapper.sh.patch"

Index: wrapper.sh
===================================================================
RCS file: /cvsroot/pkgsrc/mk/wrapper/wrapper.sh,v
retrieving revision 1.9
diff -u -p -r1.9 wrapper.sh
--- wrapper.sh	26 Nov 2006 14:42:17 -0000	1.9
+++ wrapper.sh	8 Dec 2006 05:16:44 -0000
@@ -120,4 +120,10 @@ eval "$cmd" || wrapper_result="$?"
 
 . $cleanup
 
+[ $wrapper_result -eq 0 ] || {
+	echo ""
+	echo "[wrapper.sh] note: The real command line, after the pkgsrc wrapper, was:"
+	echo "$cmd"
+} 1>&2
+
 exit ${wrapper_result}

--------------080304010407080106050803--