summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2012-06-21 08:45:02 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2012-06-21 08:45:02 +0000
commitcbb8a3c762ba6034e5ae0c35e6d04c2de130f933 (patch)
treec348da0874d7a9eb65097cf2addb33a89f908060
parente71f43fbf72d8c8b1507a44caf6a85ce1821c2c5 (diff)
downloadzsh-cbb8a3c762ba6034e5ae0c35e6d04c2de130f933.tar.gz
zsh-cbb8a3c762ba6034e5ae0c35e6d04c2de130f933.zip
30518: attempt to supply tgoto() prototype when missing only.
For Solaris 10 and earlier.
-rw-r--r--ChangeLog5
-rw-r--r--Src/zsh_system.h4
-rw-r--r--configure.ac18
3 files changed, 26 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index be2138203..b207f7c4d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2012-06-21 Peter Stephenson <pws@csr.com>
+ * 30518: configure.ac, Src/zsh_system.h: attempt to supply
+ tgoto() prototype only when missing for Solaris 10 and earlier.
+
* 30519 (correction noticed by Danek): MACHINES: try to
modernise.
@@ -16379,5 +16382,5 @@
*****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5672 $
+* $Revision: 1.5673 $
*****************************************************
diff --git a/Src/zsh_system.h b/Src/zsh_system.h
index f38533023..f20a7bb90 100644
--- a/Src/zsh_system.h
+++ b/Src/zsh_system.h
@@ -874,3 +874,7 @@ extern short ospeed;
# endif
# endif
#endif
+
+#ifdef TGOTO_PROTO_MISSING
+char *tgoto(const char *cap, int col, int row);
+#endif
diff --git a/configure.ac b/configure.ac
index 82903ca81..6c0459747 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1603,6 +1603,8 @@ AH_TEMPLATE([HAVE_NUMNAMES],
[Define if you have the terminfo numnames symbol.])
AH_TEMPLATE([HAVE_STRNAMES],
[Define if you have the terminfo strnames symbol.])
+AH_TEMPLATE([TGOTO_PROTO_MISSING],
+[Define if there is no prototype for the tgoto() terminal function.])
if test x$zsh_cv_path_term_header != xnone; then
AC_DEFINE(ZSH_HAVE_TERM_H)
@@ -1618,26 +1620,42 @@ if test x$zsh_cv_path_term_header != xnone; then
AC_TRY_LINK($term_includes, [char **test = boolcodes; puts(*test);],
AC_DEFINE(HAVE_BOOLCODES) boolcodes=yes, boolcodes=no)
AC_MSG_RESULT($boolcodes)
+
AC_MSG_CHECKING(if numcodes is available)
AC_TRY_LINK($term_includes, [char **test = numcodes; puts(*test);],
AC_DEFINE(HAVE_NUMCODES) numcodes=yes, numcodes=no)
AC_MSG_RESULT($numcodes)
+
AC_MSG_CHECKING(if strcodes is available)
AC_TRY_LINK($term_includes, [char **test = strcodes; puts(*test);],
AC_DEFINE(HAVE_STRCODES) strcodes=yes, strcodes=no)
AC_MSG_RESULT($strcodes)
+
AC_MSG_CHECKING(if boolnames is available)
AC_TRY_LINK($term_includes, [char **test = boolnames; puts(*test);],
AC_DEFINE(HAVE_BOOLNAMES) boolnames=yes, boolnames=no)
AC_MSG_RESULT($boolnames)
+
AC_MSG_CHECKING(if numnames is available)
AC_TRY_LINK($term_includes, [char **test = numnames; puts(*test);],
AC_DEFINE(HAVE_NUMNAMES) numnames=yes, numnames=no)
AC_MSG_RESULT($numnames)
+
AC_MSG_CHECKING(if strnames is available)
AC_TRY_LINK($term_includes, [char **test = strnames; puts(*test);],
AC_DEFINE(HAVE_STRNAMES) strnames=yes, strnames=no)
AC_MSG_RESULT($strnames)
+
+ dnl There are apparently defective terminal library headers on some
+ dnl versions of Solaris before 11.
+ AC_MSG_CHECKING(if tgoto prototype is missing)
+ tgoto_includes="$term_includes
+/* guaranteed to clash with any valid tgoto prototype */
+extern void tgoto(int **stuff, float **more_stuff);"
+ AC_TRY_LINK($tgoto_includes,
+ [int *stuff; float *more_stuff; tgoto(&stuff, &more_stuff);],
+ AC_DEFINE(TGOTO_PROTO_MISSING) tgotoprotomissing=yes, tgotoprotomissing=no)
+ AC_MSG_RESULT($tgotoprotomissing)
else
ZSH_TERM_H=
fi