At the point where tools/Makefile is loaded, TOOLDIR doesn't have to
exist yet, it will be created later. Remove the redundant quotes from
the .error messages.
- add elftoolchain/common to the list of headers to be build before depend
- make libdwarf build the includes since it needs <sys/elfdefinitions.h>
which does not exist on non-netbsd systems.
It must be better to have this workaround here, rather than in external.
(Thanks uwe@ for suggestion!)
Confirmed that the same files generated as before.
Implement m4 macro NB_CHECK_CC_FLAG(FLAG, [VAR=FLAG_DERIVED])
Determine if the C compiler supports FLAG,
and sets output variable VAR to FLAG if FLAG is supported.
If VAR is not provided, default to FLAG_DERIVED, which is
FLAG converted to upper-case and all special characters
replaced with "_", and the result prepended with "CC_".
FLAG_DERIVED is appended to the m4 macro NB_CHECK_CC_FLAG_VARS.
E.g., if FLAG is "-Wexample=yes", FLAG_DERIVED is "CC_WEXAMPLE_YES".
This is implemented in separate buildaux/nb_check_cc_flag.m4,
based on configure's NB_CC_FLAG(), but supports VAR override.
Adapt configure from internal NB_CC_FLAG() to NB_CHECK_CC_FLAG().
(Note: AX_CHECK_COMPILE_FLAG() from autoconf-archive could be enhanced
to support the clang and gcc workarounds I've implemented here.)
autoconf 2.69 generates @DEFS@ with definitions with
quoted embedded spaces, so rework how docmd() is invoked
to avoid weird quoting issues.
As part of this, remove all the shell variables containing @var@
and just use @var@ directly.
tools/Makefile.host revision 1.35 changed from
setting various NOxxx variables and .include <bsd.own.mk>
to
.include <bsd.hostinit.mk>
which sets the same NOxxx variables, .include <bsd.init.mk>
which optionally .include ../Makefile.inc before .include <bsd.own.mk>.
This chnage caused build failures with HAVE_LLVM=yes, so revert rev 1.35.
(Maybe to do with the .include ../Makefile.inc. The tools/llvm* build is
tricky, and it's easier to revert this change than debug.)
bsd.hostinit.mk sets a bunch of NOxxx variables before
including bsd.init.mk (which includes bsd.own.mk),
so simplify instead of replicating the NOxxx setup
for host tools.