diff --git a/configure.ac b/configure.ac index 012fbd3fb..ae649b4a0 100644 --- a/configure.ac +++ b/configure.ac @@ -346,6 +346,10 @@ dnl ############################################################################ dnl OS specific stuff dnl ############################################################################ +AC_CHECK_DECLS([environ], , , + [ #include + #include ]) + case $host_os in *os400) AC_PATH_PROG([PERL], [perl], [/QOpenSys/pkgs/bin/perl]) diff --git a/lib/widget/input_complete.c b/lib/widget/input_complete.c index cd0ccbc87..4d3fd8b4b 100644 --- a/lib/widget/input_complete.c +++ b/lib/widget/input_complete.c @@ -54,8 +54,7 @@ /*** global variables ****************************************************************************/ -/* Linux declares environ in , so don't repeat it here. */ -#if (!(defined(__linux__) && defined (__USE_GNU)) && !defined(__CYGWIN__)) +#if !HAVE_DECL_ENVIRON extern char **environ; #endif diff --git a/m4.include/ax_check_compile_flag.m4 b/m4.include/ax_check_compile_flag.m4 index 8323a2275..54191c553 100644 --- a/m4.include/ax_check_compile_flag.m4 +++ b/m4.include/ax_check_compile_flag.m4 @@ -34,19 +34,24 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -# Yury Zaytsev: -# Toggle Werror since at some point clang started treating unknown -W -# flags as warnings, succeeding with the build, yet issuing an annoying -# warning. - -#serial 6 +#serial 11 AC_DEFUN([AX_CHECK_COMPILE_FLAG], [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl -AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ +AC_CACHE_CHECK([whether the _AC_LANG compiler accepts $1], CACHEVAR, [ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS - _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1 -Werror" + if test x"m4_case(_AC_LANG, + [C], [$GCC], + [C++], [$GXX], + [Fortran], [$GFC], + [Fortran 77], [$G77], + [Objective C], [$GOBJC], + [Objective C++], [$GOBJCXX], + [no])" = xyes ; then + add_gnu_werror="-Werror" + fi + _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1 $add_gnu_werror" AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], [AS_VAR_SET(CACHEVAR,[yes])], [AS_VAR_SET(CACHEVAR,[no])])