Mercurial > hg > octave-lojdl
changeset 3174:390d5e396682
[project @ 1998-05-04 16:36:17 by jwe]
author | jwe |
---|---|
date | Mon, 04 May 1998 16:36:26 +0000 |
parents | eec9be0f7f5c |
children | 096940972434 |
files | ChangeLog NEWS PROJECTS aclocal.m4 configure.in kpathsea/ChangeLog kpathsea/Makefile.in kpathsea/acklibtool.m4 kpathsea/config.guess kpathsea/config.sub kpathsea/withenable.ac liboctave/ChangeLog liboctave/pathsearch.cc liboctave/pathsearch.h scripts/ChangeLog scripts/miscellaneous/flops.m scripts/strings/str2mat.m src/ChangeLog src/Makefile.in src/data.cc src/defaults.cc src/defaults.h.in src/dynamic-ld.cc src/lex.l src/oct-procbuf.cc src/oct-procbuf.h src/octave.gperf src/sighandlers.cc src/utils.cc src/utils.h src/version.h test/ChangeLog test/Makefile.in |
diffstat | 33 files changed, 323 insertions(+), 100 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +Tue Apr 28 14:28:14 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * aclocal.m4 (OCTAVE_FLIBS): Really do skip -lkernel32. + +Thu Apr 23 23:26:19 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * kpathsea: Update to version 3.2. + +Mon Apr 20 21:58:39 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * configure.in (dlfcn.h): Add check. + Sat Apr 18 20:15:37 1998 John W. Eaton <jwe@bevo.che.wisc.edu> * configure.in (USE_GNU_INFO): Delete everything related to this.
--- a/NEWS +++ b/NEWS @@ -1,9 +1,16 @@ Summary of changes for version 2.1.x: ------------------------------------ + * Running `make check' should work now before you run `make install', + even if you build a copy of Octave that depends on shared versions + of the Octave libraries. + * For matrices, x(:) now works no matter what the value of do_fortran_indexing is. + * New keywords __FILE__ and __LINE__ expand to the name of the file + that is being read and the current input line number, respectively. + * Octave's expression parser is more general and consistent. It is now possible to access structure elements and index arbitrary values. For example, expressions like @@ -177,7 +184,7 @@ prevent Octave from attempting infinite recursion. The default value is 256. - * Octave now uses readline version 2.1 and kpathsea 3.0. + * Octave now uses kpathsea 3.2. * New configure option, --enable-readline. @@ -204,6 +211,15 @@ * Octave no longer includes functions to work with NPSOL or QPSOL, because they are not free software. + * The new built-in variable called kluge_procbuf_delay specifies the + number of microseconds to delay in the parent process after + forking. By default on gnu-win32 systems, it's set to 500000 (1/2 + second). On other systems, the default value is 0. Delaying for + a short time in the parent after forking seems to avoid problems + in which communicating with subprocesses via pipes would sometimes + cause Octave to hang. I doubt that the delay is really the right + solution. If anyone has a better idea, I'd love to hear it. + Summary of changes for version 2.0.5: ------------------------------------
--- a/PROJECTS +++ b/PROJECTS @@ -16,6 +16,9 @@ Numerical: --------- + * Allow sum, prod, cumsum, and cumprod to take a second argument + that specifies the dimension over which to operate. + * Merge control stuff. * Improve logm, and sqrtm. @@ -276,9 +279,6 @@ is parsed as IF expr STRING END. - * Consider making x(:) work no matter what the value of - do_fortran_indexing. - * For indexing operations, allow `$' to indicate the last element. For example, b = a (3:$, 1:$-1). This means b is a, except for its first 2 rows and last column. Note that `$' must be able to @@ -318,18 +318,12 @@ * Allow `octave -c STRING' to execute commands from STRING then exit. - * Handle DOS style CRLFs in M files. This should probably be - optional. - * Make the interpreter run faster. * Make it possible to disable or enable all warnings on an individual basis from the command line or via some built-in structure variable. - * Warn about complex comparisons? Could just use double_value() or - matrix_value() instead of explicit conversions to real types. - * Make warnings also give some indication about the location of the code that triggers the warning. @@ -458,15 +452,12 @@ * Make the type command handle script files too, by just reading and printing them. - * The wich and type commands should distinguish between dynamically + * The which and type commands should distinguish between dynamically linked functions and built-in functions. For dynamically linked functions, the location of the .oct file should be displayed. * Clean up eye, eval, feval, keyboard, input, ones, zeros. - * Turn off printing when evaluating expressions in an eval() - statement, for compatibility with Matlab. - * It would be nice to have an interactive debugger. * Make whos report total memory used by variables (and functions?). @@ -521,8 +512,6 @@ Configuration and Installation: ------------------------------ - * Handle USE_READLINE so that --enable-readline will work. - * Make Octave as independent of the particular readline version as possible. @@ -536,8 +525,6 @@ * Should --enable-dl imply --enable-shared? - * Make it possible to configure without readline. - * Makefile changes: -- eliminate for loops -- define shell commands or eliminate them @@ -547,8 +534,6 @@ * Make it possible to configure so that installed binaries and shared libraries are stripped. - * Make installation of the static libraries optional. - * Create a docs-only distribution? ------------------------------
--- a/aclocal.m4 +++ b/aclocal.m4 @@ -207,6 +207,7 @@ -lkernel32) case "$canonical_host_type" in *-*-cygwin32) + arg= ;; *) lflags="$lflags $arg"
--- 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.303 $) +AC_REVISION($Revision: 1.304 $) AC_PREREQ(2.9) AC_INIT(src/octave.cc) AC_CONFIG_HEADER(config.h) @@ -675,7 +675,7 @@ AC_HEADER_TIME AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS(assert.h curses.h fcntl.h float.h floatingpoint.h \ +AC_CHECK_HEADERS(assert.h curses.h dlfcn.h fcntl.h float.h floatingpoint.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 \
--- a/kpathsea/ChangeLog +++ b/kpathsea/ChangeLog @@ -1,5 +1,8 @@ Thu Apr 23 15:08:40 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + * withenable.ac (texmfmain): Don't print warning if main temf + directory tree can't be found. + * version.c (kpse_bug_address): Change address as requested. * Makefile.in: Do acincludes by hand.
--- a/kpathsea/Makefile.in +++ b/kpathsea/Makefile.in @@ -342,8 +342,10 @@ check: kpsewhich ./kpsewhich -expand-var '$$TEXMF' -install: install-exec install-data -uninstall: uninstall-exec uninstall-data +#install: install-exec install-data +#uninstall: uninstall-exec uninstall-data + +install uninstall: install-exec: kpsewhich $(SHELL) $(top_srcdir)/../mkinstalldirs $(bindir) $(scriptdir) \
--- a/kpathsea/acklibtool.m4 +++ b/kpathsea/acklibtool.m4 @@ -1,5 +1,5 @@ dnl Autoconf support for Klibtool. -dnl $Id: acklibtool.m4,v 1.3 1998-04-24 04:24:35 jwe Exp $ +dnl $Id: acklibtool.m4,v 1.4 1998-05-04 16:36:19 jwe Exp $ dnl dnl dnl Find the script, check for subprogs, etc. @@ -43,7 +43,7 @@ # ## Finally: Run the klibtool configure command. LIBTOOL_OBJTYPES=$LIBTOOL_OBJTYPES RANLIB=$RANLIB \ - $LIBTOOL --source-dir $ac_aux_dir --config-dir .. configure "$host" + $LIBTOOL --source-dir $ac_aux_dir --config-dir . configure "$host" AC_MSG_RESULT($LIBTOOL_OBJTYPES) ])dnl dnl
--- a/kpathsea/config.guess +++ b/kpathsea/config.guess @@ -1,6 +1,6 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc. +# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -478,10 +478,10 @@ echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` exit 0 ;; i*:CYGWIN*:*) - echo i386-pc-cygwin32 + echo ${UNAME_MACHINE}-pc-cygwin32 exit 0 ;; i*:MINGW*:*) - echo i386-pc-mingw32 + echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin32 @@ -493,6 +493,12 @@ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; *:Linux:*:*) + # uname on the ARM produces all sorts of strangeness, and we need to + # filter it out. + case "$UNAME_MACHINE" in + arm* | sa110*) UNAME_MACHINE="arm" ;; + esac + # The BFD linker knows what the default object file format is, so # first see if it will tell us. ld_help_string=`ld --help 2>&1` @@ -506,6 +512,7 @@ i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;; i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;; sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;; esac
--- a/kpathsea/config.sub +++ b/kpathsea/config.sub @@ -1,6 +1,6 @@ #! /bin/sh # Configuration validation subroutine script, version 1.1. -# Copyright (C) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc. +# Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc. # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. @@ -162,7 +162,7 @@ # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. - i[3456]86) + i[34567]86) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. @@ -171,7 +171,7 @@ exit 1 ;; # Recognize the basic CPU types with company name. - vax-* | tahoe-* | i[3456]86-* | i860-* | m32r-* | m68k-* | m68000-* \ + vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \ | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \ @@ -350,19 +350,19 @@ os=-mvs ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? - i[3456]86v32) + i[34567]86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; - i[3456]86v4*) + i[34567]86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; - i[3456]86v) + i[34567]86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; - i[3456]86sol2) + i[34567]86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; @@ -469,25 +469,23 @@ pc532 | pc532-*) basic_machine=ns32k-pc532 ;; - pentium | p5) - basic_machine=i586-intel + pentium | p5 | k5 | nexen) + basic_machine=i586-pc ;; - pentiumpro | p6) - basic_machine=i686-intel + pentiumpro | p6 | k6 | 6x86) + basic_machine=i686-pc ;; - pentium-* | p5-*) + pentiumii | pentium2) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | nexen-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - pentiumpro-* | p6-*) + pentiumpro-* | p6-* | k6-* | 6x86-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - k5) - # We don't have specific support for AMD's K5 yet, so just call it a Pentium - basic_machine=i586-amd - ;; - nexen) - # We don't have specific support for Nexgen yet, so just call it a Pentium - basic_machine=i586-nexgen + pentiumii-* | pentium2-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould
--- a/kpathsea/withenable.ac +++ b/kpathsea/withenable.ac @@ -71,11 +71,13 @@ AC_MSG_RESULT("$texmfmain") else AC_MSG_RESULT([not found]) - AC_MSG_WARN([The main texmf tree was not found. - Specify the location of its parent directory with the --datadir option. - If you do not have the files, you can retrieve a minimal set from - ftp://ftp.tug.org/tex/texmflib.tar.gz, which is mirrored on CTAN hosts - in systems/web2c. Winging it by using the default location.]) - texmfmain="$datadir/texmf" +dnl Octave doesn't need this, so don't worry users if it can't be found. +dnl +dnl AC_MSG_WARN([The main texmf tree was not found. +dnl Specify the location of its parent directory with the --datadir option. +dnl If you do not have the files, you can retrieve a minimal set from +dnl ftp://ftp.tug.org/tex/texmflib.tar.gz, which is mirrored on CTAN hosts +dnl in systems/web2c. Winging it by using the default location.]) +dnl texmfmain="$datadir/texmf" fi AC_SUBST(texmfmain)
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,10 @@ +Thu Apr 23 16:15:37 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * pathsearch.h (dir_path::p_orig): New field. + * pathsearch.cc (dir_path::init): Perform variable and tilde + expansion on the original path here. + (dir_path::find_all): Don't do anything if not initialized. + Tue Apr 14 14:41:30 1998 John W. Eaton <jwe@bevo.che.wisc.edu> * Array2-idx.h (index): Allow x(:) even when do_fortran_indexing
--- a/liboctave/pathsearch.cc +++ b/liboctave/pathsearch.cc @@ -47,7 +47,7 @@ #undef string } -bool dir_path::kpathsea_debug_initialized = false; +static bool octave_kpathsea_initialized = false; string_vector dir_path::elements (void) @@ -119,43 +119,55 @@ { string_vector retval; - kpse_string *tmp = kpse_all_path_search (p.c_str (), nm.c_str ()); - - if (tmp) + if (initialized) { - int count = 0; - kpse_string *ptr = tmp; - while (*ptr++) - count++; + kpse_string *tmp = kpse_all_path_search (p.c_str (), nm.c_str ()); - retval.resize (count); + if (tmp) + { + int count = 0; + kpse_string *ptr = tmp; + while (*ptr++) + count++; - for (int i = 0; i < count; i++) - retval[i] = tmp[i]; + retval.resize (count); + + for (int i = 0; i < count; i++) + retval[i] = tmp[i]; + } } return retval; } void -dir_path::set_program_name (const char *nm) +dir_path::set_program_name (const string& nm) { - kpse_set_progname (nm); + kpse_set_progname (nm.c_str ()); } void dir_path::init (void) { - initialized = false; - - if (! kpathsea_debug_initialized) + if (! octave_kpathsea_initialized) { char *s = getenv ("KPATHSEA_DEBUG"); if (s) kpathsea_debug |= atoi (s); + + octave_kpathsea_initialized = true; } + char *tmp = kpse_path_expand (p_orig.c_str ()); + if (tmp) + { + p = tmp; + free (tmp); + } + else + p = string (); + int count = 0; char *path_elt = kpse_path_element (p.c_str ()); while (path_elt)
--- a/liboctave/pathsearch.h +++ b/liboctave/pathsearch.h @@ -32,19 +32,22 @@ { public: - dir_path (const string& s = string ()) : p (s), initialized (false) + dir_path (const string& s = string ()) + : p_orig (s), initialized (false) { - if (! p.empty ()) + if (! p_orig.empty ()) init (); } dir_path (const dir_path& dp) - : p (dp.p), initialized (dp.initialized), pv (dp.pv) { } + : p_orig (dp.p_orig), initialized (dp.initialized), p (dp.p), pv (dp.pv) + { } dir_path& operator = (const dir_path& dp) { + p_orig = dp.p_orig; + initialized = dp.initialized; p = dp.p; - initialized = dp.initialized; pv = dp.pv; return *this; } @@ -54,7 +57,7 @@ void set (const string& s) { initialized = false; - p = s; + p_orig = s; init (); } @@ -66,22 +69,23 @@ string_vector find_all (const string&); - static void set_program_name (const char *); + static void set_program_name (const string&); private: - // The colon separated list. - string p; + // The colon separated list that we were given. + string p_orig; // TRUE means we've unpacked p. bool initialized; + // A version of the colon separate list on which we have performed + // tilde and variable expansion. + string p; + // The elements of the list. string_vector pv; - // TRUE means we've set the global value of kpathsea_debug. - static bool kpathsea_debug_initialized; - void init (void); };
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,16 @@ +Wed Apr 22 12:11:27 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * miscellaneous/flops.m: Allow a single argument too. + +Tue Apr 21 10:18:20 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * strings/str2mat.m: Also handle case when there are no empty + strings correctly. + +Mon Apr 20 22:14:15 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * strings/isletter.m: New function, for Matlab compatibility. + Fri Apr 17 10:53:39 1998 John W. Eaton <jwe@bevo.che.wisc.edu> * strings/str2mat.m: Handle string matrices too.
--- a/scripts/miscellaneous/flops.m +++ b/scripts/miscellaneous/flops.m @@ -25,8 +25,8 @@ function retval = flops () - if (nargin > 0) - usage ("flops ()"); + if (nargin > 1) + usage ("flops () or flops (n)"); endif warning ("flops is a flop, always returning zero");
--- a/scripts/strings/str2mat.m +++ b/scripts/strings/str2mat.m @@ -47,7 +47,12 @@ endif endfor - nr(find (nr == 0)) = 1; + tmp = find (nr == 0); + + if (! isempty (tmp)) + nr(tmp) = 1; + endif + retval_nr = sum (nr); retval_nc = max (nc);
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,42 @@ +Sun May 3 19:54:38 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * lex.l (reset_parser): Also call yyrestart if forced_interactive + is true, but not if input_from_startup_file is true. + +Tue Apr 28 14:06:20 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * oct-procbuf.cc (Vkluge_procbuf_delay): New static variable. + (kluge_procbuf_delay): New function. + (symbols_of_oct_procbuf): New function. + (octave_procbuf::open): Delay Vkluge_procbuf_delay microseconds + after forking. + +Thu Apr 23 15:41:08 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * defaults.cc (Vload_path_dir_path): New variable. + * utils.cc (file_in_path): Use it. + + * utils.cc (search_path_for_file): Undo previous change. + (file_in_path): Undo previous change. + * defaults.cc (loadpath): Undo previous change. Tilde expansion + is once again handled correctly by the code in + liboctave/pathsearch.cc. + +Mon Apr 20 21:50:34 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * data.cc (get_dimensions): Allow zeros ([], 3) to work, for + compatibility with Matlab. + + * dynamic-ld.cc [WITH_DL && ! HAVE_DLFCN_H]: Add declarations for + dlopen, dlerror, dlsym, and dlclose. + + * octave.gperf: Handle __FILE__ and __LINE__. + * lex.l (is_keyword): Likewise. + * Makefile.in (oct-gperf.h): Pass -D option to gperf. + Postprocess output of gperf to convert name of static variable + from lookup to gperf_lookup, to avoid conflict with our function + of the same name defined in variables.cc. + Sat Apr 18 20:17:10 1998 John W. Eaton <jwe@bevo.che.wisc.edu> * help.cc (USE_GNU_INFO): Delete uses of this macro.
--- a/src/Makefile.in +++ b/src/Makefile.in @@ -417,8 +417,8 @@ oct-gperf.h: octave.gperf @echo "making $@ from $<" - @gperf -a -C -E -G -H octave_kw_hash -g -N octave_kw_lookup -p -t \ - $< > $@.t + @gperf -a -C -D -E -G -H octave_kw_hash -g -N octave_kw_lookup -p -t \ + $< | sed 's,lookup\[,gperf_lookup[,' > $@.t @$(top_srcdir)/move-if-change $@.t $@ check: all
--- a/src/data.cc +++ b/src/data.cc @@ -864,8 +864,8 @@ get_dimensions (const octave_value& a, const octave_value& b, const char *warn_for, int& nr, int& nc) { - nr = NINT (a.double_value ()); - nc = NINT (b.double_value ()); + nr = (a.is_empty ()) ? 0 : NINT (a.double_value ()); + nc = (b.is_empty ()) ? 0 : NINT (b.double_value ()); if (error_state) error ("%s: expecting two scalar arguments", warn_for);
--- a/src/defaults.cc +++ b/src/defaults.cc @@ -38,6 +38,7 @@ #endif #include "oct-env.h" +#include "pathsearch.h" #include <defaults.h> #include "defun.h" @@ -68,6 +69,9 @@ // (--path path; -p path) string Vload_path; +// And the cached directory path corresponding to Vload_path. +dir_path Vload_path_dir_path; + // Name of the editor to be invoked by the edit_history command. string Veditor; @@ -181,6 +185,8 @@ string oct_path = octave_env::getenv ("OCTAVE_PATH"); Vload_path = oct_path.empty () ? std_path : oct_path; + + Vload_path_dir_path = dir_path (Vload_path); } static void @@ -390,7 +396,11 @@ status = -1; } else - Vload_path = file_ops::tilde_expand (maybe_add_default_load_path (s)); + { + Vload_path = maybe_add_default_load_path (s); + + Vload_path_dir_path = dir_path (Vload_path); + } return status; }
--- a/src/defaults.h.in +++ b/src/defaults.h.in @@ -26,6 +26,8 @@ #include <string> +#include "pathsearch.h" + #ifndef DEFAULT_PAGER #define DEFAULT_PAGER %DEFAULT_PAGER% #endif @@ -132,6 +134,9 @@ // (--path path; -p path) extern string Vload_path; +// And the cached directory path corresponding to Vload_path. +extern dir_path Vload_path_dir_path; + // Name of the editor to be invoked by the edit_history command. extern string Veditor;
--- a/src/dynamic-ld.cc +++ b/src/dynamic-ld.cc @@ -36,6 +36,11 @@ #if defined (WITH_DL) #if defined (HAVE_DLFCN_H) #include <dlfcn.h> +#else +extern void *dlopen (const char *, int); +extern const char *dlerror (void); +extern void *dlsym (void *, const char *); +extern int dlclose (void *); #endif #ifndef RTLD_LAZY #define RTLD_LAZY 1
--- a/src/lex.l +++ b/src/lex.l @@ -704,7 +704,9 @@ // Only ask for input from stdin if we are expecting interactive // input. - if (interactive && ! (reading_fcn_file || get_input_from_eval_string)) + if ((interactive || forced_interactive) + && ! (reading_fcn_file || get_input_from_eval_string + || input_from_startup_file)) yyrestart (stdin); // Clear the buffer for help text. @@ -1057,6 +1059,20 @@ } break; + case magic_file_kw: + { + if ((reading_fcn_file || reading_script_file) + && ! curr_fcn_file_full_name.empty ()) + yylval.tok_val = new token (curr_fcn_file_full_name, l, c); + else + yylval.tok_val = new token ("stdin", l, c); + } + break; + + case magic_line_kw: + yylval.tok_val = new token (static_cast<double> (l), "", l, c); + break; + default: panic_impossible (); }
--- a/src/oct-procbuf.cc +++ b/src/oct-procbuf.cc @@ -35,9 +35,21 @@ #include <unistd.h> #endif +#include "lo-mappers.h" +#include "lo-utils.h" #include "oct-procbuf.h" #include "syswait.h" +#include "defun.h" +#include "gripes.h" + +// Number of microseconds to delay in the parent after forking. +#if defined (__CYGWIN32__) +static int Vkluge_procbuf_delay = 500000; +#else +static int Vkluge_procbuf_delay = 0; +#endif + // This class is based on the procbuf class from libg++, written by // Per Bothner, Copyright (C) 1993 Free Software Foundation. // @@ -99,6 +111,14 @@ exit (127); } +#if defined (HAVE_USLEEP) + if (Vkluge_procbuf_delay > 0) + usleep (Vkluge_procbuf_delay); +#else + if (Vkluge_procbuf_delay > 499999) + sleep ((Vkluge_procbuf_delay + 500000) / 1000000); +#endif + ::close (child_end); if (proc_pid < 0) @@ -165,6 +185,31 @@ #endif } +static int +kluge_procbuf_delay (void) +{ + double val; + if (builtin_real_scalar_variable ("kluge_procbuf_delay", val) + && ! xisnan (val)) + { + int ival = NINT (val); + if (ival >= 0 && (double) ival == val) + { + Vkluge_procbuf_delay = ival; + return 0; + } + } + gripe_invalid_value_specified ("kluge_procbuf_delay"); + return -1; +} + +static void +symbols_of_oct_procbuf (void) +{ + DEFVAR (kluge_procbuf_delay, Vkluge_procbuf_delay, 0, kluge_procbuf_delay, + "number of microseconds to delay in the parent after forking"); +} + /* ;;; Local Variables: *** ;;; mode: C++ ***
--- a/src/oct-procbuf.h +++ b/src/oct-procbuf.h @@ -61,6 +61,8 @@ octave_procbuf *next; }; +extern void symbols_of_oct_procbuf (void); + #endif /*
--- a/src/octave.gperf +++ b/src/octave.gperf @@ -23,6 +23,8 @@ gplot_kw, gsplot_kw, if_kw, + magic_file_kw, + magic_line_kw, otherwise_kw, replot_kw, return_kw, @@ -67,3 +69,5 @@ unwind_protect, UNWIND, unwind_protect_kw unwind_protect_cleanup, CLEANUP, unwind_protect_cleanup_kw while, WHILE, while_kw +__FILE__, TEXT, magic_file_kw +__LINE__, NUM, magic_line_kw
--- a/src/sighandlers.cc +++ b/src/sighandlers.cc @@ -391,6 +391,9 @@ octave_set_signal_handler (SIGCHLD, sigchld_handler); #endif + // SIGCLD + // SIGCONT + #ifdef SIGEMT octave_set_signal_handler (SIGEMT, generic_sig_handler); #endif @@ -411,6 +414,9 @@ octave_set_signal_handler (SIGILL, generic_sig_handler); #endif + // SIGINFO + // SIGINT + #ifdef SIGIOT octave_set_signal_handler (SIGIOT, generic_sig_handler); #endif @@ -431,6 +437,8 @@ octave_set_signal_handler (SIGPROF, generic_sig_handler); #endif + // SIGPWR + #ifdef SIGQUIT octave_set_signal_handler (SIGQUIT, generic_sig_handler); #endif @@ -439,6 +447,8 @@ octave_set_signal_handler (SIGSEGV, generic_sig_handler); #endif + // SIGSTOP + #ifdef SIGSYS octave_set_signal_handler (SIGSYS, generic_sig_handler); #endif @@ -451,6 +461,11 @@ octave_set_signal_handler (SIGTRAP, generic_sig_handler); #endif + // SIGTSTP + // SIGTTIN + // SIGTTOU + // SIGURG + #ifdef SIGUSR1 octave_set_signal_handler (SIGUSR1, generic_sig_handler); #endif @@ -467,6 +482,8 @@ octave_set_signal_handler (SIGIO, SIG_IGN); #endif + // SIGWINCH + #ifdef SIGXCPU octave_set_signal_handler (SIGXCPU, generic_sig_handler); #endif
--- a/src/utils.cc +++ b/src/utils.cc @@ -228,12 +228,9 @@ // See if the given file is in the path. string -search_path_for_file (const string& path, const string& name, - bool do_tilde_expansion) +search_path_for_file (const string& path, const string& name) { - string tmp_path = do_tilde_expansion ? file_ops::tilde_expand (path) : path; - - dir_path p (tmp_path); + dir_path p (path); return octave_env::make_absolute (p.find (name), octave_env::getcwd ()); } @@ -275,7 +272,8 @@ if (! suffix.empty ()) nm.append (suffix); - return search_path_for_file (Vload_path, nm, false); + return octave_env::make_absolute (Vload_path_dir_path.find (nm), + octave_env::getcwd ()); } // See if there is an function file in the path. If so, return the
--- a/src/utils.h +++ b/src/utils.h @@ -33,7 +33,7 @@ class octave_value_list; class string_vector; -extern string search_path_for_file (const string&, const string&, bool = true); +extern string search_path_for_file (const string&, const string&); extern string file_in_path (const string&, const string&); extern string fcn_file_in_path (const string&); extern string oct_file_in_path (const string&);
--- a/src/version.h +++ b/src/version.h @@ -23,7 +23,7 @@ #if !defined (octave_version_h) #define octave_version_h 1 -#define OCTAVE_VERSION "2.1.5" +#define OCTAVE_VERSION "2.1.6" #define OCTAVE_COPYRIGHT \ "Copyright (C) 1996, 1997, 1998 John W. Eaton."
--- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +Thu Apr 23 01:45:16 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * Makefile.in: If $(SHARED_LIBS), set LD_LIBRARY_PATH for running + Octave before installation is complete. + Wed Apr 15 15:23:43 1998 John W. Eaton <jwe@bevo.che.wisc.edu> * octave.test/index/dfi-f/m-2.m, octave.test/index/dfi-f/index.exp:
--- a/test/Makefile.in +++ b/test/Makefile.in @@ -24,6 +24,16 @@ OCTAVE_SCRIPT_PATH = .:$(TOPDIR)/src//:$(srcdir)/../scripts// +ifeq ($(SHARED_LIBS), true) + OCTAVE_LD_LIBRARY_PATH = `pwd`/../src:`pwd`/../liboctave:`pwd`/../libcruft + ifneq ($(LD_LIBRARY_PATH),) + XLD_LIBRARY_PATH = $(OCTAVE_LD_LIBRARY_PATH) + else + XLD_LIBRARY_PATH = $(OCTAVE_LD_LIBRARY_PATH):$(LD_LIBRARY_PATH) + endif + SET_LD_LIBRARY_PATH = LD_LIBRARY_PATH="$(XLD_LIBRARY_PATH)" +endif + # Complete directory trees to distribute. DISTDIRS = config octave.test @@ -32,7 +42,7 @@ check: @if test -n "$(RUNTEST)"; then \ - $(RUNTEST) \ + $(SET_LD_LIBRARY_PATH) $(RUNTEST) \ OCTAVE="$(OCTAVE_BINARY)" \ OCTAVE_SCRIPT_PATH="$(OCTAVE_SCRIPT_PATH)" \ --tool octave --srcdir $(srcdir) $(RUNTEST_FLAGS); \