waf confusion

Eric S. Raymond esr at thyrsus.com
Mon Sep 16 09:59:05 UTC 2019


Hal Murray via devel <devel at ntpsec.org>:
> wscript and friends have various things like:
>     if ctx.env.DEST_OS in ["freebsd", "openbsd"]:
>         ctx.env.PLATFORM_INCLUDES = ["/usr/local/include"]
> 
> I think the PLATFORM_ part is leftover from an old old version of waf.
> 
> ctx.env.PLATFORM_INCLUDES works because our code has things like:
>         includes=[
>             ctx.bldnode.parent.abspath(), "../include",
>             "%s/host/ntpd/" % ctx.bldnode.parent.abspath(), "."
>         ] + ctx.env.PLATFORM_INCLUDES,
> 
> I think we should remove all the PLATFORM_ stuff in that area and remove all 
> the ctx.env.PLATFORM_INCLUDES from all the includes.
> 
> I'll make the edits, but I'm not confident that I won't break something.  I 
> have tested it with NetBSD which is how I got this far.

If it'll build with those changes, you win.

> I'm not having much luck with the waf documentation.  Where is the section 
> that explains what ctx.env.INCLUDES does?  How about others like LIBPATH, 
> LDFLAGS, ...?
> 
> Another chunk of documentation I'm looking for is how libraries work.  
> ntpd/wscript says:
>         use="libntpd_obj ntp M parse RT CAP SECCOMP PTHREAD NTPD "
>             "SSL CRYPTO DNS_SD %s SOCKET NSL SCF" % use_refclock,
> I'd like to understand that area.

The waf documentation is terrible. It's waf's one huge weakness -
I don't think that stuff is actually described explcitly anywhere.
The way I learned how to cope was basically by reading the hieroglyphics
in the existing reopo and naking small modifications.

You notice those are all library names. I think the way it works 
is that all-capsing the name tells waf to look in system-library
locations as well as locally.

> PS: We dropped support for OpenBSD a long time ago.  Should we leave things 
> like that around as a reminder, or clean them up to reduce clutter?

Clean them up. OpenBSD has its own time-sync daemon and isn't interested.  
-- 
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>




More information about the devel mailing list