+ # workaround for systems with ncurses before 20111029, due to change of
+ # feature test macro from _XPG5 to _XOPEN_SOURCE
+ if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
+ then
+ cf_define_xpg5=no
+ AC_MSG_CHECKING(if _XPG5 should be defined to enable wide-characters)
+
+ AC_TRY_COMPILE([
+#include <${cf_cv_ncurses_header:-curses.h}>],
+ [int x = _XPG5],,
+ [cf_save_cppflags="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS -D_XPG5"
+ AC_TRY_COMPILE([
+#include <${cf_cv_ncurses_header:-curses.h}>],
+ [int x = _XPG5],
+ [cf_define_xpg5=yes])
+ CPPFLAGS="$cf_save_cppflags"])
+ AC_MSG_RESULT($cf_define_xpg5)
+
+ if test "$cf_define_xpg5" = yes
+ then
+ CPPFLAGS="$CPPFLAGS -D_XPG5"
+ fi
+ fi
+