More waf confusion

Hal Murray hmurray at megapathdsl.net
Mon Mar 27 07:37:59 UTC 2017


Somebody recently removed some cruft from config.h
That reminded me that there is more junk in there.

So I took a handy config.h and grep-ed the source code, looking for symbols 
that were not used by any code.

First hit:
  #define NTPSEC_VERSION_MAJOR 0 /* Major version number */
  #define NTPSEC_VERSION_MINOR 9 /* Minor version number */
  #define NTPSEC_VERSION_REV 7 /* Revision version number */
They aren't used.  NTPSEC_VERSION_STRING is used.

They look like they might be needed some day, so I'm tempted to comment them 
out rather than delete them.  (The similar names are used internally.  I'm 
just talking about the code that puts them into config.h)
#    ctx.define("NTPSEC_VERSION_MAJOR", ctx.env.NTPSEC_VERSION_MAJOR,
#               comment="Major version number")

HAVE_UINT64_T isn't currently used.  The comment in wafhelpers/configure.py 
says
     # int32_t and uint32_t probes aren't really needed, POSIX guarantees
     # them.  But int64_t and uint64_t are not guaranteed to exist on 32-bit
     # machines.  The calendar and ISC code needs them.
The calendar and/or ISC code no longer uses HAVE_UINT64_T so I assume it's 
safe it remove that.

Here is the interesting one:
  ##    ctx.check_cc(auto_add_header_name=True,
  ##                 header_name="stddef.h",
  ##                 mandatory=False)

Nobody references HAVE_STDDEF_H, but commenting out that code breaks things.  
The test for HAVE_STRUCT_TIMEX_MODES uses size_t which isn't defined.

Working test code has an "#include <stddef.h>"
I assume that drags in something that provides size_t and it's due to the 
"auto_add_header_name=True"

Does anybody understand this area?  Is there any simple way to get that 
header added to the test code without cluttering up config.h?

There is another bunch of stuff that isn't used by code but is used by waf 
internally.  Gary's recent work added:
  #define HAS_PIC 1
  /* #undef HAS_PIE */
  #define HAS_gnu99 1
  #define HAS_unused 1
  #define HAS_z_now 1

This looks like the same problem.  I think I'm looking for a flag to check_cc 
that says "don't put this in config.h"


-- 
These are my opinions.  I hate spam.





More information about the devel mailing list