Subject: Re: Malformed conditional && solaris
To: Jeremy C. Reed <reed@reedmedia.net>
From: grant beattie <grant@NetBSD.org>
List: tech-pkg
Date: 09/01/2005 10:41:26
On Wed, Aug 31, 2005 at 04:48:56PM -0700, Jeremy C. Reed wrote:

> On Wed, 31 Aug 2005, MLH wrote:
> 
> >Why is bmake complaining about this on Solaris ?
> >
> >bmake: "/usr/pkgsrc/x11/py-qt3-sip/Makefile" line 38: Malformed conditional
> >(${OPSYS} == "SunOS" && !empty(CC_VERSION:Mgcc*))
> 
> This is the code I committed for you. I don't know what changed. But now I 
> think this CC_VERSION requires including the ../../mk/compiler.mk first.
> 
> Maybe use following instead. I wasn't even checking for version 3 in the 
> first place, so using PKGSRC_COMPILER for checking gcc should be good 
> enough.
> 
> (This just replaces CC_VERSION with PKGSRC_COMPILER.)
> 
> Index: x11/py-qt3-sip/Makefile
> ===================================================================
> RCS file: /cvsroot/pkgsrc/x11/py-qt3-sip/Makefile,v
> retrieving revision 1.17
> diff -b -u -r1.17 Makefile
> --- x11/py-qt3-sip/Makefile	1 Jul 2005 01:27:09 -0000	1.17
> +++ x11/py-qt3-sip/Makefile	31 Aug 2005 23:46:38 -0000
> @@ -35,7 +35,7 @@
>  CONFIGURE_ARGS+=	LFLAGS_PLUGIN="-bundle -flat_namespace -undefined 
>  suppress"
>  .else
>  CONFIGURE_ARGS+=	CFLAGS_SHLIB=-fPIC
> -.if ${OPSYS} == "SunOS" && !empty(CC_VERSION:Mgcc*)
> +.if ${OPSYS} == "SunOS" && !empty(PKGSRC_COMPILER:Mgcc*)

this is not correct, since PKGSRC_COMPILER can contain multiple words,
in order of preference, and this could match gcc* when it isn't the
compiler being used.

CC_VERSION is the version string of the compiler currently being used,
but you need to .include "../../mk/compiler.mk" before testing its
value.

grant.