summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2012-04-07 14:02:04 -0700
committerKaz Kylheku <kaz@kylheku.com>2012-04-07 14:02:04 -0700
commitb3c27e56063a3357869266bf4a836b67859a927e (patch)
treeac850f782332815186ce7479b627898be2144a90 /configure
parente5d0cc1c9f409827de95c9aeede8b4ae0c014d2c (diff)
downloadtxr-b3c27e56063a3357869266bf4a836b67859a927e.tar.gz
txr-b3c27e56063a3357869266bf4a836b67859a927e.tar.bz2
txr-b3c27e56063a3357869266bf4a836b67859a927e.zip
* 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 <windows.h>.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure40
1 files changed, 40 insertions, 0 deletions
diff --git a/configure b/configure
index 6c6d7c2e..f52f3470 100755
--- a/configure
+++ b/configure
@@ -1046,6 +1046,46 @@ else
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 <assert.h>
+#include <ctype.h>
+#include <dirent.h>
+#include <errno.h>
+#include <float.h>
+#include <limits.h>
+#include <math.h>
+#include <setjmp.h>
+#include <stdarg.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/wait.h>
+#include <time.h>
+#include <unistd.h>
+#include <wchar.h>
+#include <wctype.h>
+
+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.
#