+ CFLAGS="$cf_check_cflags"])
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_CHECK_CURSES_LIB version: 3 updated: 2021/01/04 19:45:09
+dnl -------------------
+dnl $1 = nominal library name, used also for header lookup
+dnl $2 = suffix to append to library name
+dnl $3 = function to check for using AC_CHECK_LIB
+dnl $4 = optional parameter list for $3
+AC_DEFUN([CF_CHECK_CURSES_LIB],
+[
+AC_REQUIRE([CF_PKG_CONFIG])
+
+cf_have_curses_lib=no
+
+: ${NCURSES_CONFIG_PKG:=none}
+if test "x${NCURSES_CONFIG_PKG}" = xnone; then
+ :
+elif test "x${PKG_CONFIG:=none}" != xnone; then
+ AC_MSG_CHECKING(pkg-config for $1$2)
+ if "$PKG_CONFIG" --exists "$1$2" ; then
+ AC_MSG_RESULT(yes)
+
+ AC_MSG_CHECKING(if the $1$2 package files work)
+
+ cf_save_CPPFLAGS="$CPPFLAGS"
+ cf_save_LIBS="$LIBS"
+
+ CF_ADD_CFLAGS(`$PKG_CONFIG --cflags "$1$2"`)
+ CF_ADD_LIBS(`$PKG_CONFIG --libs "$1$2"`)
+
+ AC_TRY_LINK([#include <$1.h>],
+ [(void) $3 ( ]ifelse([$4],,,[[$4]])[ );],
+ [AC_TRY_RUN([#include <$1.h>
+ int main(void)
+ { (void) $3 ( ]ifelse([$4],,,[[$4]])[ ); return 0; }],
+ [cf_have_curses_lib=yes],
+ [cf_have_curses_lib=no],
+ [cf_have_curses_lib=maybe])],
+ [cf_have_curses_lib=no])
+ AC_MSG_RESULT($cf_have_curses_lib)
+ test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
+ if test "$cf_have_curses_lib" != "yes"
+ then
+ CPPFLAGS="$cf_save_CPPFLAGS"
+ LIBS="$cf_save_LIBS"
+ else
+ CF_UPPER(cf_upper,have_lib$1)
+ AC_DEFINE_UNQUOTED($cf_upper,1)
+ fi
+ fi
+fi
+if test "$cf_have_curses_lib" = no; then
+ AC_CHECK_LIB($1$2,$3,[
+ CF_UPPER(cf_upper,have_lib$1)
+ CF_ADD_LIBS(-l$1$2)
+ AC_DEFINE_UNQUOTED($cf_upper,1)])
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_CLANG_COMPILER version: 8 updated: 2021/01/01 13:31:04
+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
+dnl not ignore some gcc options.
+dnl
+dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to
+dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from
+dnl the wrappers for gcc and g++ warnings.
+dnl
+dnl $1 = GCC (default) or GXX
+dnl $2 = CLANG_COMPILER (default)
+dnl $3 = CFLAGS (default) or CXXFLAGS
+AC_DEFUN([CF_CLANG_COMPILER],[
+ifelse([$2],,CLANG_COMPILER,[$2])=no
+
+if test "$ifelse([$1],,[$1],GCC)" = yes ; then
+ AC_MSG_CHECKING(if this is really Clang ifelse([$1],GXX,C++,C) compiler)
+ cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])"
+ AC_TRY_COMPILE([],[
+#ifdef __clang__
+#else
+make an error
+#endif
+],[ifelse([$2],,CLANG_COMPILER,[$2])=yes
+],[])
+ ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS"
+ AC_MSG_RESULT($ifelse([$2],,CLANG_COMPILER,[$2]))
+fi
+
+CLANG_VERSION=none
+
+if test "x$ifelse([$2],,CLANG_COMPILER,[$2])" = "xyes" ; then
+ case "$CC" in
+ (c[[1-9]][[0-9]]|*/c[[1-9]][[0-9]])
+ AC_MSG_WARN(replacing broken compiler alias $CC)
+ CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
+ CC=clang
+ ;;
+ esac
+
+ AC_MSG_CHECKING(version of $CC)
+ CLANG_VERSION="`$CC --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(CLANG[[^)]]*) //' -e 's/^.*(Debian[[^)]]*) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
+ test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
+ AC_MSG_RESULT($CLANG_VERSION)
+
+ for cf_clang_opt in \
+ -Qunused-arguments \
+ -Wno-error=implicit-function-declaration
+ do
+ AC_MSG_CHECKING(if option $cf_clang_opt works)
+ cf_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $cf_clang_opt"
+ AC_TRY_LINK([
+ #include <stdio.h>],[
+ printf("hello!\\n");],[
+ cf_clang_optok=yes],[
+ cf_clang_optok=no])
+ AC_MSG_RESULT($cf_clang_optok)
+ CFLAGS="$cf_save_CFLAGS"
+ if test "$cf_clang_optok" = yes; then
+ CF_VERBOSE(adding option $cf_clang_opt)
+ CF_APPEND_TEXT(CFLAGS,$cf_clang_opt)
+ fi
+ done