From b3c27e56063a3357869266bf4a836b67859a927e Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 7 Apr 2012 14:02:04 -0700 Subject: * configure: Added new check for some clashing external names, which we can redefine out of the way in config.h. * lib.c: config.h was being included before . --- ChangeLog | 7 +++++++ configure | 40 ++++++++++++++++++++++++++++++++++++++++ lib.c | 2 +- 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0413e9a2..f4c26d8c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-04-07 Kaz Kylheku + + * configure: Added new check for some clashing external names, + which we can redefine out of the way in config.h. + + * lib.c: config.h was being included before . + 2012-04-07 Kaz Kylheku * txr.1: Documented int-flo, flo-int, search-regex, diff --git a/configure b/configure index 6c6d7c2e..f52f3470 100755 --- a/configure +++ b/configure @@ -1045,6 +1045,46 @@ else printf "#define HAVE_GETENVIRONMENTSTRINGS 1\n" >> config.h fi +# +# Check for annoying clashes from non-conforming BSD-derived systems that don't +# honor Unix/POSIX feature selection macros! +# + +printf "Checking for name clashes caused by nonconforming toolchains ... " + +for ident in trunc floorf random ; do + cat > conftest.c < +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct txr_foo { int txr; } $ident; + +int $ident(void); + +int main(void) { return 0; } +! + rm -f conftest + if ! make conftest > conftest.err 2>&1 || ! [ -x conftest ] ; then + printf "#define %s txr_%s\n" $ident $ident >> config.h + fi +done + # # Extra debugging. # diff --git a/lib.c b/lib.c index 51c584b0..30ac7d8d 100644 --- a/lib.c +++ b/lib.c @@ -36,11 +36,11 @@ #include #include #include -#include "config.h" #ifdef HAVE_GETENVIRONMENTSTRINGS #define NOMINMAX #include #endif +#include "config.h" #include "lib.h" #include "gc.h" #include "arith.h" -- cgit v1.2.3