Subject: OS-specific variables
To: None <tech-pkg@netbsd.org>
From: Gavan Fantom <gavan@coolfactor.org>
List: tech-pkg
Date: 10/02/2003 17:44:57
Folks,

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
.endif

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:

OPSYSVARS+=	DEPENDS
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