dnl
dnl ---------------------------------------------------------------------------
dnl ---------------------------------------------------------------------------
dnl
dnl ---------------------------------------------------------------------------
dnl ---------------------------------------------------------------------------
[
AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
[AC_TRY_LINK([#include <langinfo.h>],
[
AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
[AC_TRY_LINK([#include <langinfo.h>],
am_cv_langinfo_codeset=yes,
am_cv_langinfo_codeset=no)
])
am_cv_langinfo_codeset=yes,
am_cv_langinfo_codeset=no)
])
dnl ----------------
dnl SVr4 curses should have term.h as well (where it puts the definitions of
dnl the low-level interface). This may not be true in old/broken implementations,
dnl ----------------
dnl SVr4 curses should have term.h as well (where it puts the definitions of
dnl the low-level interface). This may not be true in old/broken implementations,
AC_TRY_COMPILE([
#include <${cf_cv_ncurses_header:-curses.h}>
#include <${cf_header}>],
AC_TRY_COMPILE([
#include <${cf_cv_ncurses_header:-curses.h}>
#include <${cf_header}>],
dnl ------------------
dnl Any X/Open curses implementation must have unctrl.h, but ncurses packages
dnl may put it in a subdirectory (along with ncurses' other headers, of
dnl ------------------
dnl Any X/Open curses implementation must have unctrl.h, but ncurses packages
dnl may put it in a subdirectory (along with ncurses' other headers, of
AC_TRY_COMPILE([
#include <${cf_cv_ncurses_header:-curses.h}>
#include <${cf_header}>],
AC_TRY_COMPILE([
#include <${cf_cv_ncurses_header:-curses.h}>
#include <${cf_header}>],
dnl ------------------
dnl Check for likely values of wacs_map[].
AC_DEFUN([CF_CURSES_WACS_MAP],
dnl ------------------
dnl Check for likely values of wacs_map[].
AC_DEFUN([CF_CURSES_WACS_MAP],
#define _XOPEN_SOURCE_EXTENDED
#endif
#include <${cf_cv_ncurses_header:-curses.h}>],
#define _XOPEN_SOURCE_EXTENDED
#endif
#include <${cf_cv_ncurses_header:-curses.h}>],
test "$cf_cv_curses_wacs_map" != unknown && AC_DEFINE_UNQUOTED(CURSES_WACS_ARRAY,$cf_cv_curses_wacs_map,[Define to name of (n)curses wide-character array])
])dnl
dnl ---------------------------------------------------------------------------
test "$cf_cv_curses_wacs_map" != unknown && AC_DEFINE_UNQUOTED(CURSES_WACS_ARRAY,$cf_cv_curses_wacs_map,[Define to name of (n)curses wide-character array])
])dnl
dnl ---------------------------------------------------------------------------
dnl ----------------------
dnl Do a check to see if the WACS_xxx constants are defined compatibly with
dnl X/Open Curses. In particular, NetBSD's implementation of the WACS_xxx
dnl ----------------------
dnl Do a check to see if the WACS_xxx constants are defined compatibly with
dnl X/Open Curses. In particular, NetBSD's implementation of the WACS_xxx
#endif
#include <${cf_cv_ncurses_header:-curses.h}>],
[cchar_t *foo = WACS_PLUS;
#endif
#include <${cf_cv_ncurses_header:-curses.h}>],
[cchar_t *foo = WACS_PLUS;
#define _XOPEN_SOURCE_EXTENDED
#endif
#include <${cf_cv_ncurses_header:-curses.h}>],
#define _XOPEN_SOURCE_EXTENDED
#endif
#include <${cf_cv_ncurses_header:-curses.h}>],
dnl -----------------
dnl Test for availability of useful gcc __attribute__ directives to quiet
dnl compiler warnings. Though useful, not all are supported -- and contrary
dnl -----------------
dnl Test for availability of useful gcc __attribute__ directives to quiet
dnl compiler warnings. Though useful, not all are supported -- and contrary
extern void wow(char *,...) GCC_SCANFLIKE(1,2);
extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
extern void foo(void) GCC_NORETURN;
extern void wow(char *,...) GCC_SCANFLIKE(1,2);
extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
extern void foo(void) GCC_NORETURN;
dnl -----------
dnl Use this macro after CF_XOPEN_SOURCE, but do not require it (not all
dnl programs need this test).
dnl -----------
dnl Use this macro after CF_XOPEN_SOURCE, but do not require it (not all
dnl programs need this test).
[cf_cv_define_sigwinch=maybe],
[cf_cv_define_sigwinch=no])
])
[cf_cv_define_sigwinch=maybe],
[cf_cv_define_sigwinch=no])
])
test "$cf_cv_sys_time_select" = yes && AC_DEFINE(HAVE_SYS_TIME_SELECT,1,[Define to 1 if we can include <sys/time.h> with <sys/select.h>])
])dnl
dnl ---------------------------------------------------------------------------
test "$cf_cv_sys_time_select" = yes && AC_DEFINE(HAVE_SYS_TIME_SELECT,1,[Define to 1 if we can include <sys/time.h> with <sys/select.h>])
])dnl
dnl ---------------------------------------------------------------------------
dnl --------------
dnl Look for term.h, which is part of X/Open curses. It defines the interface
dnl to terminfo database. Usually it is in the same include-path as curses.h,
dnl --------------
dnl Look for term.h, which is part of X/Open curses. It defines the interface
dnl to terminfo database. Usually it is in the same include-path as curses.h,
cf_cv_term_header="$cf_test"],[
cf_cv_term_header=unknown
])
cf_cv_term_header="$cf_test"],[
cf_cv_term_header=unknown
])
dnl ---------------
dnl Test if we should define X/Open source for curses, needed on Digital Unix
dnl 4.x, to see the extended functions, but breaks on IRIX 6.x.
dnl ---------------
dnl Test if we should define X/Open source for curses, needed on Digital Unix
dnl 4.x, to see the extended functions, but breaks on IRIX 6.x.
[cf_cv_need_xopen_extension=none],
[
for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
[cf_cv_need_xopen_extension=none],
[
for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
],[cf_cv_xaw_compat=yes],[cf_cv_xaw_compat=no])])
if test "$cf_cv_xaw_compat" = no
],[cf_cv_xaw_compat=yes],[cf_cv_xaw_compat=no])])
if test "$cf_cv_xaw_compat" = no
CF_TRY_PKG_CONFIG(ice,,[AC_MSG_WARN(unable to find ICE library)])
CF_TRY_PKG_CONFIG(sm,,[AC_MSG_WARN(unable to find SM library)])
CF_TRY_PKG_CONFIG(xt,,[AC_MSG_WARN(unable to find Xt library)])
CF_TRY_PKG_CONFIG(ice,,[AC_MSG_WARN(unable to find ICE library)])
CF_TRY_PKG_CONFIG(sm,,[AC_MSG_WARN(unable to find SM library)])
CF_TRY_PKG_CONFIG(xt,,[AC_MSG_WARN(unable to find Xt library)])
],[cf_cv_xt_ice_compat=yes],[cf_cv_xt_ice_compat=no])])
if test "$cf_cv_xt_ice_compat" = no
],[cf_cv_xt_ice_compat=yes],[cf_cv_xt_ice_compat=no])])
if test "$cf_cv_xt_ice_compat" = no
AC_CHECK_FUNC(XOpenDisplay,,[
AC_CHECK_LIB(X11,XOpenDisplay,
AC_CHECK_FUNC(XOpenDisplay,,[
AC_CHECK_LIB(X11,XOpenDisplay,
AC_CHECK_FUNC(XtAppInitialize,,[
AC_CHECK_LIB(Xt, XtAppInitialize,
[AC_DEFINE(HAVE_LIBXT,1,[Define to 1 if we can compile with the Xt library])
cf_have_X_LIBS=Xt
AC_CHECK_FUNC(XtAppInitialize,,[
AC_CHECK_LIB(Xt, XtAppInitialize,
[AC_DEFINE(HAVE_LIBXT,1,[Define to 1 if we can compile with the Xt library])
cf_have_X_LIBS=Xt