aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar David Adam <zanchey@ucc.gu.uwa.edu.au>2014-12-07 16:41:15 +0800
committerGravatar David Adam <zanchey@ucc.gu.uwa.edu.au>2014-12-21 23:37:23 +0800
commita8059c5962ba5695b3622fe0cf7b5e2eb383db1f (patch)
tree919ff79f6edc0c7db28202d09549c4eec8d23e9c
parent381404c4f45c59d90524adfa3ee746bd608aea9d (diff)
Solaris build fixes: pick the right curses more of the time
-rw-r--r--builtin_set_color.cpp5
-rw-r--r--common.cpp6
-rw-r--r--configure.ac68
-rw-r--r--env.cpp5
-rw-r--r--fallback.cpp5
-rw-r--r--input.cpp5
-rw-r--r--io.cpp5
-rw-r--r--osx/config.h3
-rw-r--r--output.cpp5
-rw-r--r--proc.cpp5
-rw-r--r--reader.cpp5
-rw-r--r--screen.cpp5
12 files changed, 91 insertions, 31 deletions
diff --git a/builtin_set_color.cpp b/builtin_set_color.cpp
index b3757e1c..76efde82 100644
--- a/builtin_set_color.cpp
+++ b/builtin_set_color.cpp
@@ -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
diff --git a/common.cpp b/common.cpp
index ceb323cb..db0f76e0 100644
--- a/common.cpp
+++ b/common.cpp
@@ -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
diff --git a/configure.ac b/configure.ac
index 6c0e32e9..a1716636 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
diff --git a/env.cpp b/env.cpp
index 99678455..1e63a335 100644
--- a/env.cpp
+++ b/env.cpp
@@ -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
diff --git a/fallback.cpp b/fallback.cpp
index d69d76f4..1a87a092 100644
--- a/fallback.cpp
+++ b/fallback.cpp
@@ -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
diff --git a/input.cpp b/input.cpp
index 8eeb4477..b4e323e9 100644
--- a/input.cpp
+++ b/input.cpp
@@ -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
diff --git a/io.cpp b/io.cpp
index 57ce43d3..56cb63b6 100644
--- a/io.cpp
+++ b/io.cpp
@@ -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
diff --git a/osx/config.h b/osx/config.h
index 99f83742..8a29644a 100644
--- a/osx/config.h
+++ b/osx/config.h
@@ -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
diff --git a/output.cpp b/output.cpp
index 6144746a..7be8954d 100644
--- a/output.cpp
+++ b/output.cpp
@@ -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
diff --git a/proc.cpp b/proc.cpp
index 1c8b8e6d..a1a393f3 100644
--- a/proc.cpp
+++ b/proc.cpp
@@ -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
diff --git a/reader.cpp b/reader.cpp
index 9e1afd22..07ee5154 100644
--- a/reader.cpp
+++ b/reader.cpp
@@ -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
diff --git a/screen.cpp b/screen.cpp
index 36a31f4b..d4bf02ae 100644
--- a/screen.cpp
+++ b/screen.cpp
@@ -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