Solaris build fixes: pick the right curses more of the time

This commit is contained in:
David Adam 2014-12-07 16:41:15 +08:00
parent 381404c4f4
commit a8059c5962
12 changed files with 91 additions and 31 deletions

View file

@ -11,8 +11,13 @@ Functions used for implementing the set_color builtin.
#if HAVE_NCURSES_H
#include <ncurses.h>
#elif HAVE_NCURSES_CURSES_H
#include <ncurses/curses.h>
#else
// Solaris curses defines lots of unneeded macros which conflict with C++
#define NOMACROS
#include <curses.h>
#undef NOMACROS
#endif
#if HAVE_TERM_H

View file

@ -45,11 +45,15 @@ parts of fish.
#include <execinfo.h>
#endif
#if HAVE_NCURSES_H
#include <ncurses.h>
#elif HAVE_NCURSES_CURSES_H
#include <ncurses/curses.h>
#else
// Solaris curses defines lots of unneeded macros which conflict with C++
#define NOMACROS
#include <curses.h>
#undef NOMACROS
#endif
#if HAVE_TERM_H

View file

@ -301,35 +301,6 @@ case $target_os in
;;
esac
# Check for Solaris curses tputs having fixed length parameter list.
AC_MSG_CHECKING([if we are using non varargs tparm.])
AC_COMPILE_IFELSE(
[
AC_LANG_PROGRAM(
[
#include <curses.h>
#include <term.h>
],
[
tparm( "" );
]
)
],
[tparm_solaris_kludge=no],
[tparm_solaris_kludge=yes]
)
if test "x$tparm_solaris_kludge" = "xyes"; then
AC_MSG_RESULT(yes)
AC_DEFINE(
[TPARM_SOLARIS_KLUDGE],
[1],
[Define to 1 if tparm accepts a fixed amount of paramters.]
)
else
AC_MSG_RESULT(no)
fi
#
# BSD-specific flags go here
#
@ -390,7 +361,7 @@ fi
# Check presense of various header files
#
AC_CHECK_HEADERS([getopt.h termios.h sys/resource.h term.h ncurses/term.h ncurses.h curses.h stropts.h siginfo.h sys/select.h sys/ioctl.h execinfo.h spawn.h sys/sysctl.h])
AC_CHECK_HEADERS([getopt.h termios.h sys/resource.h term.h ncurses/term.h ncurses.h ncurses/curses.h curses.h stropts.h siginfo.h sys/select.h sys/ioctl.h execinfo.h spawn.h sys/sysctl.h])
if test x$local_gettext != xno; then
AC_CHECK_HEADERS([libintl.h])
@ -748,6 +719,43 @@ else
AC_MSG_RESULT(no)
fi
# Check for Solaris curses tputs having fixed length parameter list.
AC_MSG_CHECKING([if we are using non varargs tparm.])
AC_COMPILE_IFELSE(
[
AC_LANG_PROGRAM(
[
#if HAVE_NCURSES_H
#include <ncurses.h>
#else
#include <curses.h>
#endif
#if HAVE_TERM_H
#include <term.h>
#elif HAVE_NCURSES_TERM_H
#include <ncurses/term.h>
#endif
],
[
tparm( "" );
]
)
],
[tparm_solaris_kludge=no],
[tparm_solaris_kludge=yes]
)
if test "x$tparm_solaris_kludge" = "xyes"; then
AC_MSG_RESULT(yes)
AC_DEFINE(
[TPARM_SOLARIS_KLUDGE],
[1],
[Define to 1 if tparm accepts a fixed amount of paramters.]
)
else
AC_MSG_RESULT(no)
fi
# Tell the world what we know
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

View file

@ -21,8 +21,13 @@
#if HAVE_NCURSES_H
#include <ncurses.h>
#elif HAVE_NCURSES_CURSES_H
#include <ncurses/curses.h>
#else
// Solaris curses defines lots of unneeded macros which conflict with C++
#define NOMACROS
#include <curses.h>
#undef NOMACROS
#endif
#if HAVE_TERM_H

View file

@ -32,8 +32,13 @@
#if HAVE_NCURSES_H
#include <ncurses.h>
#elif HAVE_NCURSES_CURSES_H
#include <ncurses/curses.h>
#else
// Solaris curses defines lots of unneeded macros which conflict with C++
#define NOMACROS
#include <curses.h>
#undef NOMACROS
#endif
#if HAVE_TERM_H

View file

@ -24,8 +24,13 @@
#if HAVE_NCURSES_H
#include <ncurses.h>
#elif HAVE_NCURSES_CURSES_H
#include <ncurses/curses.h>
#else
// Solaris curses defines lots of unneeded macros which conflict with C++
#define NOMACROS
#include <curses.h>
#undef NOMACROS
#endif
#if HAVE_TERM_H

5
io.cpp
View file

@ -24,8 +24,13 @@ Utilities for io redirection.
#if HAVE_NCURSES_H
#include <ncurses.h>
#elif HAVE_NCURSES_CURSES_H
#include <ncurses/curses.h>
#else
// Solaris curses defines lots of unneeded macros which conflict with C++
#define NOMACROS
#include <curses.h>
#undef NOMACROS
#endif
#if HAVE_TERM_H

View file

@ -61,6 +61,9 @@
/* Define to 1 if you have the nan function */
#define HAVE_NAN 1
/* Define to 1 if you have the <ncurses/curses.h> header file. */
/* #undef HAVE_NCURSES_CURSES_H */
/* Define to 1 if you have the <ncurses.h> header file. */
#define HAVE_NCURSES_H 1

View file

@ -22,8 +22,13 @@
#if HAVE_NCURSES_H
#include <ncurses.h>
#elif HAVE_NCURSES_CURSES_H
#include <ncurses/curses.h>
#else
// Solaris curses defines lots of unneeded macros which conflict with C++
#define NOMACROS
#include <curses.h>
#undef NOMACROS
#endif
#if HAVE_TERM_H

View file

@ -33,8 +33,13 @@ Some of the code in this file is based on code from the Glibc manual.
#if HAVE_NCURSES_H
#include <ncurses.h>
#elif HAVE_NCURSES_CURSES_H
#include <ncurses/curses.h>
#else
// Solaris curses defines lots of unneeded macros which conflict with C++
#define NOMACROS
#include <curses.h>
#undef NOMACROS
#endif
#if HAVE_TERM_H

View file

@ -45,8 +45,13 @@ commence.
#if HAVE_NCURSES_H
#include <ncurses.h>
#elif HAVE_NCURSES_CURSES_H
#include <ncurses/curses.h>
#else
// Solaris curses defines lots of unneeded macros which conflict with C++
#define NOMACROS
#include <curses.h>
#undef NOMACROS
#endif
#if HAVE_TERM_H

View file

@ -20,8 +20,13 @@ efficient way for transforming that to the desired screen content.
#if HAVE_NCURSES_H
#include <ncurses.h>
#elif HAVE_NCURSES_CURSES_H
#include <ncurses/curses.h>
#else
// Solaris curses defines lots of unneeded macros which conflict with C++
#define NOMACROS
#include <curses.h>
#undef NOMACROS
#endif
#if HAVE_TERM_H