Subject: Re: test for gcc3 ?
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: Johnny C. Lam <jlam@NetBSD.org>
List: tech-pkg
Date: 03/19/2004 22:28:39
On Fri, Mar 19, 2004 at 09:49:11PM +0100, Manuel Bouyer wrote:
> what is the appropriate test to know if we are using gcc3 or some other kind
> of compiler ?
> I need to do this for emacs:
> .if ${OPSYS} == "SunOS"
> CFLAGS+=        -fno-zero-initialized-in-bss
> .endif
> but only if using gcc3 (this doesn't exists in gcc2).

I would do:

.include "../../mk/compiler.mk"
.if (${OPSYS} == "SunOS") && !empty(CC_VERSION:gcc-3.*)
CFLAGS+=	-fno-zero-initialized-in-bss
.endif

Eventually, I'll clean this up so that you include bsd.prefs.mk instead,
but for now, the above should work.

	Cheers,

	-- Johnny Lam <jlam@NetBSD.org>