Mercurial > hg > octave-lojdl
changeset 2626:b35a5cd8107f
[project @ 1997-01-27 01:41:30 by jwe]
author | jwe |
---|---|
date | Mon, 27 Jan 1997 01:43:16 +0000 |
parents | e2f1586bb393 |
children | 0b852cbea582 |
files | ChangeLog acconfig.h aclocal.m4 configure.in octMakefile.in src/ChangeLog src/sighandlers.cc |
diffstat | 7 files changed, 89 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ +Sun Jan 26 19:39:51 1997 John W. Eaton <jwe@bevo.che.wisc.edu> + + * emacs/Makefile.in: New file. + * configure.in: create emacs/Makefile. + * octMakefile.in: Move/add emacs dir to the appropriate lists. + Sat Jan 25 22:27:14 1997 John W. Eaton <jwe@bevo.che.wisc.edu> + * aclocal.m4 (OCTAVE_CHECK_TYPE): New macro, stolen from bash. + * configure.in: Use it. + * acconfig.h: Add #undef for sigset_t. + * configure.in (RLD_FLAG): Delete. * mkoctfile.in (RLD_FLAG): Delete. * octave-bug.in (RLD_FLAG): Delete.
--- a/acconfig.h +++ b/acconfig.h @@ -122,6 +122,9 @@ /* Define to `short' if <sys/types.h> doesn't define. */ #undef nlink_t +/* Define to `int' if <signal.h> doesn't define. */ +#undef sigset_t + /* Leave that blank line there!! Autoheader needs it. If you're adding to this file, keep in mind:
--- a/aclocal.m4 +++ b/aclocal.m4 @@ -565,3 +565,28 @@ AC_DEFINE(MUST_REINSTALL_SIGHANDLERS) fi ]) +dnl +dnl This check originally from bash 2.0. +dnl +dnl Check for typedef'd symbols in header files, but allow the caller to +dnl specify the include files to be checked in addition to the default. +dnl +dnl OCTAVE_CHECK_TYPE(TYPE, HEADERS, DEFAULT[, VALUE-IF-FOUND]) +AC_DEFUN(OCTAVE_CHECK_TYPE, +[AC_REQUIRE([AC_HEADER_STDC])dnl +AC_MSG_CHECKING(for $1) +AC_CACHE_VAL(octave_cv_type_$1, +[AC_EGREP_CPP($1, [#include <sys/types.h> +#if STDC_HEADERS +#include <stdlib.h> +#endif +$2 +], octave_cv_type_$1=yes, octave_cv_type_$1=no)]) +AC_MSG_RESULT($octave_cv_type_$1) +ifelse($#, 4, [if test $octave_cv_type_$1 = yes; then + AC_DEFINE($4) + fi]) +if test $octave_cv_type_$1 = no; then + AC_DEFINE($1, $3) +fi +])
--- a/configure.in +++ b/configure.in @@ -21,7 +21,7 @@ ### Software Foundation, 59 Temple Place - Suite 330, Boston, MA ### 02111-1307, USA. -AC_REVISION($Revision: 1.247 $) +AC_REVISION($Revision: 1.248 $) AC_PREREQ(2.9) AC_INIT(src/octave.cc) AC_CONFIG_HEADER(config.h) @@ -928,6 +928,7 @@ AC_CHECK_TYPE(dev_t, short) AC_CHECK_TYPE(ino_t, unsigned long) AC_CHECK_TYPE(nlink_t, short) +OCTAVE_CHECK_TYPE(sigset_t, [#include <signal.h>], int) ### Define VOID_SIGHANDLER for readline. @@ -1117,8 +1118,8 @@ AC_OUTPUT(Makefile octMakefile Makeconf test/Makefile dlfcn/Makefile doc/Makefile doc/faq/Makefile doc/interpreter/Makefile - doc/liboctave/Makefile doc/refcard/Makefile examples/Makefile - liboctave/Makefile src/Makefile libcruft/Makefile + doc/liboctave/Makefile doc/refcard/Makefile emacs/Makefile + examples/Makefile liboctave/Makefile src/Makefile libcruft/Makefile libcruft/Makerules libcruft/blas/Makefile libcruft/balgen/Makefile libcruft/dassl/Makefile libcruft/eispack/Makefile libcruft/fftpack/Makefile libcruft/fsqp/Makefile
--- a/octMakefile.in +++ b/octMakefile.in @@ -30,7 +30,7 @@ MAKEINFO.PATCH ChangeLog ChangeLog.[0-9] # Complete directory trees to distribute. -DISTDIRS = emacs glob kpathsea make # plplot +DISTDIRS = glob kpathsea make # plplot # Subdirectories in which to run `make all'. SUBDIRS = @INFO_DIR@ @PLPLOT_DIR@ @READLINE_DIR@ @DLFCN_DIR@ glob \ @@ -52,8 +52,8 @@ octave-bug VERSION ARCH # Subdirectories in which to run `make bin-dist'. -BINDISTSUBDIRS = libcruft liboctave src info kpathsea readline \ - scripts doc examples +BINDISTSUBDIRS = libcruft liboctave src kpathsea readline info \ + scripts doc emacs examples # Complete directories trees to distribute with binary distributions. BINDISTDIRS = emacs
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +Sun Jan 26 19:41:48 1997 John W. Eaton <jwe@bevo.che.wisc.edu> + + * sighandlers.cc (sigchld_handler): Block SIGCHLD while + sigchld_hander is running. + Sat Jan 25 22:36:39 1997 John W. Eaton <jwe@bevo.che.wisc.edu> * Makefile.in (bin-dist): Update for 2.x.
--- a/src/sighandlers.cc +++ b/src/sighandlers.cc @@ -80,13 +80,33 @@ #endif #if defined (__EMX__) -#define MAYBE_UNBLOCK_SIGNAL(sig) \ +#define MAYBE_ACK_SIGNAL(sig) \ octave_set_signal_handler (sig, SIG_ACK) #else -#define MAYBE_UNBLOCK_SIGNAL(sig) \ +#define MAYBE_ACK_SIGNAL(sig) \ do { } while (0) #endif +// The following signal blocking stuff is stolen from bash: + +#define BLOCK_SIGNAL(sig, nvar, ovar) \ + do \ + { \ + sigemptyset (&nvar); \ + sigaddset (&nvar, sig); \ + sigemptyset (&ovar); \ + sigprocmask (SIG_BLOCK, &nvar, &ovar); \ + } \ + while (0) + +#if defined (HAVE_POSIX_SIGNALS) +#define BLOCK_CHILD(nvar, ovar) BLOCK_SIGNAL (SIGCHLD, nvar, ovar) +#define UNBLOCK_CHILD(ovar) sigprocmask (SIG_SETMASK, &ovar, 0) +#else +#define BLOCK_CHILD(nvar, ovar) ovar = sigblock (sigmask (SIGCHLD)) +#define UNBLOCK_CHILD(ovar) sigsetmask (ovar) +#endif + void octave_save_signal_mask (void) { @@ -189,14 +209,22 @@ static RETSIGTYPE sigchld_handler (int /* sig */) { -#if defined (__EMX__) volatile octave_interrupt_handler *saved_interrupt_handler = octave_ignore_interrupts (); + // I wonder if this is really right, or if SIGCHLD should just be + // blocked on OS/2 systems the same as for systems with POSIX signal + // functions. + +#if defined (__EMX__) volatile sig_handler *saved_sigchld_handler - = octave_set_signal_hanlder (SIGCHLD, SIG_IGN); + = octave_set_signal_handler (SIGCHLD, SIG_IGN); #endif + sigset_t set, oset; + + BLOCK_CHILD (set, oset); + int n = octave_child_list::length (); if (n == 0) @@ -230,13 +258,15 @@ } } -#if defined (__EMX__) octave_set_interrupt_handler (saved_interrupt_handler); + UNBLOCK_CHILD (oset); + +#ifdef __EMX__ octave_set_signal_handler (SIGCHLD, saved_sigchld_handler); #endif - MAYBE_UNBLOCK_SIGNAL (SIGCHLD); + MAYBE_ACK_SIGNAL (SIGCHLD); MAYBE_REINSTALL_SIGHANDLER (SIGCHLD, sigchld_handler); @@ -247,7 +277,7 @@ static RETSIGTYPE sigfpe_handler (int /* sig */) { - MAYBE_UNBLOCK_SIGNAL (SIGFPE); + MAYBE_ACK_SIGNAL (SIGFPE); MAYBE_REINSTALL_SIGHANDLER (SIGFPE, sigfpe_handler); @@ -272,7 +302,7 @@ static RETSIGTYPE sigint_handler (int sig) { - MAYBE_UNBLOCK_SIGNAL (sig); + MAYBE_ACK_SIGNAL (sig); MAYBE_REINSTALL_SIGHANDLER (sig, sigint_handler); @@ -288,7 +318,7 @@ static RETSIGTYPE sigpipe_handler (int /* sig */) { - MAYBE_UNBLOCK_SIGNAL (SIGPIPE); + MAYBE_ACK_SIGNAL (SIGPIPE); MAYBE_REINSTALL_SIGHANDLER (SIGPIPE, sigpipe_handler);