dnl
dnl Author: Thomas E. Dickey 1995-on
dnl
-dnl $Id: aclocal.m4,v 1.916 2020/07/04 23:31:15 tom Exp $
+dnl $Id: aclocal.m4,v 1.929 2020/08/29 13:05:21 tom Exp $
dnl Macros used in NCURSES auto-configuration script.
dnl
dnl These macros are maintained separately from NCURSES. The copyright on
AC_SUBST(ADAFLAGS)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_ADD_CXXFLAGS version: 1 updated: 2020/04/04 16:16:13
-dnl ---------------
-dnl Copy non-preprocessor flags to $CXXFLAGS, preprocessor flags to $CPPFLAGS
-dnl The second parameter if given makes this macro verbose.
-dnl
-dnl Put any preprocessor definitions that use quoted strings in $EXTRA_CPPFLAGS,
-dnl to simplify use of $CPPFLAGS in compiler checks, etc., that are easily
-dnl confused by the quotes (which require backslashes to keep them usable).
-AC_DEFUN([CF_ADD_CXXFLAGS],
-[
-cf_save_CXXFLAGS="$CFLAGS"
-CFLAGS="$CXXFLAGS"
-CF_ADD_CFLAGS($1 ifelse($2,,,[,$2]))
-CXXFLAGS="$CFLAGS"
-CFLAGS="$cf_save_CXXFLAGS"
-])dnl
-dnl ---------------------------------------------------------------------------
dnl CF_ADD_CFLAGS version: 14 updated: 2020/04/04 16:16:13
dnl -------------
dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS
AC_SUBST(EXTRA_CPPFLAGS)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_ADD_CXXFLAGS version: 1 updated: 2020/04/04 16:16:13
+dnl ---------------
+dnl Copy non-preprocessor flags to $CXXFLAGS, preprocessor flags to $CPPFLAGS
+dnl The second parameter if given makes this macro verbose.
+dnl
+dnl Put any preprocessor definitions that use quoted strings in $EXTRA_CPPFLAGS,
+dnl to simplify use of $CPPFLAGS in compiler checks, etc., that are easily
+dnl confused by the quotes (which require backslashes to keep them usable).
+AC_DEFUN([CF_ADD_CXXFLAGS],
+[
+cf_save_CXXFLAGS="$CFLAGS"
+CFLAGS="$CXXFLAGS"
+CF_ADD_CFLAGS($1 ifelse($2,,,[,$2]))
+CXXFLAGS="$CFLAGS"
+CFLAGS="$cf_save_CXXFLAGS"
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_ADD_INCDIR version: 15 updated: 2018/06/20 20:23:13
])
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_CLANG_COMPILER version: 2 updated: 2013/11/19 19:23:35
+dnl CF_CLANG_COMPILER version: 3 updated: 2020/08/28 04:10:22
dnl -----------------
dnl Check if the given compiler is really clang. clang's C driver defines
dnl __GNUC__ (fooling the configure script into setting $GCC to yes) but does
ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS"
AC_MSG_RESULT($ifelse([$2],,CLANG_COMPILER,[$2]))
fi
+
+if test "x$CLANG_COMPILER" = "xyes" ; then
+ CF_APPEND_TEXT(CFLAGS,-Wno-error=implicit-function-declaration)
+fi
])
dnl ---------------------------------------------------------------------------
dnl CF_CONST_X_STRING version: 4 updated: 2020/03/10 18:53:47
fi
])dnl
dnl ---------------------------------------------------------------------------
+dnl CF_ENABLE_WARNINGS version: 6 updated: 2020/08/28 04:10:22
+dnl ------------------
+dnl Configure-option to enable gcc warnings
+dnl
+dnl $1 = extra options to add, if supported
+dnl $2 = option for checking attributes. By default, this is done when
+dnl warnings are enabled. For other values:
+dnl yes: always do this, e.g., to use in generated library-headers
+dnl no: never do this
+AC_DEFUN([CF_ENABLE_WARNINGS],[
+if ( test "$GCC" = yes || test "$GXX" = yes )
+then
+CF_FIX_WARNINGS(CFLAGS)
+CF_FIX_WARNINGS(CPPFLAGS)
+CF_FIX_WARNINGS(LDFLAGS)
+AC_MSG_CHECKING(if you want to turn on gcc warnings)
+CF_ARG_ENABLE(warnings,
+ [ --enable-warnings test: turn on gcc compiler warnings],
+ [with_warnings=yes],
+ [with_warnings=no])
+AC_MSG_RESULT($with_warnings)
+if test "$with_warnings" = "yes"
+then
+ ifelse($2,,[CF_GCC_ATTRIBUTES])
+ CF_GCC_WARNINGS($1)
+fi
+ifelse($2,yes,[CF_GCC_ATTRIBUTES])
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
dnl CF_ERRNO version: 5 updated: 1997/11/30 12:44:39
dnl --------
dnl Check if 'errno' is declared in <errno.h>
AC_MSG_RESULT($ADAFLAGS)
])dnl
dnl ---------------------------------------------------------------------------
+dnl CF_FIX_WARNINGS version: 2 updated: 2020/08/28 15:08:28
+dnl ---------------
+dnl Warning flags do not belong in CFLAGS, CPPFLAGS, etc. Any of gcc's
+dnl "-Werror" flags can interfere with configure-checks. Those go into
+dnl EXTRA_CFLAGS.
+dnl
+dnl $1 = variable name to repair
+define([CF_FIX_WARNINGS],[
+if ( test "$GCC" = yes || test "$GXX" = yes )
+then
+ case [$]$1 in
+ (*-Werror=*)
+ CF_VERBOSE(repairing $1: [$]$1)
+ cf_temp_flags=
+ for cf_temp_scan in [$]$1
+ do
+ case "x$cf_temp_scan" in
+ (x-Werror=*)
+ CF_APPEND_TEXT(EXTRA_CFLAGS,"$cf_temp_scan")
+ ;;
+ (*)
+ CF_APPEND_TEXT(cf_temp_flags,"$cf_temp_scan")
+ ;;
+ esac
+ done
+ $1="$cf_temp_flags"
+ CF_VERBOSE(... fixed [$]$1)
+ CF_VERBOSE(... extra $EXTRA_CFLAGS)
+ ;;
+ esac
+fi
+AC_SUBST(EXTRA_CFLAGS)
+])dnl
+dnl ---------------------------------------------------------------------------
dnl CF_FOPEN_BIN_R version: 2 updated: 2019/12/31 08:53:54
dnl --------------
dnl Check if fopen works when the "b" (binary) flag is added to the mode
dnl to documentation, unrecognized directives cause older compilers to barf.
AC_DEFUN([CF_GCC_ATTRIBUTES],
[
-if test "$GCC" = yes
+if ( test "$GCC" = yes || test "$GXX" = yes )
then
cat > conftest.i <<EOF
#ifndef GCC_PRINTF
CF_CLANG_COMPILER(GCC,CLANG_COMPILER,CFLAGS)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_GCC_WARNINGS version: 37 updated: 2020/01/05 20:04:12
+dnl CF_GCC_WARNINGS version: 38 updated: 2020/08/28 15:08:28
dnl ---------------
dnl Check if the compiler supports useful warning options. There's a few that
dnl we don't use, simply because they're too noisy:
AC_CHECKING([for $CC warning options])
cf_save_CFLAGS="$CFLAGS"
- EXTRA_CFLAGS="-Wall"
+ EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
for cf_opt in \
wd1419 \
wd1683 \
then
AC_CHECKING([for $CC warning options])
cf_save_CFLAGS="$CFLAGS"
- EXTRA_CFLAGS=
cf_warn_CONST=""
test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_REGEX version: 13 updated: 2020/03/10 18:53:47
+dnl CF_REGEX version: 14 updated: 2020/07/11 19:09:29
dnl --------
dnl Attempt to determine if we've got one of the flavors of regular-expression
dnl code that we can support.
cf_regex_libs="regex re"
case $host_os in
(mingw*)
- cf_regex_libs="gnurx $cf_regex_libs"
+ cf_regex_libs="systre gnurx $cf_regex_libs"
;;
esac
done
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_SHARED_OPTS version: 96 updated: 2020/05/23 19:39:36
+dnl CF_SHARED_OPTS version: 102 updated: 2020/08/22 18:17:19
dnl --------------
dnl --------------
dnl Attempt to determine the appropriate CC/LD options for creating a shared
# Ignore first argument (compiler) and use LD (link.exe) unconditionally
LD="[$]LD"
clopts=()
- ldopts=()
+ ldopts=("/subsystem:console")
libs=()
isdll=0
while test \[$]# -gt 0; do
-link)
# ignore -link argument
;;
+ -M[[TD]] | -M[[TD]]d)
+ # ignore runtime-library option
+ ;;
-dll)
isdll=1
;;
CF_EOF
chmod +x mk_prog.sh
LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh"
+ LINK_TESTS="$SHELL ${rel_builddir}/mk_prog.sh"
;;
(mingw*)
cf_cv_shlib_version=mingw
CF_SHARED_SONAME
MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]'
;;
+ (nskJ*)
+ CC_SHARED_OPTS=
+ MK_SHARED_LIB='${LD} -Wshared -Weld=-export_all -o $[@]'
+ ;;
+ (nskL*)
+ CC_SHARED_OPTS=
+ MK_SHARED_LIB='${LD} -Wshared -Wxld=-export_all -o $[@]'
+ ;;
(nto-qnx*|openbsd*|freebsd[[12]].*)
CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $[@]'
CF_SHARED_SONAME
MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $[@]'
else
- MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -Wl,-shared -Wl,-Bshareable -o $[@]'
+ MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -o $[@]'
fi
;;
(osf*|mls+*)