Subject: Re: patches for different operating systems
To: Jeremy C. Reed <reed@reedmedia.net>
From: Frederick Bruckman <fredb@immanent.net>
List: tech-pkg
Date: 11/25/2002 18:07:38
On Mon, 25 Nov 2002, Jeremy C. Reed wrote:

> Packages.txt says "This [patches] directory contains files that are used
> by the patch(1) command to modify the sources as distributed in the
> distribution file into a form that will compile and run perfectly on
> NetBSD."
>
> According to "OS-dependent patches?" thread, patches should be built to
> work under any OS.
>
> Why does it say "compile and run perfectly on NetBSD" but the build
> reports "Applying ${OPSYS} patches for ..."?
>
> This makes it appear to be specific patches for specific OS, like,
> "Linux".
>
> Could it just say "Applying patches for ..."?

Yeah, I guess so. It looks like a hold-over from before OS-specific
patches were roundly despised.

> Anyways, does anyone have any suggestions or can point me to few examples
> of portable patches?
>
> For example, checking for OPSYS within Makefiles?

"grep" is your friend.

> I noticed this, because devel/popt's patch-ab is OPSYS specific. It forces
> uses of -lintl, althought libintl is not needed for some operating
> systems.

Since "popt" uses "gmake", the syntax goes like this:

ifeq ($(OPSYS),NetBSD)
# conditional defs here
endif

(no "." before the "ifeq"). The BSD make way looks like this:

OPSYS!= uname
.if ${OPSYS} == NetBSD
# conditional defs here
.endif

Hope that help.

Frederick