From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24980 invoked from network); 3 Dec 2003 01:20:07 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 3 Dec 2003 01:20:07 -0000 Received: (qmail 28252 invoked by alias); 3 Dec 2003 01:19:52 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6829 Received: (qmail 28194 invoked from network); 3 Dec 2003 01:19:51 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 3 Dec 2003 01:19:51 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [216.27.190.146] by sunsite.dk (MessageWall 1.0.8) with SMTP; 3 Dec 2003 1:19:51 -0000 Received: from ceramic.fifi.org (mail@ceramic.fifi.org [216.27.190.147]) by tantale.fifi.org (8.9.3p2/8.9.3/Debian 8.9.3-21) with ESMTP id RAA19654; Tue, 2 Dec 2003 17:19:44 -0800 Received: from phil by ceramic.fifi.org with local (Exim 4.22) id 1ARLg8-0001Sh-2j; Tue, 02 Dec 2003 17:19:44 -0800 To: Jens Petersen Cc: Danek Duvall , Zsh-users Subject: Re: problem building zsh in background References: <87d6bgrxml.fsf@ceramic.fifi.org> <877k1ngcp5.fsf@ceramic.fifi.org> <87zneewgvd.fsf@ceramic.fifi.org> <20031130185652.GA26891@lorien.emufarm.org> <87fzg5ax4d.fsf@ceramic.fifi.org> Mail-Copies-To: nobody From: Philippe Troin Date: 02 Dec 2003 17:19:44 -0800 In-Reply-To: Message-ID: <87smk2puj3.fsf@ceramic.fifi.org> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Sender: Philippe Troin --=-=-= Jens Petersen writes: > >>>>> "PT" == Philippe Troin writes: > > PT> - add a --with-working-tcsetpgrp / > PT> --without-working-tcsetpgrp switch to force > PT> configure to skip the test (instead of failing) > PT> and assume a working / non-working tcsetpgrp > > PT> Would that satisfy everyone? > > Sounds ok to me. :) Okay, here's the patch that implements --with-tcsetpgrp. Following Bart Schaefer 's advice, I've changed the configure switch to --with-tcsetpgrp. Please test. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=zsh-bgconfigure-3.patch Index: zshconfig.ac =================================================================== RCS file: /cvsroot/zsh/zsh/zshconfig.ac,v retrieving revision 1.42 diff -u -r1.42 zshconfig.ac --- zshconfig.ac 13 Nov 2003 14:34:34 -0000 1.42 +++ zshconfig.ac 3 Dec 2003 01:08:15 -0000 @@ -528,7 +528,7 @@ dnl SYSV-derived systems. dnl On HPUX, Hcurses is reported to work better than curses. AC_ARG_WITH(curses-terminfo, -[ --with-curses-terminfo use terminfo support from curses library], +[ --with-curses-terminfo use terminfo support from curses library], [if test x$withval = xyes; then termcap_curses_order="tinfo curses ncurses termcap" AC_SEARCH_LIBS(tigetstr, [$termcap_curses_order]) @@ -1576,24 +1576,53 @@ dnl if found tcsetpgrp, test to see if it actually works dnl for instance, BeOS R4.51 does not support it yet dnl ----------- -if test -t 0 && test $ac_cv_func_tcsetpgrp = yes; then +AC_ARG_WITH(tcsetpgrp, +[ --with-tcsetpgrp assumes that tcsetpgrp() exists and works correctly],[ +case "x$withval" in + xyes) zsh_working_tcsetpgrp=yes;; + xno) zsh_working_tcsetpgrp=no;; + *) AC_ERROR([please use --with-tcsetpgrp=yes or --with-tcsetpgrp=no]);; +esac],[zsh_working_tcsetpgrp=check]) +if test "x$ac_cv_func_tcsetpgrp" = xyes; then +case "x$zsh_working_tcsetpgrp" in + xcheck) + trap "" SIGTTOU > /dev/null 2>&1 || : AC_CACHE_CHECK(if tcsetpgrp() actually works, zsh_cv_sys_tcsetpgrp, [AC_TRY_RUN([ #include #include +#include main() { + int fd; int ret; - ret=tcsetpgrp(0, tcgetpgrp(0)); - exit(ret<0); + fd=open("/dev/tty", O_RDWR); + if (fd < 0) exit(2); + ret=tcsetpgrp(fd, tcgetpgrp(fd)); + if (ret < 0) exit(1); + exit(0); } ], - zsh_cv_sys_tcsetpgrp=yes, - zsh_cv_sys_tcsetpgrp=no, - zsh_cv_sys_tcsetpgrp=yes)]) - if test $zsh_cv_sys_tcsetpgrp = no; then - AC_DEFINE(BROKEN_TCSETPGRP) - fi + zsh_cv_sys_tcsetpgrp=yes, [ +case $? in + 1) zsh_cv_sys_tcsetpgrp=no;; + 2) zsh_cv_sys_tcsetpgrp=notty;; + *) zsh_cv_sys_tcsetpgrp=error;; +esac + ], zsh_cv_sys_tcsetpgrp=yes)]) + case "x$zsh_cv_sys_tcsetpgrp" in + xno) AC_DEFINE(BROKEN_TCSETPGRP);; + xyes) :;; + xnotty) AC_MSG_ERROR([no controlling tty +Try running configure with --with-tcsetpgrp or --without-tcsetpgrp]);; + *) AC_MSG_ERROR([unexpected return status]);; + esac + trap - SIGTTOU > /dev/null 2>&1 || : + ;; + xyes) :;; + xno) AC_DEFINE(BROKEN_TCSETPGRP);; + *) AC_MSG_ERROR([unexpected value zsh_working_tcsetpgrp=$zsh_working_tcsetpgrp]);; +esac fi dnl ----------- --=-=-=--