From: Philippe Troin <phil@fifi.org>
To: Jens Petersen <petersen@redhat.com>
Cc: Danek Duvall <duvall@emufarm.org>, Zsh-users <zsh-users@sunsite.dk>
Subject: Re: problem building zsh in background
Date: 02 Dec 2003 17:19:44 -0800 [thread overview]
Message-ID: <87smk2puj3.fsf@ceramic.fifi.org> (raw)
In-Reply-To: <m31xrp6iqd.wl%petersen@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 581 bytes --]
Jens Petersen <petersen@redhat.com> writes:
> >>>>> "PT" == Philippe Troin <phil@fifi.org> 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 <schaefer@brasslantern.com>'s advice, I've changed the
configure switch to --with-tcsetpgrp.
Please test.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: zsh-bgconfigure-3.patch --]
[-- Type: text/x-patch, Size: 2667 bytes --]
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 <sys/types.h>
#include <unistd.h>
+#include <fcntl.h>
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 -----------
next prev parent reply other threads:[~2003-12-03 1:20 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-25 8:17 Jens Petersen
2003-11-25 20:39 ` Philippe Troin
2003-11-26 8:57 ` Jens Petersen
2003-11-26 19:19 ` Philippe Troin
2003-11-27 1:32 ` Jens Petersen
2003-11-27 10:30 ` Jens Petersen
2003-11-30 5:43 ` Philippe Troin
2003-11-30 18:56 ` Danek Duvall
2003-12-01 2:36 ` Geoff Wing
2003-12-01 6:08 ` Philippe Troin
2003-12-01 6:56 ` Bart Schaefer
2003-12-01 8:32 ` Jens Petersen
2003-12-03 1:19 ` Philippe Troin [this message]
2003-12-09 4:50 ` Jens Petersen
2003-12-09 5:26 ` Philippe Troin
2003-12-01 1:06 ` Jens Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87smk2puj3.fsf@ceramic.fifi.org \
--to=phil@fifi.org \
--cc=duvall@emufarm.org \
--cc=petersen@redhat.com \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).