Subject: can't get bmake to accept .if ${OPSYS}
To: None <tech-pkg@netbsd.org>
From: Mark E. Perkins <perkinsm@bway.net>
List: tech-pkg
Date: 09/03/2004 19:21:07
Greetings,
I recently built www/tidy under MacOS X 10.3.5, but the build died for lack 
of a table of contents in libtidy.a. Running ranlib by hand fixed this. I 
found a note in the documentation that building on MacOS X requires 
defining RANLIB=ranlib. This can be handled on the command line or in the 
environment, but it would be cleaner do it directly in the Makefile as follows:

.if ${OPSYS} == "Darwin"
MAKEFLAGS+=	RANLIB=ranlib
.endif

When I do this, I get the following errors:

bmake: "/usr/pkgsrc/local/tidy/Makefile" line 27: Malformed conditional 
(${OPSYS} == "Darwin")
bmake: "/usr/pkgsrc/local/tidy/Makefile" line 27: Need an operator
bmake: "/usr/pkgsrc/local/tidy/Makefile" line 29: if-less endif
bmake: "/usr/pkgsrc/local/tidy/Makefile" line 29: Need an operator
bmake: Fatal errors encountered -- cannot continue

What, exactly, is wrong with the conditional? I can change it to just about 
anything else (e.g., .if ${USE_BUILDLINK3} == "yes") and it works, but it's 
not exactly what I need 8).

Can someone explain this? Why is this choking on ${OPSYS}?

Thanks,
Mark