Subject: Re: wrappers break darwin
To: Dan Winship <danw@NetBSD.org>
From: Johnny C. Lam <jlam@NetBSD.org>
List: tech-pkg
Date: 09/22/2004 05:40:08
On Tue, Sep 21, 2004 at 07:50:32PM -0400, Dan Winship wrote:
> (Yeah, yeah, I know. I kept meaning to test the wrapper framework, but 
> I was busy and didn't get around to it :-)
> 
> The wrapper framework makes it impossible to build anything on Darwin, 
> because the gcc wrapper ends up being overwritten by the cpp wrapper 
> (because ${CPP} is "gcc -E") or something, and gcc turns into an 
> infinite loop. The attached patch can be used as a workaround until 
> it's fixed. (Or maybe it's even the right fix?)
> 
> -- Dan
> 

> Index: bsd.wrapper.mk
> ===================================================================
> RCS file: /cvsroot/pkgsrc/mk/wrapper/bsd.wrapper.mk,v
> retrieving revision 1.1
> diff -u -r1.1 bsd.wrapper.mk
> --- bsd.wrapper.mk	21 Sep 2004 15:01:41 -0000	1.1
> +++ bsd.wrapper.mk	21 Sep 2004 23:45:27 -0000
> @@ -132,7 +132,9 @@
>  #
>  _WRAPPEES+=	AS
>  _WRAPPEES+=	CC
> +.if ${CPP:N-*} != ${CC}
>  _WRAPPEES+=	CPP
> +.endif
>  _WRAPPEES+=	CXX
>  _WRAPPEES+=	FC
>  .if defined(USE_X11)

This looks right to me.  I'll extend it to check for ${LD} == gcc as
well, since that's also quite common.

	Cheers,

	-- Johnny Lam <jlam@NetBSD.org>