Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: configure.in: tgetent test does not work on Cygwin



> > > This particular problem was due to tgetent() problem.
> 
> Test succeeded because after program crashes with STATUS_ACCESS_VIOLATION (as
> our test program correctly did) we still get exit code 0. Here is the patch
> that tries a workaround - it creates temporary file and tests for it after
> program run. Any system without creat() ? I did not want to blindly check for
> Cygwin because ncurses does not have this problem.

Here's a context diff.  I've moved the test for the file up, because
configure removes conftest* before the final test for the cache variable.
It seems to work on solaris, where the answer is `yes'.  The old version
was working on cygwin for Windows NT 4 sp 5, however, where the answer was
`no'.  How does Windows 2000 manage to arrange for a status 0?

Index: configure.in
===================================================================
RCS file: /cvsroot/zsh/zsh/configure.in,v
retrieving revision 1.13
diff -u -r1.13 configure.in
--- configure.in	2000/07/20 16:17:57	1.13
+++ configure.in	2000/07/26 09:03:23
@@ -579,6 +579,8 @@
 dnl  Check if tgetent accepts NULL (and will allocate its own termcap buffer)
 dnl  Some termcaps reportedly accept a zero buffer, but then dump core
 dnl  in tgetstr().
+dnl  Under Cygwin test program crashes but exit code is still 0. So,
+dnl  we test for a file that porgram should create
 AC_CACHE_CHECK(if tgetent accepts NULL,
 zsh_cv_func_tgetent_accepts_null,
 [AC_TRY_RUN([
@@ -589,11 +591,16 @@
 	char tbuf[1024], *u;
     	u = tbuf;
     	tgetstr("cl", &u);
+	creat("conftest.tgetent", 0640);
     }
     exit(!i || i == -1);
 }
 ],
-  zsh_cv_func_tgetent_accepts_null=yes,
+  if test -f conftest.tgetent; then
+    zsh_cv_func_tgetent_accepts_null=yes
+  else
+    zsh_cv_func_tgetent_accepts_null=no
+  fi,
   zsh_cv_func_tgetent_accepts_null=no,
   zsh_cv_func_tgetent_accepts_null=no)])
 if test $zsh_cv_func_tgetent_accepts_null = yes; then

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxxx>
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070



Messages sorted by: Reverse Date, Date, Thread, Author