From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18327 invoked from network); 26 Jul 2000 09:09:16 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 26 Jul 2000 09:09:16 -0000 Received: (qmail 18099 invoked by alias); 26 Jul 2000 09:08:15 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12381 Received: (qmail 18092 invoked from network); 26 Jul 2000 09:08:15 -0000 Date: Wed, 26 Jul 2000 10:07:47 +0100 From: Peter Stephenson Subject: Re: PATCH: configure.in: tgetent test does not work on Cygwin In-reply-to: "Your message of Wed, 26 Jul 2000 12:23:20 +0400." <000301bff6da$c198e730$21c9ca95@mow.siemens.ru> To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Message-id: <0FYA00LHQS0YW3@la-la.cambridgesiliconradio.com> Content-transfer-encoding: 7BIT > > > 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 Cambridge Silicon Radio, Unit 300, Science Park, Milton Road, Cambridge, CB4 0XL, UK Tel: +44 (0)1223 392070