Mercurial > hg > octave-terminal
changeset 3156:a494f93e60ff
[project @ 1998-02-20 07:47:48 by jwe]
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +Fri Feb 20 00:38:31 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * configure.in, Makeconf.in: Try to set things up to use the + system glob and fnmatch headers and functions if they exist. + Better handling of include and lib flags. + +Thu Feb 19 01:21:19 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * configure.in: Don't check for gamma or lgamma + * acconfig.h: Delete undef for HAVE_GAMMA and HAVE_LGAMMA. + +Wed Feb 18 15:05:54 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * configure.in: Don't check for vfork. + Wed Feb 11 19:41:22 1998 John W. Eaton <jwe@bevo.che.wisc.edu> * Makeconf.in (mk-libdir-link): Don't create link if a directory
--- a/Makeconf.in +++ b/Makeconf.in @@ -83,14 +83,14 @@ endif ifeq ($(TOPDIR),$(top_srcdir)) TMP_IF_2 = -I$(TOPDIR) -I$(TOPDIR)/liboctave -I$(TOPDIR)/src \ - -I$(TOPDIR)/glob -I$(TOPDIR)/libcruft/misc + -I$(TOPDIR)/libcruft/misc else TMP_IF_2 = -I$(TOPDIR) -I$(TOPDIR)/liboctave -I$(TOPDIR)/src \ - -I$(TOPDIR)/glob -I$(TOPDIR)/libcruft/misc -I$(top_srcdir) \ + -I$(TOPDIR)/libcruft/misc -I$(top_srcdir) \ -I$(top_srcdir)/liboctave -I$(top_srcdir)/src \ - -I$(top_srcdir)/glob -I$(top_srcdir)/libcruft/misc + -I$(top_srcdir)/libcruft/misc endif -INCFLAGS = $(TMP_IF_1) $(TMP_IF_2) $(DLFCN_INCFLAGS) +INCFLAGS = $(TMP_IF_1) $(TMP_IF_2) $(DLFCN_INCFLAGS) $(GLOB_INCFLAGS) LIBFLAGS = -L$(TOPDIR) @@ -136,6 +136,10 @@ LIBDLFCN = @LIBDLFCN@ LIBPLPLOT = @LIBPLPLOT@ LIBREADLINE = @LIBREADLINE@ +LIBKPATHSEA = @LIBKPATHSEA@ +LIBOCTINTERP = @LIBOCTINTERP@ +LIBOCTAVE = @LIBOCTAVE@ +LIBCRUFT = @LIBCRUFT@ SPECIAL_MATH_LIB = @SPECIAL_MATH_LIB@ # The arguments passed to configure.
--- a/acconfig.h +++ b/acconfig.h @@ -36,13 +36,6 @@ /* Define if your system's struct group has a gr_passwd field. */ #undef HAVE_GR_PASSWD -#if 0 -/* These are just here to keep autoheader from thinking that they are - missing even though they really aren't. */ -#undef HAVE_GAMMA -#undef HAVE_LGAMMA -#endif - /* Define if you have isinf(). */ #undef HAVE_ISINF
--- 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.297 $) +AC_REVISION($Revision: 1.298 $) AC_PREREQ(2.9) AC_INIT(src/octave.cc) AC_CONFIG_HEADER(config.h) @@ -125,7 +125,7 @@ dnl dnl # USE_PLPLOT=true dnl # PLPLOT_DIR=plplot -dnl # LIBPLPLOT=../plplot/libplplot.a +dnl # LIBPLPLOT='$(TOPDIR)/plplot/libplplot.$(LIBEXT) USE_PLPLOT=false PLPLOT_DIR="" LIBPLPLOT="" @@ -147,7 +147,7 @@ READLINE_DIR=readline USE_READLINE=true -LIBREADLINE=../readline/libreadline.a +LIBREADLINE='$(TOPDIR)/readline/libreadline.$(LIBEXT)' AC_ARG_ENABLE(readline, [ --enable-readline use readline library (default is yes)], [if test "$enableval" = no; then @@ -161,6 +161,9 @@ AC_SUBST(LIBREADLINE) AC_SUBST(READLINE_DIR) +LIBKPATHSEA='$(TOPDIR)/kpathsea/libkpathsea.$(LIBEXT)' +AC_SUBST(LIBKPATHSEA) + ### Make it possible to have Octave's array and matrix classes do bounds ### checking on element references. This slows some operations down a ### bit, so it is turned off by default. @@ -517,6 +520,19 @@ AC_MSG_ERROR([You can't disable building static AND shared libraries!]) fi +if $SHARED_LIBS; then + LIBOCTINTERP=-loctinterp + LIBOCTAVE=-loctave + LIBCRUFT=-lcruft +else + LIBOCTINTERP='$(TOPDIR)/src/liboctinterp.$(LIBEXT)' + LIBOCTAVE='$(TOPDIR)/liboctave/liboctave.$(LIBEXT)' + LIBCRUFT='$(TOPDIR)/libcruft/libcruft.$(LIBEXT)' +fi +AC_SUBST(LIBOCTINTERP) +AC_SUBST(LIBOCTAVE) +AC_SUBST(LIBCRUFT) + use_rpath=true AC_ARG_ENABLE(rpath, [ --enable-rpath add -rpath to link command for shared libraries], @@ -672,10 +688,10 @@ AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(assert.h curses.h fcntl.h float.h floatingpoint.h \ - grp.h ieeefp.h limits.h memory.h nan.h ncurses.h pwd.h sgtty.h \ - stdlib.h string.h sys/param.h sys/resource.h sys/select.h sys/stat.h \ - sys/time.h sys/times.h sys/types.h sys/utsname.h termcap.h termio.h \ - termios.h unistd.h varargs.h) + fnmatch.h glob.h grp.h ieeefp.h limits.h memory.h nan.h ncurses.h \ + pwd.h sgtty.h stdlib.h string.h sys/param.h sys/resource.h \ + sys/select.h sys/stat.h sys/time.h sys/times.h sys/types.h \ + sys/utsname.h termcap.h termio.h termios.h unistd.h varargs.h) if test "$ac_cv_header_termios_h" = yes \ || test "$ac_cv_header_termio_h" = yes \ @@ -685,6 +701,25 @@ AC_MSG_ERROR([I couldn't find termios.h, termio.h, or sgtty.h!]) fi +GLOB_DIR=glob +LIBGLOB='$(TOPDIR)/glob/libglob.$(LIBEXT)' +GLOB_INCFLAGS='-I$(top_srcdir)/glob -I$(TOPDIR)/glob' +if test "$ac_cv_header_fnmatch.h" = yes \ + && test "$ac_cv_header_glob.h" = yes; then + GLOB_DIR= + AC_CHECK_LIB(glob, glob) + AC_CHECK_FUNCS(fnmatch glob) + if test "$ac_cv_func_fnmatch" = yes \ + && test "$ac_cv_func_glob" = yes; then + GLOB_DIR= + LIBGLOB= + GLOB_INCFLAGS= + fi +fi +AC_SUBST(GLOB_DIR) +AC_SUBST(LIBGLOB) +AC_SUBST(GLOB_INCFLAGS) + ### Checks for functions and variables. AC_CHECK_FUNCS(atexit bcopy bzero dup2 endgrent endpwent execvp fcntl \ @@ -693,7 +728,7 @@ gettimeofday getuid getwd lstat memmove mkdir mkfifo on_exit pipe \ putenv rename rindex rmdir setgrent setpwent setvbuf sigaction \ sigpending sigprocmask sigsuspend stat strcasecmp strdup strerror \ - stricmp strncasecmp strnicmp tempnam umask unlink usleep vfork \ + stricmp strncasecmp strnicmp tempnam umask unlink usleep \ vfprintf vsprintf waitpid) OCTAVE_SMART_PUTENV @@ -856,18 +891,6 @@ AC_CHECK_FUNCS(acosh asinh atanh erf erfc) -case "$canonical_host_type" in - *-*-cygwin32) - AC_MSG_RESULT(assuming gamma works) - AC_DEFINE(HAVE_GAMMA, 1) - AC_MSG_RESULT(assuming lgamma works) - AC_DEFINE(HAVE_LGAMMA, 1) - ;; - *) - AC_CHECK_FUNCS(gamma lgamma) - ;; -esac - ### Checks for OS specific cruft. AC_STRUCT_ST_BLKSIZE @@ -1086,7 +1109,7 @@ export CXX export F77 -AC_CONFIG_SUBDIRS(glob kpathsea scripts $PLPLOT_DIR $READLINE_DIR) +AC_CONFIG_SUBDIRS($(GLOB_DIR) kpathsea scripts $PLPLOT_DIR $READLINE_DIR) ### Do the substitutions in all the Makefiles.
--- a/doc/interpreter/arith.texi +++ b/doc/interpreter/arith.texi @@ -774,6 +774,10 @@ 0/0, or @samp{Inf - Inf}, @end ifinfo or any operation with a NaN. + +Note that NaN always compares not equal to NaN. This behavior is +specified by the IEEE standard for floating point arithmetic. To +find NaN values, you must use the @code{isnan} function. @end defvr @defvr {Built-in Variable} pi
--- a/doc/interpreter/basics.texi +++ b/doc/interpreter/basics.texi @@ -636,7 +636,7 @@ @item C-s Search forward starting at the current line and moving `down' through -the the history as necessary. +the history as necessary. @end table On most terminals, you can also use the arrow keys in place of @kbd{C-p}
--- a/doc/interpreter/bugs.texi +++ b/doc/interpreter/bugs.texi @@ -466,7 +466,7 @@ like to join the discussion, please send a short note to @email{help-octave@strong{-request}@@bevo.che.wisc.edu}. -@strong{Please do not} send requests to be added or removed from the the +@strong{Please do not} send requests to be added or removed from the mailing list, or other administrative trivia to the list itself. If you think you have found a bug in the installation procedure,
--- a/doc/interpreter/errors.texi +++ b/doc/interpreter/errors.texi @@ -65,7 +65,7 @@ @end deftypefn @defvr {Built-in Variable} error_text -This variable contains the the text of error messages that would have +This variable contains the text of error messages that would have been printed in the body of the most recent @code{unwind_protect} or @code{try} statement or the @var{try} part of the most recent call to the @code{eval} function. Outside of the @code{unwind_protect} and
--- a/doc/interpreter/expr.texi +++ b/doc/interpreter/expr.texi @@ -139,7 +139,7 @@ @end defvr Finally, indexing a scalar with a vector of ones can be used to create a -vector the same size as the the index vector, with each element equal to +vector the same size as the index vector, with each element equal to the value of the original scalar. For example, the following statements @example
--- a/doc/interpreter/matrix.texi +++ b/doc/interpreter/matrix.texi @@ -177,7 +177,7 @@ @end example If three outputs are requested, @code{find} also returns a vector -containing the the nonzero values. For example, +containing the nonzero values. For example, @example @group
--- a/doc/interpreter/strings.texi +++ b/doc/interpreter/strings.texi @@ -286,7 +286,7 @@ @section String Conversions @deftypefn {Function File} {} bin2dec (@var{s}) -Return a decimal number corresponding to the the binary number +Return a decimal number corresponding to the binary number represented as a string of zeros and ones. For example, @example @@ -296,7 +296,7 @@ @end deftypefn @deftypefn {Function File} {} dec2bin (@var{n}) -Return a binary number corresponding the the nonnegative decimal number +Return a binary number corresponding the nonnegative decimal number @var{n}, as a string of ones and zeros. For example, @example
--- a/doc/interpreter/system.texi +++ b/doc/interpreter/system.texi @@ -783,7 +783,7 @@ The variable @code{EXEC_PATH} is a colon separated list of directories to search when executing subprograms. Its initial value is taken from the environment variable @code{OCTAVE_EXEC_PATH} (if it exists) or -@code{PATH}, but that value can be overridden by the the command line +@code{PATH}, but that value can be overridden by the command line argument @code{--exec-path PATH}, or by setting the value of @code{EXEC_PATH} in a startup script. If the value of @code{EXEC_PATH} begins (ends) with a colon, the directories
--- a/libcruft/ChangeLog +++ b/libcruft/ChangeLog @@ -1,3 +1,8 @@ +Thu Feb 19 21:00:00 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * specfun/ribesl.f, specfun/rjbesl.f: Compute NSIG correctly. + Add missing comma in declaration statement. + Sun Feb 1 12:39:10 1998 John W. Eaton <jwe@bevo.che.wisc.edu> * Makefile.in (install, uninstall): Use $(octlibdir), not $(libdir).
--- a/libcruft/specfun/ribesl.f +++ b/libcruft/specfun/ribesl.f @@ -169,7 +169,7 @@ C------------------------------------------------------------------- LOGICAL FIRST INTEGER IZE,K,L,MAGX,N,NB,NBMX,NCALC,NEND,NSIG,NSTART - DOUBLE PRECISION DGAMMA, D1MACH + DOUBLE PRECISION DGAMMA, D1MACH, 1 ALPHA,B,CONST,CONV,EM,EMPAL,EMP2AL,EN,ENMTEN,ENSIG, 2 ENTEN,EXPARG,FUNC,HALF,HALFX,ONE,P,PLAST,POLD,PSAVE,PSAVEL, 3 RTNSIG,SUM,TEMPA,TEMPB,TEMPC,TEST,TOVER,TWO,X,XLARGE,ZERO @@ -192,7 +192,7 @@ C Machine-dependent parameters C------------------------------------------------------------------- IF (FIRST) THEN - NSIG = NINT (-LOG (D1MACH (1))) + NSIG = NINT (-LOG (D1MACH (4))) ENTEN = 1.0D1 ** (INT (LOG10 (D1MACH (2)))) ENSIG = 1.0D1 ** NSIG RTNSIG = 1.0D1 ** (-NINT (NSIG / 4.0))
--- a/libcruft/specfun/rjbesl.f +++ b/libcruft/specfun/rjbesl.f @@ -139,7 +139,7 @@ C--------------------------------------------------------------------- LOGICAL FIRST INTEGER I,J,K,L,M,MAGX,N,NB,NBMX,NCALC,NEND,NSIG,NSTART - DOUBLE PRECISION DGAMMA, D1MACH + DOUBLE PRECISION DGAMMA, D1MACH, 1 ALPHA,ALPEM,ALP2EM,B,CAPP,CAPQ,CONV,EIGHTH,EM,EN,ENMTEN,ENSIG, 2 ENTEN,FACT,FOUR,FUNC,GNU,HALF,HALFX,ONE,ONE30,P,PI2,PLAST, 3 POLD,PSAVE,PSAVEL,RTNSIG,S,SUM,T,T1,TEMPA,TEMPB,TEMPC,TEST, @@ -183,7 +183,7 @@ C Machine-dependent parameters C--------------------------------------------------------------------- IF (FIRST) THEN - NSIG = NINT (-LOG (D1MACH (1))) + NSIG = NINT (-LOG (D1MACH (4))) ENTEN = 1.0D1 ** (INT (LOG10 (D1MACH (2)))) ENSIG = 1.0D1 ** NSIG RTNSIG = 1.0D1 ** (-NINT (NSIG / 4.0))
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,13 @@ +Thu Feb 19 01:16:38 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * lo-specfun.cc (xgamma, xlgamma): Define here. + * lo-mappers.cc: Not here. + + * lo-specfun.h: Declare xgamma and xlgamma here. + * lo-mappers.h: Not here. + + * lo-specfun.h: Never declare gamma or lgamma. + Tue Feb 10 16:14:36 1998 John W. Eaton <jwe@bevo.che.wisc.edu> * Array-idx.h (assign): Allow A([]) = X to succeed if X is an
--- a/liboctave/lo-mappers.cc +++ b/liboctave/lo-mappers.cc @@ -41,13 +41,6 @@ #define finite(x) ((x) < DBL_MAX && (x) > -DBL_MAX) #endif -extern "C" -{ - int F77_FCN (xdgamma, XDGAMMA) (const double&, double&); - - int F77_FCN (dlgams, DLGAMS) (const double&, double&, double&); -} - #ifndef M_LOG10E #define M_LOG10E 0.43429448190325182765 #endif @@ -56,10 +49,6 @@ #define M_PI 3.14159265358979323846 #endif -#if defined (HAVE_LGAMMA) && ! defined (SIGNGAM_DECLARED) -extern int signgam; -#endif - // Double -> double mappers. double @@ -170,16 +159,6 @@ } double -xgamma (double x) -{ - double result; - - F77_XFCN (xdgamma, XDGAMMA, (x, result)); - - return result; -} - -double xisinf (double x) { #if defined (HAVE_ISINF) @@ -191,17 +170,6 @@ #endif } -double -xlgamma (double x) -{ - double result; - double sgngam; - - F77_XFCN (dlgams, DLGAMS, (x, result, sgngam)); - - return result; -} - // Complex -> double mappers. double
--- a/liboctave/lo-mappers.h +++ b/liboctave/lo-mappers.h @@ -36,9 +36,7 @@ extern double xerfc (double x); extern double xisnan (double x); extern double xfinite (double x); -extern double xgamma (double x); extern double xisinf (double x); -extern double xlgamma (double x); extern double xisnan (const Complex& x); extern double xfinite (const Complex& x);
--- a/liboctave/lo-specfun.cc +++ b/liboctave/lo-specfun.cc @@ -115,35 +115,22 @@ } #endif -#if !defined (HAVE_GAMMA) double -gamma (double x) +xgamma (double x) { - double retval; - F77_XFCN (xdgamma, XDGAMMA, (x, retval)); - return retval; + double result; + F77_XFCN (xdgamma, XDGAMMA, (x, result)); + return result; } -#endif - -#if !defined (HAVE_LGAMMA) -// If the system doesn't have lgamma, assume that it doesn't have -// signgam either. - -int signgam; double -lgamma (double x) +xlgamma (double x) { - double retval; + double result; double sgngam; - - F77_XFCN (dlgams, DLGAMS, (x, retval, sgngam)); - - signgam = (int) sgngam; - - return retval; + F77_XFCN (dlgams, DLGAMS, (x, result, sgngam)); + return result; } -#endif int F77_FCN (ribesl, RIBESL) (const double& x, const double& alpha,
--- a/liboctave/lo-specfun.h +++ b/liboctave/lo-specfun.h @@ -47,13 +47,8 @@ extern double erfc (double); #endif -#if !defined (HAVE_GAMMA) -extern double gamma (double); -#endif - -#if !defined (HAVE_LGAMMA) -extern double lgamma (double); -#endif +extern double xgamma (double x); +extern double xlgamma (double x); extern Matrix besselj (double alpha, const Matrix& x); extern Matrix bessely (double alpha, const Matrix& x);
--- a/octMakefile.in +++ b/octMakefile.in @@ -34,7 +34,7 @@ DISTDIRS = glob kpathsea readline # plplot # Subdirectories in which to run `make all'. -SUBDIRS = @PLPLOT_DIR@ @READLINE_DIR@ @DLFCN_DIR@ glob \ +SUBDIRS = @PLPLOT_DIR@ @READLINE_DIR@ @DLFCN_DIR@ @GLOB_DIR@ \ kpathsea libcruft liboctave src scripts doc examples @@ -60,7 +60,7 @@ BINDISTSUBDIRS = libcruft liboctave src scripts doc emacs examples # Subdirectories in which to run clean targets. -CLEANSUBDIRS = $(DISTSUBDIRS) glob kpathsea +CLEANSUBDIRS = $(DISTSUBDIRS) @READLINE_DIR@ @GLOB_DIR@ kpathsea DIRS_TO_MAKE = $(bindir) $(libdir) $(octincludedir) $(fcnfiledir) \ $(octfiledir) $(archlibdir) $(localarchlibdir) \
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,6 +1,7 @@ -Fri Feb 6 00:29:50 1998 John W. Eaton <jwe@bevo.che.wisc.edu> +Fri Feb 20 01:31:32 1998 John W. Eaton <jwe@bevo.che.wisc.edu> - * miscellaneous/popen2.m: Use vfork instead of fork. + * plot/mplot.m, plot/subplot.m, plot/oneplot.m, plot/multiplot.m, + plot/subwindow.m: Call clearplot after setting up multiplot mode. Tue Feb 3 00:18:40 1998 John W. Eaton <jwe@bevo.che.wisc.edu>
--- a/scripts/miscellaneous/popen2.m +++ b/scripts/miscellaneous/popen2.m @@ -59,7 +59,7 @@ if (stdin_status == 0 && stdout_status == 0) - pid = vfork (); + pid = fork (); if (pid == 0)
--- a/scripts/plot/mplot.m +++ b/scripts/plot/mplot.m @@ -74,6 +74,8 @@ eval (sprintf ("gset origin %g, %g", xo, yo)); + clearplot; + endif endfunction
--- a/scripts/plot/multiplot.m +++ b/scripts/plot/multiplot.m @@ -98,6 +98,8 @@ __multiplot_xi__ = 1; __multiplot_yi__ = 1; + clearplot; + endif endfunction
--- a/scripts/plot/oneplot.m +++ b/scripts/plot/oneplot.m @@ -40,6 +40,7 @@ gset size 1, 1; gset origin 0, 0; __multiplot_mode__ = 0; + clearplot; endif endif
--- a/scripts/plot/subplot.m +++ b/scripts/plot/subplot.m @@ -150,6 +150,8 @@ eval (sprintf ("gset origin %g, %g", xo, yo)); + clearplot; + endif endfunction
--- a/scripts/plot/subwindow.m +++ b/scripts/plot/subwindow.m @@ -78,4 +78,6 @@ eval (sprintf ("gset origin %g, %g", xo, yo)); + clearplot; + endfunction
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,42 @@ +Fri Feb 20 00:41:06 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * pt-plot.cc (GPLOT_CMD_REPLOT): Clear before replot. + + * Makefile.in: Better handling of lib flags for linking. + +Thu Feb 19 21:14:30 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * pt-decl.cc (Vinitialize_global_values): New static variable. + (initialize_global_variables): New function. + (symbols_of_pt_decl): New function. + DEFVAR Vinitialize_global_values and initialize_global_variables. + (tree_global_command::do_init): If initialize_global_variables is + not true and the variable doesn't have an explicit initializer, don't + initialize it. If we are giving it a default value, use the value + of the variable defualt_global_variable_value. + * octave.cc (maximum_braindamage): Set default_global_variable_value + and initialize_global_variables to Matlab-compatible values. + +Wed Feb 18 04:35:31 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * DLD-FUNCTIONS/besselj.cc: Rename from bessel.cc. + * Makefile.in (DLD_XSRC): Likewise. + + * syscalls.cc (Fvfork): Delete. + + * oct-procbuf.cc: Just use fork. + + * parse.y (feval): Provide version that takes function name + separate from other args. + * parse.h: Declare it. + + * oct-procbuf.cc (octave_procbuf::open): Move declaration of + child_std_end outside of child scope and declare volatile. + +Mon Feb 16 15:04:28 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * parse.y: Include cstdio, for SEEK_SET. + Thu Feb 12 22:07:00 1998 John W. Eaton <jwe@bevo.che.wisc.edu> * system.c: New file.
--- a/src/Makefile.in +++ b/src/Makefile.in @@ -39,7 +39,7 @@ endif endif -DLD_XSRC := balance.cc bessel.cc betainc.cc chol.cc colloc.cc dassl.cc \ +DLD_XSRC := balance.cc besselj.cc betainc.cc chol.cc colloc.cc dassl.cc \ det.cc eig.cc expm.cc fft.cc fft2.cc filter.cc find.cc \ fsolve.cc gammainc.cc getgrent.cc getpwent.cc getrusage.cc \ givens.cc hess.cc ifft.cc ifft2.cc inv.cc log.cc lpsolve.cc \ @@ -167,11 +167,11 @@ VAR_1 := $(patsubst %.l, %, $(VAR_2)) VAR_FILES := $(patsubst %.cc, %, $(VAR_1)) -OCTAVE_LFLAGS = -L../liboctave -L../libcruft -L../glob \ - -L../dlfcn -L. $(RLD_FLAG) +OCTAVE_LFLAGS = -L$(TOPDIR)/liboctave -L$(TOPDIR)/libcruft \ + -L$(TOPDIR)/src $(RLD_FLAG) -OCTAVE_LIBS = -loctinterp -loctave $(SPECIAL_MATH_LIB) -lcruft $(LIBPLPLOT) \ - $(LIBREADLINE) ../kpathsea/libkpathsea.$(LIBEXT) -lglob $(LIBDLFCN) +OCTAVE_LIBS = $(LIBOCTINTERP) $(LIBOCTAVE) $(SPECIAL_MATH_LIB) $(LIBCRUFT) \ + $(LIBPLPLOT) $(LIBREADLINE) $(LIBKPATHSEA) $(LIBGLOB) $(LIBDLFCN) LIBS = @LIBS@
--- a/src/mappers.cc +++ b/src/mappers.cc @@ -27,6 +27,7 @@ #include <cctype> #include <cfloat> +#include "lo-specfun.h" #include "lo-mappers.h" #include "defun.h"
--- a/src/oct-procbuf.cc +++ b/src/oct-procbuf.cc @@ -55,6 +55,8 @@ int pipe_fds[2]; + volatile int child_std_end = (mode & ios::in) ? 1 : 0; + volatile int parent_end, child_end; if (is_open ()) @@ -74,21 +76,15 @@ child_end = pipe_fds[0]; } -#if defined HAVE_VFORK - proc_pid = vfork (); -#else - proc_pid = fork (); -#endif + proc_pid = ::fork (); if (proc_pid == 0) { - int child_std_end = (mode & ios::in) ? 1 : 0; - ::close (parent_end); if (child_end != child_std_end) { - dup2 (child_end, child_std_end); + ::dup2 (child_end, child_std_end); ::close (child_end); } @@ -153,7 +149,7 @@ do { - wait_pid = waitpid (proc_pid, &wstatus, 0); + wait_pid = ::waitpid (proc_pid, &wstatus, 0); } while (wait_pid == -1 && errno == EINTR);
--- a/src/octave.cc +++ b/src/octave.cc @@ -322,6 +322,7 @@ bind_builtin_variable ("PS2", ""); bind_builtin_variable ("beep_on_error", 1.0); bind_builtin_variable ("default_eval_print_flag", 0.0); + bind_builtin_variable ("default_global_variable_value", Matrix ()); bind_builtin_variable ("default_save_format", "mat-binary"); bind_builtin_variable ("define_all_return_values", 1.0); bind_builtin_variable ("do_fortran_indexing", 1.0); @@ -329,6 +330,7 @@ bind_builtin_variable ("fixed_point_format", 1.0); bind_builtin_variable ("implicit_num_to_str_ok", 1.0); bind_builtin_variable ("implicit_str_to_num_ok", 1.0); + bind_builtin_variable ("initialize_global_variables", 1.0); bind_builtin_variable ("ok_to_lose_imaginary_part", 1.0); bind_builtin_variable ("page_screen_output", 0.0); bind_builtin_variable ("prefer_column_vectors", 0.0);
--- a/src/ov-usr-fcn.cc +++ b/src/ov-usr-fcn.cc @@ -556,7 +556,7 @@ DEFVAR (default_return_value, Matrix (), 0, 0, "the default for value for unitialized variables returned from\n\ functions. Only used if the variable initialize_return_values is\n\ -set to \"true\"."); +nonzero."); DEFVAR (define_all_return_values, 0.0, 0, define_all_return_values, "control whether values returned from functions should have a\n\
--- a/src/parse.h +++ b/src/parse.h @@ -82,6 +82,9 @@ load_fcn_from_file (symbol_record *sym_rec, bool exec_script); extern octave_value_list +feval (const string& name, const octave_value_list& args, int nargout); + +extern octave_value_list feval (const octave_value_list& args, int nargout); extern octave_value_list
--- a/src/parse.y +++ b/src/parse.y @@ -31,6 +31,8 @@ #include <config.h> #endif +#include <cstdio> + #ifdef YYBYACC #include <cstdlib> #endif @@ -2913,31 +2915,47 @@ } octave_value_list +feval (const string& name, const octave_value_list& args, int nargout) +{ + octave_value_list retval; + + octave_function *fcn = is_valid_function (name, "feval", 1); + + if (fcn) + retval = fcn->do_index_op (nargout, args); + + return retval; +} + +octave_value_list feval (const octave_value_list& args, int nargout) { octave_value_list retval; - octave_function *fcn = is_valid_function (args(0), "feval", 1); - - if (fcn) + if (args.length () > 0) { - string_vector arg_names = args.name_tags (); - - int tmp_nargin = args.length () - 1; - - octave_value_list tmp_args (tmp_nargin, octave_value ()); - - string_vector tmp_arg_names (tmp_nargin); - - for (int i = 0; i < tmp_nargin; i++) + string name = args(0).string_value (); + + if (! error_state) { - tmp_args(i) = args(i+1); - tmp_arg_names(i) = arg_names(i+1); + string_vector arg_names = args.name_tags (); + + int tmp_nargin = args.length () - 1; + + octave_value_list tmp_args (tmp_nargin, octave_value ()); + + string_vector tmp_arg_names (tmp_nargin); + + for (int i = 0; i < tmp_nargin; i++) + { + tmp_args(i) = args(i+1); + tmp_arg_names(i) = arg_names(i+1); + } + + tmp_args.stash_name_tags (tmp_arg_names); + + retval = feval (name, tmp_args, nargout); } - - tmp_args.stash_name_tags (tmp_arg_names); - - retval = fcn->do_index_op (nargout, tmp_args); } return retval;
--- a/src/pt-decl.cc +++ b/src/pt-decl.cc @@ -28,6 +28,7 @@ #include <config.h> #endif +#include "defun.h" #include "error.h" #include "pt-cmd.h" #include "ov.h" @@ -36,6 +37,12 @@ #include "pt-exp.h" #include "pt-id.h" #include "pt-walk.h" +#include "utils.h" +#include "variables.h" + +// Control whether otherwise uninitialized global variables are +// given a default value. +static int Vinitialize_global_variables; // Declarations (global, static, etc.). @@ -97,12 +104,13 @@ octave_lvalue ult = id->lvalue (); - if (ult.is_undefined ()) + if (ult.is_undefined () && Vinitialize_global_variables) { tree_expression *expr = elt.expression (); octave_value init_val = expr - ? expr->rvalue () : octave_value (Matrix ()); + ? expr->rvalue () + : builtin_any_variable ("default_global_variable_value"); ult.assign (octave_value::asn_eq, init_val); } @@ -165,6 +173,27 @@ } } +static int +initialize_global_variables (void) +{ + Vinitialize_global_variables + = check_preference ("initialize_global_variables"); + + return 0; +} + +void +symbols_of_pt_decl (void) +{ + DEFVAR (default_global_variable_value, , 0, 0, + "the default for value for otherwise uninitialized global variables.\n\ +Only used if the variable initialize_global_variables is nonzero."); + + DEFVAR (initialize_global_variables, 0.0, 0, initialize_global_variables, + "control whether otherwise uninitialized global variables are\n\ +given a default value. See also default_global_variable_value"); +} + /* ;;; Local Variables: *** ;;; mode: C++ ***
--- a/src/pt-plot.cc +++ b/src/pt-plot.cc @@ -109,7 +109,7 @@ #endif #ifndef GPLOT_CMD_REPLOT -#define GPLOT_CMD_REPLOT "rep" +#define GPLOT_CMD_REPLOT "cle;rep" #endif #ifndef GPLOT_CMD_SPLOT
--- a/src/syscalls.cc +++ b/src/syscalls.cc @@ -285,37 +285,6 @@ return retval; } -DEFUN (vfork, args, , - "[PID, MSG] = vfork ()\n\ -\n\ -Create a copy of the current process.\n\ -\n\ -If successful, PID is either the process ID and you are in the parent,\n\ -or 0, and you are in the child. If PID is less than zero, an error\n\ -has occured, and MSG contains a system-dependent error message.") -{ - octave_value_list retval; - - retval(1) = string (); - retval(0) = -1.0; - - int nargin = args.length (); - - if (nargin == 0) - { - string msg; - - pid_t pid = octave_syscalls::vfork (msg); - - retval(0) = static_cast<double> (pid); - retval(1) = msg; - } - else - print_usage ("vfork"); - - return retval; -} - DEFUN (getpgrp, args, , "pgid = getpgrp (): return the process group id of the current process") {