Subject: OS-specific variables
To: None <>
From: Gavan Fantom <>
List: tech-pkg
Date: 10/02/2003 17:44:57

I've just committed OPSYSVARS, which aims to make some OS-specific bits in
pkg Makefiles less ugly.

This is best explained by example. You can now set:

LDFLAGS.SunOS=	-lm -lsocket

which is roughly equivalent to:

.if "${OPSYS}" == "SunOS"
    LDFLAGS+=	-lm -lsocket

You can also set:

LDFLAGS.*=	-lc

which is equivalent to an else section in the above example.

CFLAGS, CPPFLAGS, LDFLAGS and LIBS can be used in this way by default. If
you wish to use any other variable, add to OPSYSVARS like so:

DEPENDS.Linux=	smugpenguin>=6.6.6:../../misc/smugpenguin

There are many packages currently that could be tidied up this way, and
there are also a large number of packages that would benefit from
Solaris-specific LDFLAGS.

Enjoy. :)

Gillette - the best a man can forget