if test X"$CURSESLIBS" != X"" && cc_supports_flag -Wcast-qual \
&& cc_supports_flag -Werror; then
dnl Check for printw() prototype compatibility
dnl FIXME: We can check che prototype compatibility only if $CC supports
dnl -Wcast-qual and -Werror
AC_MSG_CHECKING(whether printw() requires argument of "const char *")
ac_save_LIBS=$LIBS
LIBS="$CURSESLIBS $LIBS"
ac_save_CFLAGS=$CFLAGS
CFLAGS="-Wcast-qual -Werror"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[
#if defined(HAVE_CURSES_H)
# include <curses.h>
#elif defined(HAVE_NCURSES_H)
# include <ncurses.h>
#endif
],
[printw((const char *)"Test");]
)],
[ac_cv_compatible_printw=yes],
[ac_cv_compatible_printw=no]
)
LIBS=$ac_save_LIBS
CFLAGS=$ac_save_CFLAGS
AC_MSG_RESULT([$ac_cv_compatible_printw])
if test "$ac_cv_compatible_printw" = no; then
AC_MSG_WARN([The printw() function of your ncurses or curses library is old, we will disable usage of the library. If you want to use this library anyway, please update to newer version of the library, ncurses 5.4 or later is recommended. You can get the library from http://www.gnu.org/software/ncurses/.])
AC_MSG_NOTICE([Disabling curses])
AC_DEFINE(HAVE_INCOMPATIBLE_PRINTW, 1, [Do we have incompatible printw() in curses library?])
dnl AC_DEFINE(HAVE_CURSES_H, 0)
dnl AC_DEFINE(HAVE_NCURSES_H, 0)
fi
fi
dnl ************ printw **********************
EXTRA_WARNINGS=""
# We had to eliminate -Wnested-externs because of libtool changes
WARNLIST="all missing-prototypes
missing-declarations
strict-prototypes
declaration-after-statement
pointer-arith
write-strings
cast-qual cast-align
bad-function-cast
inline
missing-format-attribute
format=2
format-security
format-nonliteral
no-long-long
no-strict-aliasing"
for j in $WARNLIST
do
if
cc_supports_flag -W$j
then
case $j in
"no-long-long")
if test "${enable_no_long_long}" = "yes"; then
EXTRA_WARNINGS="$EXTRA_WARNINGS -W$j"
fi;;
*) EXTRA_WARNINGS="$EXTRA_WARNINGS -W$j";;
esac
fi
done
dnl Add any system specific options here.
if test "${enable_ansi}" = "unknown"; then
enable_ansi=yes
fi
case "$host_os" in
*linux*|*bsd*)
if test "${enable_fatal_warnings}" = "unknown"; then
enable_fatal_warnings=yes
fi
;;
*solaris*)
;;
esac
case "$host_os" in
*linux*)
if test "${enable_times_kludge}" = "unknown"; then
enable_times_kludge=yes
fi
;;
esac
if test "${enable_ansi}" = yes && cc_supports_flag -std=iso9899:199409 ; then
echo "Enabling ANSI Compatibility on this platform"
ANSI="-ansi -D_GNU_SOURCE -DANSI_ONLY"
fi
if test "${enable_fatal_warnings}" = yes && cc_supports_flag -Werror ; then
echo "Enabling Fatal Warnings (-Werror) on this platform"