Subject: Re: syntax for distinguishing OS releases in Makefiles?
To: Georg Schwarz <geos@epost.de>
From: None <cube@cubidou.net>
List: tech-pkg
Date: 01/15/2004 19:14:58
On Thu, Jan 15, 2004 at 07:05:48PM +0100, Georg Schwarz wrote:
> Hi,
> 
> In my effort to port pkgsrc to IRIX 5.3 I have had to notice that IRIX
> 5.3 is quite different than IRIX 6.X (for which there already is support
> in pkgsrc) in some aspects.
> In some Makefiles, e.g. pkgsrc/lang/perl5/Makefile, I have to
> distinguish whether we have version 5.X or 6.X or IRIX. What syntax
> should I use?
> Originally it reads for example
> .if ${OPSYS} == "IRIX"
> 
> I would check in addition whether it is release 6.X here. Is the
> following appropriate?
> 
> .if ${OPSYS} == "IRIX" && ${LOWER_OPSYS} == "6*"
> 
> probably not... Can anybody help me out with the syntax of the Makefile
> conditional expressions? Thanks.

$ make show-vars VARNAMES="OPSYS LOWER_OPSYS OS_VERSION"
NetBSD
netbsd
1.6.2_RC2

I think that should be slef-explanatory enough :-)

To match OS version, you'll prefer ${OS_VERSION:M6*}.

Quentin Garnier.