diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-01-10 20:46:25 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-01-10 20:46:25 -0800 |
commit | 5ee9c6e95736d9ae925fedab4caa0c615d115fb2 (patch) | |
tree | f32df484457d662e8571c720a3f634ed075d125c /configure | |
parent | ba9a6aade4adf32b4361aa8db8b156fdb40e2cd5 (diff) | |
download | txr-5ee9c6e95736d9ae925fedab4caa0c615d115fb2.tar.gz txr-5ee9c6e95736d9ae925fedab4caa0c615d115fb2.tar.bz2 txr-5ee9c6e95736d9ae925fedab4caa0c615d115fb2.zip |
* configure: Detect platforms which don't reveal declarations
in C headers which are extensions to standard C, like popen or fileno,
in response to standard feature selection macros like -D_POSIX_SOURCE.
MinGW and Cygwin are offenders. These platforms hide the declarations
when gcc is in -ansi mode, by testing for __STRICT_ANSI__. Turns out,
however, that -U__STRICT_ANSI__ on the gcc command line strips this
away, causing the declarations to be revealed.
* lib.c, parser.l, stream.c, utf8.c: Removed the declarations which
compensated for the above problem. Yippee! Fuck you, stupid Cygwin
troglodytes, and the MinGW horse you rode in on.
http://cygwin.com/ml/cygwin/2011-10/msg00131.html
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -709,6 +709,29 @@ done printf "done\n" # +# Check for idiotic behavior: extensions in C header files controlled +# by __STRICT_ANSI__ rather than things like __POSIX_SOURCE. +# + +printf "Checking for proper support for feature-test macros ... " + +cat > conftest.c <<! +#include <stdio.h> + +int main(void) +{ + return fileno(stdin); +} +! +rm -f conftest$exe +if ! $make EXTRA_FLAGS=-Werror conftest > conftest.err 2>&1 || ! [ -x conftest ] ; then + printf "no\n" + lang_flags="$lang_flags -U__STRICT_ANSI__" +else + printf "yes\n" +fi + +# # Check for annoying warnings from ctype.h macros # |