From 7b825e541377fc8a6f6ec8e490187c7b19bda6c3 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 10 Apr 2012 20:36:11 -0700 Subject: More NetBSD porting. * Makefile (EXTRA_FLAGS): Handy new variable for additional ad-hoc CFLAGS. Needed by a new test in configure. * configure: Check for annoying warnings about char being used as an array subscript when calling the macros from . If this occurs, suppress it by #undef-ing the macros. (lang_flags): Switching fromm _XOPEN_SOURCE to _XOPEN_SOURCE=2 because this is needed on NetBSD to obtain declarations of popen and pclose. * stream.c (pipe_close): If we don't have the WIFCONTINUED macro, then define it to expand to zero. It's absent on NetBSD and they already seem to have a hack for this because there is a warning about the function not being defined, but then the program links anyway. Let's do it properly and not rely on their hack. --- configure | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'configure') diff --git a/configure b/configure index 6ef68942..c6552968 100755 --- a/configure +++ b/configure @@ -128,7 +128,7 @@ yacc_given=${yacc+y} yacc=${yacc-'$(cross)$(tool_prefix)$(yaccname)'} nm=${nm-'$(cross)$(tool_prefix)nm'} opt_flags=${opt_flags--O2} -lang_flags=${lang_flags--ansi -D_XOPEN_SOURCE} +lang_flags=${lang_flags--ansi -D_XOPEN_SOURCE=2} diag_flags=${diag_flags--Wall -Wmissing-prototypes -Wstrict-prototypes} debug_flags=${debug_flags--g} inline=${inline-} @@ -665,6 +665,32 @@ done printf "done\n" +# +# Check for annoying warnings from ctype.h macros +# + +printf "Checking for annoying warnings from macros ... " + +cat > conftest.c < + +int main(void) +{ + char x = '3'; + return isdigit(x); +} +! +if ! $make EXTRA_FLAGS=-Werror conftest > conftest.err 2>&1 || ! [ -x conftest ] ; then + printf "present\n" + cat >> config.h <