binary port: how to deal with 4.x vs 5.x?

Brooks Davis brooks at
Mon Jun 14 21:28:52 GMT 2004

On Mon, Jun 14, 2004 at 06:19:40PM -0300, Fernan Aguero wrote:
> Hi!
> I have an almost complete port of WU BLAST
> (, which is only distributed as
> pre-compiled binaries. 
> Warren Gish has produced binaries for both freebsd-4.x and
> 5.x. Currently my port only installs the one for 4.x
> Is it possible to use the same port Makefile and set two
> different DISTNAMEs based on the OS version?
> The contents of the two files are similar, they're just
> linked against different libraries (libc_r is one if I
> remember correctly).
> I have already tried something along the lines of:
> .if __FreeBSD_version < 500000
> DISTNAME= xxxx
> .else 
> DISTNAME= yyyy
> .endif
> but it didn't work as expected.
> Any idea?

Use make syntax. :-)  First, you need to include before
you use the variables.  Second, the correct variable is ${OSVERSION}.
Thus the code would look like:

.include <>

.if ${OSVERSION} < 500000
.include <>

See the Porters Handbook for details:

-- Brooks

Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url :

More information about the freebsd-ports mailing list