From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9152 invoked from network); 25 Feb 2004 11:24:18 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 25 Feb 2004 11:24:18 -0000 Received: (qmail 9698 invoked by alias); 25 Feb 2004 11:24:12 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19460 Received: (qmail 9686 invoked from network); 25 Feb 2004 11:24:11 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 25 Feb 2004 11:24:11 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [62.189.58.19] by sunsite.dk (MessageWall 1.0.8) with SMTP; 25 Feb 2004 11:24:11 -0000 Received: from MAILSWEEPER01.csr.com (mailhost1.csr.com [62.189.183.235]) by lhuumrelay3.lnd.ops.eu.uu.net (8.11.0/8.11.0) with ESMTP id i1PBOAv10841 for ; Wed, 25 Feb 2004 11:24:10 GMT Received: from EXCHANGE02.csr.com (unverified [192.168.137.45]) by MAILSWEEPER01.csr.com (Content Technologies SMTPRS 4.3.12) with ESMTP id for ; Wed, 25 Feb 2004 11:23:50 +0000 Received: from csr.com ([192.168.144.127]) by EXCHANGE02.csr.com with Microsoft SMTPSVC(5.0.2195.5329); Wed, 25 Feb 2004 11:25:28 +0000 To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: PATCH: terminfo configuration redux Date: Wed, 25 Feb 2004 11:24:08 +0000 Message-ID: <10725.1077708248@csr.com> From: Peter Stephenson X-OriginalArrivalTime: 25 Feb 2004 11:25:28.0226 (UTC) FILETIME=[11FF8020:01C3FB92] Here is another patch for terminfo configuration. It's very much like the original patch with a couple of things fixed. I've used tigetflag consistently as the test function; before it switched between tigetflag and tigetstr. To be honest, I simply don't know if this is good enough to fix the warning about term.h from configure or not. I have not attempted to search for termcap in non standard places. There should be enough hooks (--enable-cppflags, --enable-libs) to enable that if you need it. One other thing I noticed when running configure was that this: AC_CHECK_PROG([PCRECONF], pcre-config, pcre-config) if test "x$ac_cv_prog_PCRECONF" = xpcre-config; then CFLAGS="$CFLAGS `pcre-config --cflags`" fi causes problems: it actually adds a -I header. If that goes into CFLAGS, it isn't picked up by the preprocessor tests, which therefore can't find pcre.h. Hence the output really needs to be added to CPPFLAGS (somewhat counterintuitively). If pcre-config sometimes outputs stuff for the compiler itself we are more stuck. Index: configure.ac =================================================================== RCS file: /cvsroot/zsh/zsh/configure.ac,v retrieving revision 1.8 diff -u -r1.8 configure.ac --- configure.ac 20 Feb 2004 15:27:35 -0000 1.8 +++ configure.ac 25 Feb 2004 10:59:31 -0000 @@ -620,8 +620,7 @@ AH_TEMPLATE([TERM_H_NEEDS_CURSES_H], [Define if term.h chokes without curses.h.]) AC_SEARCH_LIBS(tgetent, [$termcap_curses_order]) -case "$LIBS" in -*curses*) +AC_SEARCH_LIBS(tigetflag, [$termcap_curses_order]) AC_CHECK_HEADERS(curses.h, [], [AC_CACHE_CHECK(for Solaris 8 curses.h mistake, ac_cv_header_curses_solaris, AC_TRY_COMPILE([#include ], [], @@ -683,8 +682,7 @@ #include ], [char **test = strnames; printf(*test);], AC_DEFINE(HAVE_STRNAMES) strnames=yes, strnames=no) AC_MSG_RESULT($strnames) -]);; -esac +]) dnl Some systems (Solaris 2.x, Linux Redhat 5.x) require dnl libnsl (Network Services Library) to find yp_all Index: Src/Modules/terminfo.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Modules/terminfo.c,v retrieving revision 1.22 diff -u -r1.22 terminfo.c --- Src/Modules/terminfo.c 14 Sep 2003 05:10:09 -0000 1.22 +++ Src/Modules/terminfo.c 25 Feb 2004 10:59:31 -0000 @@ -29,12 +29,18 @@ #define USES_TERM_H 1 #include "terminfo.mdh" -#include "terminfo.pro" +#if defined(HAVE_TIGETFLAG) && defined(HAVE_CURSES_H) +# define USE_TERMINFO_MODULE 1 +#else +# undef USE_TERMINFO_MODULE +#endif + +#include "terminfo.pro" static char terminfo_nam[] = "terminfo"; /**/ -#ifdef HAVE_TIGETSTR +#ifdef USE_TERMINFO_MODULE /* The following two undefs are needed for Solaris 2.6 */ # ifdef VINTR @@ -44,9 +50,7 @@ # undef offsetof # endif -# ifdef HAVE_CURSES_H -# include -# endif +# include # ifdef HAVE_TERM_H # include # endif @@ -123,19 +127,19 @@ } /**/ -#else /* !HAVE_TIGETSTR */ +#else /* !USE_TERMINFO_MODULE */ #define bin_echoti bin_notavail /**/ -#endif /* !HAVE_TIGETSTR */ +#endif /* !USE_TERMINFO_MODULE */ static struct builtin bintab[] = { BUILTIN("echoti", 0, bin_echoti, 1, -1, 0, NULL, NULL), }; /**/ -#ifdef HAVE_TIGETSTR +#ifdef USE_TERMINFO_MODULE /* Empty dummy function for special hash parameters. */ @@ -361,7 +365,7 @@ } /**/ -#endif /* HAVE_TIGETSTR */ +#endif /* USE_TERMINOF_MODULE */ /**/ int @@ -374,7 +378,7 @@ int boot_(Module m) { -#ifdef HAVE_TIGETSTR +#ifdef USE_TERMINFO_MODULE # ifdef HAVE_SETUPTERM int errret; @@ -394,7 +398,7 @@ int cleanup_(Module m) { -#ifdef HAVE_TIGETSTR +#ifdef USE_TERMINFO_MODULE Param pm; if ((pm = (Param) paramtab->getnode(paramtab, terminfo_nam)) && Index: Src/Modules/terminfo.mdd =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Modules/terminfo.mdd,v retrieving revision 1.10 diff -u -r1.10 terminfo.mdd --- Src/Modules/terminfo.mdd 23 Apr 2001 19:59:04 -0000 1.10 +++ Src/Modules/terminfo.mdd 25 Feb 2004 10:59:31 -0000 @@ -1,13 +1,13 @@ name=zsh/terminfo -link='if test "x$ac_cv_func_tigetstr" = xyes; then +link='if test "x$ac_cv_func_tigetflag" = xyes -a "x$ac_cv_header_curses_h" = xyes; then if test "x$zsh_cv_shared_tigetstr" = xyes; then echo either else echo static fi else - echo either; + echo no; fi ' load=yes -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 692070 ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************