From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4038 invoked from network); 9 May 2001 05:38:41 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 9 May 2001 05:38:41 -0000 Received: (qmail 27527 invoked by alias); 9 May 2001 05:38:37 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14275 Received: (qmail 27516 invoked from network); 9 May 2001 05:38:36 -0000 From: "Bart Schaefer" Message-Id: <1010509053748.ZM4390@candle.brasslantern.com> Date: Wed, 9 May 2001 05:37:47 +0000 In-Reply-To: <1010509050330.ZM15052@candle.brasslantern.com> Comments: In reply to "Bart Schaefer" "Re: Termcap saga again" (May 9, 5:03am) References: <1010509050330.ZM15052@candle.brasslantern.com> X-Mailer: Z-Mail (5.0.0 30July97) To: Peter Stephenson , zsh-workers@sunsite.dk (Zsh hackers list) Subject: PATCH (the last?) Re: Termcap saga again MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On May 9, 5:03am, Bart Schaefer wrote: } } On May 8, 7:25pm, Peter Stephenson wrote: } } } } In that case I shall commit the following. } } Unfortunately, that has now broken my build on RedHat 5.2 and 6.2. Ok, this seems to have got it. I put all of PWS's new code into the not-found branch of a new AC_CHECK_HEADERS call that checks for ONLY curses.h. The empty if-found branch correctly results in an AC_DEFINE call as needed. I then forced the AC_CHECK_HEADERS to fail by the simple expedient of changing the name of the file to one that doesn't exist, and thereby verified that AC_TRY_COMPILE in the not-found branch works correctly. By virtue of using AC_CHECK_HEADERS, autoheader discovers that we're looking for curses.h and it's no longer necessary to have a #undef for it in acconfig.h, which increases my confidence that everything will work right. I hate having to add things explicitly to acconfig.h. Since term.h is now alone in its own call to AC_CHECK_HEADERS, I took the opportunity to remove an explicit `if test ...' and simply move the code that followed into the if-found branch of that macro. Index: acconfig.h =================================================================== --- acconfig.h 2001/05/09 04:42:10 1.5 +++ acconfig.h 2001/05/09 05:19:35 @@ -318,8 +318,5 @@ /* Define if you have the terminfo strnames symbol. */ #undef HAVE_STRNAMES -/* Define if we have curses.h */ -#undef HAVE_CURSES_H - /* Define if term.h chokes without curses.h */ #undef TERM_H_NEEDS_CURSES_H Index: configure.in =================================================================== --- configure.in 2001/05/09 04:42:10 1.8 +++ configure.in 2001/05/09 05:25:35 @@ -562,15 +562,14 @@ AC_SEARCH_LIBS(tgetent, [$termcap_curses_order]) case "$LIBS" in *curses*) -AC_CACHE_CHECK(for curses.h, ac_cv_header_curses_h, +AC_CHECK_HEADERS(curses.h, [], +AC_CACHE_CHECK(for Solaris 8 curses.h mistake, ac_cv_header_curses_h, AC_TRY_COMPILE([#include ], [], [ac_cv_header_curses_h=yes AC_DEFINE(HAVE_CURSES_H)], -ac_cv_header_curses_h=no)) -AC_CHECK_HEADERS(term.h) -if test x$ac_cv_header_term_h = xyes; then - -AC_MSG_CHECKING(if term.h needs curses.h) +ac_cv_header_curses_h=no))) +AC_CHECK_HEADERS(term.h, +[AC_MSG_CHECKING(if term.h needs curses.h) AC_TRY_COMPILE([#include ], [char **test = boolcodes;], boolcodes_with_only_term_h=yes, boolcodes_with_only_term_h=no) AC_TRY_COMPILE([#include @@ -620,8 +619,7 @@ #include ], [char **test = strnames; printf(*test);], AC_DEFINE(HAVE_STRNAMES) strnames=yes, strnames=no) AC_MSG_RESULT($strnames) - -fi;; +]);; esac dnl Some systems (Solaris 2.x, Linux Redhat 5.x) require -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net