Mercurial > hg > octave-avbm
changeset 3141:292ff0bf484b
[project @ 1998-02-03 08:11:07 by jwe]
author | jwe |
---|---|
date | Tue, 03 Feb 1998 08:11:22 +0000 |
parents | 990ea337e950 |
children | b06bffc95051 |
files | ChangeLog Makeconf.in PROJECTS aclocal.m4 configure.in doc/interpreter/matrix.texi install-octave libcruft/ChangeLog libcruft/Makefile.in libcruft/slatec-fn/Makefile liboctave/ChangeLog liboctave/Makefile.in liboctave/file-stat.cc octave-bug.in scripts/ChangeLog scripts/Makefile.in scripts/linear-algebra/orth.m scripts/miscellaneous/bug_report.m src/ChangeLog src/Makefile.in src/data.cc src/defaults.cc src/defaults.h.in src/defun.h src/error.cc src/file-io.cc src/help.cc src/octave.cc src/syscalls.cc src/toplev.cc src/version.h test/octave.test/system/pwd-2.m |
diffstat | 32 files changed, 368 insertions(+), 245 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Tue Feb 3 00:24:01 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * Makeconf.in (do-subst-vals): Substitute $(libexecdir) too. + +Mon Feb 2 22:42:27 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * configure.in: Define octlibdir. + * Makeconf.in: Substitute value. + (do-subst-config-vals): Set LIBDIR to $(octlibdir). + (do-subst-default-vals): Substitute OCTLIBDIR too. + Sat Jan 31 19:29:56 1998 John W. Eaton <jwe@bevo.che.wisc.edu> * acconfig.h: Add #undefs for HAVE_GAMMA and HAVE_LGAMMA to avoid
--- a/Makeconf.in +++ b/Makeconf.in @@ -160,10 +160,11 @@ # and ${localfcnfiledir} are subdirectories of this. datadir = @datadir@ +libdir = @libdir@ + # Where to install and expect libraries like libcruft.a, liboctave.a, -# and libreadline.a and other architecture-dependent data. The -# directory ${archlibdir} is a subdirectory of this. -libdir = @libdir@ +# and other architecture-dependent data. +octlibdir = @octlibdir@ # Where to install and expect executable programs to be run by Octave # rather than directly by users. @@ -326,7 +327,7 @@ -e "s;%LDFLAGS%;\"${LDFLAGS}\";" \ -e "s;%LEXLIB%;\"${LEXLIB}\";" \ -e "s;%LIBDLFCN%;\"${LIBDLFCN}\";" \ - -e "s;%LIBFLAGS%;\"-L${libdir}\";" \ + -e "s;%LIBFLAGS%;\"-L${octlibdir}\";" \ -e "s;%LIBPLPLOT%;\"${LIBPLPLOT}\";" \ -e "s;%LIBS%;\"${LIBS}\";" \ -e "s;%RLD_FLAG%;\"${RLD_FLAG}\";" \ @@ -349,6 +350,7 @@ -e "s;%OCTAVE_ARCHLIBDIR%;\"${archlibdir}\";" \ -e "s;%OCTAVE_BINDIR%;\"${bindir}\";" \ -e "s;%OCTAVE_DATADIR%;\"${datadir}\";" \ + -e "s;%OCTAVE_LIBEXECDIR%;\"${libexecdir}\";" \ -e "s;%OCTAVE_EXEC_PREFIX%;\"${exec_prefix}\";" \ -e "s;%OCTAVE_FCNFILEDIR%;\"${fcnfiledir}\";" \ -e "s;%OCTAVE_FCNFILEPATH%;\"${fcnfilepath}\";" \ @@ -356,6 +358,7 @@ -e "s;%OCTAVE_INFODIR%;\"${infodir}\";" \ -e "s;%OCTAVE_INFOFILE%;\"${infofile}\";" \ -e "s;%OCTAVE_LIBDIR%;\"${libdir}\";" \ + -e "s;%OCTAVE_OCTLIBDIR%;\"${octlibdir}\";" \ -e "s;%OCTAVE_LOCALARCHLIBDIR%;\"${localarchlibdir}\";" \ -e "s;%OCTAVE_LOCALFCNFILEDIR%;\"${localfcnfiledir}\";" \ -e "s;%OCTAVE_LOCALFCNFILEPATH%;\"${localfcnfilepath}\";" \ @@ -382,3 +385,20 @@ $(LN_S) $$src octave; \ fi endef + +# Make a relative symbolic link from $libdir/octave to $octlibdir. + +# XXX FIXME XXX -- this assumes that $octlibdir is a subdirectory +# of $libdir. + +define mk-libdir-link +src=`echo $(octlibdir) | sed 's|^$(libdir)/*||'` ; \ +echo $$src ; \ +if [ "$$src" = "octave" ] ; then \ + true ; \ +else \ + cd $(libdir) ; \ + rm -f octave ; \ + $(LN_S) $$src octave ; \ +fi +endef
--- a/PROJECTS +++ b/PROJECTS @@ -106,6 +106,10 @@ other faster method.d Possibly just switch to this method if the dataset is larger than some value. + * Make QR more memory efficient for large matrices when not all the + columns of Q are required (apparently this is not handled by the + lapack code yet). + * Consider making the behavior of the / and \ operators for non-square systems compatible with Matlab.
--- a/aclocal.m4 +++ b/aclocal.m4 @@ -83,6 +83,8 @@ f77_output=`$F77 -v 2>&1 | grep "GNU F77"` if test -n "$f77_output"; then octave_cv_f77_is_g77=yes + else + octave_cv_f77_is_g77=no fi 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.295 $) +AC_REVISION($Revision: 1.296 $) AC_PREREQ(2.9) AC_INIT(src/octave.cc) AC_CONFIG_HEADER(config.h) @@ -39,6 +39,7 @@ OCTAVE_SET_DEFAULT(fcnfiledir, '$(datadir)/octave/$(version)/m') OCTAVE_SET_DEFAULT(localfcnfiledir, '$(datadir)/octave/site/m') OCTAVE_SET_DEFAULT(localfcnfilepath, '$(localfcnfiledir)//') +OCTAVE_SET_DEFAULT(octlibdir, '$(libdir)/octave-$(version)') OCTAVE_SET_DEFAULT(archlibdir, '$(libexecdir)/octave/$(version)/exec/$(canonical_host_type)') OCTAVE_SET_DEFAULT(localarchlibdir,
--- a/doc/interpreter/matrix.texi +++ b/doc/interpreter/matrix.texi @@ -653,18 +653,6 @@ The following functions return famous matrix forms. -@deftypefn {Function File} {} hadamard (@var{k}) -Return the Hadamard matrix of order -@iftex -@tex -$n = 2^k$. -@end tex -@end iftex -@ifinfo -n = 2^k. -@end ifinfo -@end deftypefn - @deftypefn {Function File} {} hankel (@var{c}, @var{r}) Return the Hankel matrix constructed given the first column @var{c}, and (optionally) the last row @var{r}. If the last element of @var{c} is @@ -725,6 +713,18 @@ finite precision of your computer's floating point arithmetic. @end deftypefn +@deftypefn {Function File} {} sylvester_matrix (@var{k}) +Return the Sylvester matrix of order +@iftex +@tex +$n = 2^k$. +@end tex +@end iftex +@ifinfo +n = 2^k. +@end ifinfo +@end deftypefn + @deftypefn {Function File} {} toeplitz (@var{c}, @var{r}) Return the Toeplitz matrix constructed given the first column @var{c}, and (optionally) the first row @var{r}. If the first element of @var{c}
--- a/install-octave +++ b/install-octave @@ -76,19 +76,20 @@ # and ${localfcnfiledir} are subdirectories of this. datadir="$prefix/share" -# Where to install and expect libraries like libcruft.a, liboctave.a, -# and libreadline.a, executable files to be run by Octave rather than -# directly by users, and other architecture-dependent data. -# ${archlibdir} is a subdirectory of this. libdir="$exec_prefix/lib" +# Where to install and expect libraries like libcruft.a and liboctave.a. +octlibdir="$libdir/octave-$version" + # Where to install and expect executable programs to be run by Octave # rather than directly by users. libexecdir="$exec_prefix/libexec" +includedir="$prefix/include" + # Where to install Octave's include files. The default is -# ${prefix}/include/octave -includedir="$prefix/include" +# ${prefix}/include/octave-$version +octincludedir=$includedir/octave-$version # Where to install Octave's man pages, and what extension they should # have. The default is ${prefix}/man/man1 @@ -159,7 +160,9 @@ bindir: `echo $bindir | sed "s,^$prefix/,,"` datadir: `echo $datadir | sed "s,^$prefix/,,"` libdir: `echo $libdir | sed "s,^$prefix/,,"` + octlibdir: `echo $octlibdir | sed "s,^$prefix/,,"` includedir: `echo $includedir | sed "s,^$prefix/,,"` + octincludedir: `echo $octincludedir | sed "s,^$prefix/,,"` mandir: `echo $mandir | sed "s,^$prefix/,,"` infodir: `echo $infodir | sed "s,^$prefix/,,"` fcnfiledir: `echo $fcnfiledir | sed "s,^$prefix/,,"` @@ -184,8 +187,9 @@ ;; esac -DIRS_TO_MAKE="$bindir $datadir $libdir $libexecdir $includedir $mandir \ - $infodir $fcnfiledir $localfcnfiledir $archlibdir $localarchlibdir \ +DIRS_TO_MAKE="$bindir $datadir $libdir $octlibdir $libexecdir \ + $includedir $octincludedir $mandir $infodir $fcnfiledir \ + $localfcnfiledir $archlibdir $localarchlibdir \ $octfiledir $localoctfiledir $imagedir" ./mkinstalldirs $DIRS_TO_MAKE @@ -197,7 +201,7 @@ chmod 755 $bindir/octave else echo "installing octave-sh as $bindir/octave" - sed "s|@OCTAVE_HOME@|$prefix|; s|@LD_LIBRARY_PATH@|$libdir|" octave-sh \ + sed "s|@OCTAVE_HOME@|$prefix|; s|@LD_LIBRARY_PATH@|$octlibdir|" octave-sh \ > $bindir/octave chmod 755 $bindir/octave @@ -210,13 +214,17 @@ cp octave-bug $bindir/octave-bug chmod 755 $bindir/octave-bug +echo "installing info as $archlibdir/info" +cp info/info $archlibdir/info +chmod 755 $archlibdir/info + if test -f LIBRARIES; then - echo "installing shared libraries in $libdir" + echo "installing shared libraries in $octlibdir" for f in `cat LIBRARIES` do file=`basename $f` - cp $f $libdir/$file - chmod 644 $libdir/$file + cp $f $octlibdir/$file + chmod 644 $octlibdir/$file done fi @@ -260,7 +268,10 @@ cd $distdir echo "creating ls-R file in $datadir/octave" -ls -LR $datadir/octave $libexecdir/octave > $datadir/octave/ls-R +ls -LR $datadir/octave > $datadir/octave/ls-R + +echo "creating ls-R file in $libexecdir/octave" +ls -LR $libexecdir/octave > $libexecdir/octave/ls-R echo "installing info files in $infodir" for f in doc/interpreter/octave.info*
--- a/libcruft/ChangeLog +++ b/libcruft/ChangeLog @@ -1,5 +1,8 @@ Sun Feb 1 12:39:10 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + * Makefile.in (install, uninstall): Use $(octlibdir), not $(libdir). + Use $(mk-libdir-link). + * quadpack/dqagi.f, quadpack/dqagie.f, quadpack/dqagp.f, quadpack/dqagpe.f, quadpack/dqk15i.f, quadpack/dqk21.f: Make user-supplied code a subroutine instead of a function.
--- a/libcruft/Makefile.in +++ b/libcruft/Makefile.in @@ -90,28 +90,30 @@ @$(subdir-for-command) install:: - $(top_srcdir)/mkinstalldirs $(libdir) + $(top_srcdir)/mkinstalldirs $(octlibdir) if $(STATIC_LIBS); then \ - rm -f $(libdir)/libcruft.$(LIBEXT) ; \ - $(INSTALL_DATA) libcruft.$(LIBEXT) $(libdir)/libcruft.$(LIBEXT) ; \ - $(RANLIB) $(libdir)/libcruft.$(LIBEXT) ; \ + rm -f $(octlibdir)/libcruft.$(LIBEXT) ; \ + $(INSTALL_DATA) libcruft.$(LIBEXT) \ + $(octlibdir)/libcruft.$(LIBEXT) ; \ + $(RANLIB) $(octlibdir)/libcruft.$(LIBEXT) ; \ fi if $(SHARED_LIBS); then \ - rm -f $(libdir)/libcruft.$(SHLEXT_VER); \ + rm -f $(octlibdir)/libcruft.$(SHLEXT_VER); \ $(INSTALL_PROGRAM) \ - libcruft.$(SHLEXT_VER) $(libdir)/libcruft.$(SHLEXT_VER); \ - cd $(libdir); \ + libcruft.$(SHLEXT_VER) $(octlibdir)/libcruft.$(SHLEXT_VER); \ + cd $(octlibdir); \ rm -f libcruft.$(SHLEXT); \ $(LN_S) libcruft.$(SHLEXT_VER) libcruft.$(SHLEXT); \ fi + $(mk-libdir-link) install-strip:: $(MAKE) INSTALL_PROGRAM="$(INSTALL_PROGRAM) -s" install uninstall:: - rm -f $(libdir)/libcruft.$(LIBEXT) - rm -f $(libdir)/libcruft.$(SHLEXT) - rm -f $(libdir)/libcruft.$(SHLEXT_VER) + rm -f $(octlibdir)/libcruft.$(LIBEXT) + rm -f $(octlibdir)/libcruft.$(SHLEXT) + rm -f $(octlibdir)/libcruft.$(SHLEXT_VER) tags TAGS:: $(SOURCES) $(SUBDIR_FOR_COMMAND)
deleted file mode 100644 --- a/libcruft/slatec-fn/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# Generated automatically from Makefile.in by configure. -# -# Makefile for octave's libcruft/slatec-fn directory -# -# John W. Eaton -# jwe@bevo.che.wisc.edu -# University of Wisconsin-Madison -# Department of Chemical Engineering - -TOPDIR = ../.. - -srcdir = . -top_srcdir = ../.. - -EXTERNAL_DISTFILES = $(DISTFILES) - -include $(TOPDIR)/Makeconf - -include ../Makerules
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,15 @@ +Mon Feb 2 01:42:56 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * Makefile.in (install, uninstall): Use $(octlibdir), not $(libdir). + Use $(mk-libdir-link). + + * file-stat.cc (file_stat::update_internal): Use stat and lstat, + not SAFE_STAT and SAFE_LSTAT. + (lstat): New function, defined if HAVE_LSTAT is not defined. + * safe-xstat.hin, safe-xstat.cin: Delete. + * Makefile.in: Delete rules for safe-stat.h, safe-stat.c, + safe-lstat.h, and safe-lstat.cc. + Fri Jan 30 23:48:43 1998 John W. Eaton <jwe@bevo.che.wisc.edu> * chMatrix.cc (charMatrix::all, charMatrix::any): New functions.
--- a/liboctave/Makefile.in +++ b/liboctave/Makefile.in @@ -93,8 +93,7 @@ INCLUDES_FOR_INSTALL := $(INCLUDES) $(TEMPLATE_SRC) $(EXTRAS) -DISTFILES := Makefile.in ChangeLog safe-xstat.cin safe-xstat.hin \ - $(SOURCES) $(INCLUDES) $(EXTRAS) +DISTFILES := Makefile.in ChangeLog $(SOURCES) $(INCLUDES) $(EXTRAS) ifeq ($(SHARED_LIBS), true) BINDISTFILES = liboctave.$(SHLEXT_VER) @@ -117,12 +116,9 @@ LIBOCTAVE_DEPEND := $(patsubst %, liboctave.$(LIBEXT)(%), $(OBJECTS)) -all: stamp-prereq libraries +all: libraries .PHONY: all -stamp-prereq: pic safe-stat.h safe-lstat.h - touch stamp-prereq - pic: @if [ -d pic ]; then \ true; \ @@ -157,31 +153,7 @@ liboctave.$(SHLEXT_VER): $(PICOBJ) $(SH_LD) $(SH_LDFLAGS) $(SONAME_FLAGS) -o $@ $^ -extract_stat = sed 's/@l@//g; s/@L@//g; /@LSTAT_ONLY@/d' -extract_lstat = sed 's/@l@/l/g; s/@L@/L/g; s/ *@LSTAT_ONLY@//' - -safe-lstat.c: safe-xstat.cin - @echo "making $@ from $<" - @$(extract_lstat) $< > $@.tmp - @$(top_srcdir)/move-if-change $@.tmp $@ - -safe-lstat.h: safe-xstat.hin - @echo "making $@ from $<" - @$(extract_lstat) $< > $@.tmp - @$(top_srcdir)/move-if-change $@.tmp $@ - -safe-stat.c: safe-xstat.cin - @echo "making $@ from $<" - @$(extract_stat) $< > $@.tmp - @$(top_srcdir)/move-if-change $@.tmp $@ - -safe-stat.h: safe-xstat.hin - @echo "making $@ from $<" - @$(extract_stat) $< > $@.tmp - @$(top_srcdir)/move-if-change $@.tmp $@ - -safe-stat.o: safe-stat.h -safe-lstat.o: safe-lstat.h safe-stat.h +$(PICOBJ): pic check: all .PHONY: check @@ -194,20 +166,22 @@ .PHONY: install-strip install-lib: - $(top_srcdir)/mkinstalldirs $(libdir) + $(top_srcdir)/mkinstalldirs $(octlibdir) if $(STATIC_LIBS); then \ - rm -f $(libdir)/liboctave.$(LIBEXT); \ - $(INSTALL_DATA) liboctave.$(LIBEXT) $(libdir)/liboctave.$(LIBEXT); \ - $(RANLIB) $(libdir)/liboctave.$(LIBEXT); \ + rm -f $(octlibdir)/liboctave.$(LIBEXT); \ + $(INSTALL_DATA) liboctave.$(LIBEXT) \ + $(octlibdir)/liboctave.$(LIBEXT); \ + $(RANLIB) $(octlibdir)/liboctave.$(LIBEXT); \ fi if $(SHARED_LIBS); then \ - rm -f $(libdir)/liboctave.$(SHLEXT_VER); \ + rm -f $(octlibdir)/liboctave.$(SHLEXT_VER); \ $(INSTALL_PROGRAM) \ - liboctave.$(SHLEXT_VER) $(libdir)/liboctave.$(SHLEXT_VER); \ - cd $(libdir); \ + liboctave.$(SHLEXT_VER) $(octlibdir)/liboctave.$(SHLEXT_VER); \ + cd $(octlibdir); \ rm -f liboctave.$(SHLEXT); \ $(LN_S) liboctave.$(SHLEXT_VER) liboctave.$(SHLEXT); \ fi + $(mk-libdir-link) .PHONY: install-lib install-inc: @@ -220,9 +194,9 @@ .PHONY: install-inc uninstall: - rm -f $(libdir)/liboctave.$(LIBEXT) - rm -f $(libdir)/liboctave.$(SHLEXT) - rm -f $(libdir)/liboctave.$(SHLEXT_VER) + rm -f $(octlibdir)/liboctave.$(LIBEXT) + rm -f $(octlibdir)/liboctave.$(SHLEXT) + rm -f $(octlibdir)/liboctave.$(SHLEXT_VER) for f in $(INCLUDES); do rm -f $(octincludedir)/$$f; done .PHONY: uninstall @@ -233,7 +207,8 @@ etags $(SOURCES) clean: - rm -f safe-stat.h safe-lstat.h *.$(LIBEXT) *.o *.d pic/*.o + rm -f *.$(LIBEXT) *.o *.d pic/*.o + -rmdir pic if $(SHARED_LIBS); then rm -f *.$(SHLEXT_VER) *.$(SHLEXT); fi .PHONY: clean @@ -241,8 +216,7 @@ .PHONY: mostlyclean distclean: clean - rm -f Makefile so_locations stamp-prereq - -rmdir pic + rm -f Makefile so_locations .PHONY: distclean maintainer-clean: distclean @@ -262,11 +236,6 @@ fi .PHONY: bin-dist -# If missing, GNU make attempts to create them in the reverse of the -# order in which they are listed here. We rely on that fact to ensure -# that the safe-stat.h and safe-lstat.h files are created before trying -# to create the .d files. Hmm. I wonder if we can count on that... - ifndef omit_deps --include $(MAKEDEPS) stamp-prereq +-include $(MAKEDEPS) endif
--- a/liboctave/file-stat.cc +++ b/liboctave/file-stat.cc @@ -37,10 +37,13 @@ #include "file-stat.h" #include "statdefs.h" -// These must come after <sys/types.h> and <sys/stat.h>. - -#include <safe-lstat.h> -#include <safe-stat.h> +#if !defined (HAVE_LSTAT) +static inline int +lstat (const char *name, struct stat *buf) +{ + return stat (name, buf); +} +#endif // XXX FIXME XXX -- the is_* and mode_as_string functions are only valid // for initialized objects. If called for an object that is not @@ -155,8 +158,7 @@ struct stat buf; - int status = follow_links - ? SAFE_STAT (cname, &buf) : SAFE_LSTAT (cname, &buf); + int status = follow_links ? stat (cname, &buf) : lstat (cname, &buf); if (status < 0) {
--- a/octave-bug.in +++ b/octave-bug.in @@ -15,7 +15,7 @@ config_opts=%config_opts% VERSION=%VERSION% -MACHINE=%TARGET_HOST_TYPE% +MACHINE=%CANONICAL_HOST_TYPE% F77=%F77% FFLAGS=%FFLAGS% FPICFLAG=%FPICFLAG%
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,14 @@ +Tue Feb 3 00:18:40 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * special-matrix/sylvester_matrix.m: Rename from hadamard.m + + * miscellaneous/bug_report.m: Don't try to get smart with + OCTAVE_HOME. Assume octave-bug can be found in EXEC_PATH. + + * Makefile.in (install): Create separate ls-R files for + $(datadir) and $(libexecdir). + (uninstall): Remove both ls-R files. + Sat Jan 31 01:09:32 1998 John W. Eaton <jwe@bevo.che.wisc.edu> * signal/fftshift.m: New file.
--- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -50,10 +50,11 @@ .PHONY: clean mostlyclean distclean maintainer-clean install install-strip:: - ls -LR $(datadir)/octave $(libexecdir)/octave > $(datadir)/octave/ls-R + ls -LR $(datadir)/octave > $(datadir)/octave/ls-R + ls -LR $(libexecdir)/octave > $(libexecdir)/octave/ls-R uninstall:: - rm -f $(datadir)/octave/ls-R + rm -f $(datadir)/octave/ls-R $(libexecdir)/octave/ls-R tags TAGS:: $(SOURCES) $(SUBDIR_FOR_COMMAND)
--- a/scripts/linear-algebra/orth.m +++ b/scripts/linear-algebra/orth.m @@ -33,30 +33,36 @@ function retval = orth (A, tol) - [U, S, V] = svd (A); + if (nargin == 1 || nargin == 2) - [rows, cols] = size (A); + [U, S, V] = svd (A); - [S_nr, S_nc] = size (S); + [rows, cols] = size (A); - if (S_nr == 1 || S_nc == 1) - s = S(1); - else - s = diag (S); - endif + [S_nr, S_nc] = size (S); + + if (S_nr == 1 || S_nc == 1) + s = S(1); + else + s = diag (S); + endif - if (nargin == 1) - tol = max (size (A)) * s (1) * eps; - elseif (nargin != 2) - usage ("orth (A [, tol])"); - endif + if (nargin == 1) + tol = max (size (A)) * s (1) * eps; + endif + + rank = sum (s > tol); - rank = sum (s > tol); + if (rank > 0) + retval = -U (:, 1:rank); + else + retval = zeros (rows, 0); + endif - if (rank > 0) - retval = -U (:, 1:rank); else - retval = zeros (rows, 0); + + usage ("orth (a [, tol]"); + endif endfunction
--- a/scripts/miscellaneous/bug_report.m +++ b/scripts/miscellaneous/bug_report.m @@ -49,7 +49,7 @@ endif endif - cmd = strcat (OCTAVE_HOME, "/bin/octave-bug"); + cmd = "octave-bug"; if (length (subject) > 0) cmd = sprintf ("%s -s \"%s\"", cmd, subject);
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,39 @@ +Tue Feb 3 00:24:44 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * defaults.cc (exec_path): Append Vbin_dir to std_path. + + * octave.cc (initialize_pathsearch): Set TEXMFDBS, not TEXMF. + Look for OCTAVE_DB_PATH in environment. + Simplify using Vdata_dir and Vlibexec_dir. + + * defaults.h.in (Vdata_dir, Vlibexecdir): Declare new vars. + defaults.cc: Define them. + (set_default_data_dir, set_default_libexecdir): New functions. + (install_defaults): Call them. + + * defaults.h.in (OCTAVE_LIBEXECDIR): Define. + +Mon Feb 2 02:43:16 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * Makefile.in (install, uninstall): Use $(octlibdir), not $(libdir). + Use mk-libdir-link. + + * defaults.h.in (OCTAVE_OCTLIBDIR): Substitute value. + (Vlib_dir): Delete declaration. + * defaults.cc (Vlib_dir): Delete. + (set_default_lib_dir): Delete. + (install_defaults): Don't call set_default_lib_dir. + (set_default_info_prog): If oct_info_prog is empty, set default to + "info" -- we expect it to be somewhere in the user's path. + + * defun.h (DEFCONST, DEFCONSTX): Eliminate inst_as_fcn and chg_fcn + args. Always pass true for inst_as_fcn and 0 for chg_fcn to + DEFVAR when creating built-in values like `e' or `stderr' that can + be redefined. Change all uses. + + * help.cc (Ftype): Handle script files too. + (Fwhich): Likewise. + Sat Jan 31 00:00:26 1998 John W. Eaton <jwe@bevo.che.wisc.edu> * ov-ch-mat.cc (octave_char_matrix::is_true): Make it work.
--- a/src/Makefile.in +++ b/src/Makefile.in @@ -196,7 +196,7 @@ fi touch stamp-oct-links -stamp-prereq: pic defaults.h oct-conf.h +stamp-prereq: defaults.h oct-conf.h touch stamp-prereq octave: octave.o builtins.o ops.o $(DLD_STATIC_OBJ) libraries @@ -240,6 +240,8 @@ liboctinterp.$(SHLEXT_VER): $(PICOBJ) $(SH_LD) $(SH_LDFLAGS) $(SONAME_FLAGS) -o $@ $^ +$(PICOBJ): pic + builtins.cc: $(DEF_FILES) mkbuiltins @echo making $@ @echo DEF_FILES = $(DEF_FILES) @@ -290,21 +292,22 @@ .PHONY: install-oct install-lib: - $(top_srcdir)/mkinstalldirs $(libdir) + $(top_srcdir)/mkinstalldirs $(octlibdir) if $(STATIC_LIBS); then \ - rm -f $(libdir)/liboctinterp.$(LIBEXT); \ + rm -f $(octlibdir)/liboctinterp.$(LIBEXT); \ $(INSTALL_DATA) liboctinterp.$(LIBEXT) \ - $(libdir)/liboctinterp.$(LIBEXT); \ - $(RANLIB) $(libdir)/liboctinterp.$(LIBEXT); \ + $(octlibdir)/liboctinterp.$(LIBEXT); \ + $(RANLIB) $(octlibdir)/liboctinterp.$(LIBEXT); \ fi if $(SHARED_LIBS); then \ - rm -f $(libdir)/liboctinterp.$(SHLEXT_VER); \ - $(INSTALL_PROGRAM) \ - liboctinterp.$(SHLEXT_VER) $(libdir)/liboctinterp.$(SHLEXT_VER); \ - cd $(libdir); \ + rm -f $(octlibdir)/liboctinterp.$(SHLEXT_VER); \ + $(INSTALL_PROGRAM) liboctinterp.$(SHLEXT_VER) \ + $(octlibdir)/liboctinterp.$(SHLEXT_VER); \ + cd $(octlibdir); \ rm -f liboctinterp.$(SHLEXT); \ $(LN_S) liboctinterp.$(SHLEXT_VER) liboctinterp.$(SHLEXT); \ fi + $(mk-libdir-link) .PHONY: install-lib install-inc: @@ -326,9 +329,9 @@ uninstall: rm -f $(bindir)/octave$(EXE) - rm -f $(libdir)/liboctinterp.$(LIBEXT) - rm -f $(libdir)/liboctinterp.$(SHLEXT) - rm -f $(libdir)/liboctinterp.$(SHLEXT_VER) + rm -f $(octlibdir)/liboctinterp.$(LIBEXT) + rm -f $(octlibdir)/liboctinterp.$(SHLEXT) + rm -f $(octlibdir)/liboctinterp.$(SHLEXT_VER) for f in $(INCLUDES) defaults.h oct-conf.h; do \ rm -f $(octincludedir)/$$f; \ done @@ -343,23 +346,23 @@ clean: rm -f *.$(LIBEXT) *.o *.d *.df *.oct pic/*.o rm -f builtins.cc ops.cc defaults.h oct-conf.h def-files var-files + -rmdir pic if $(SHARED_LIBS); then rm -f *.$(SHLEXT_VER) *.$(SHLEXT); fi .PHONY: clean mostlyclean: rm -f *.o pic/*.o + -rmdir pic .PHONY: mostlyclean distclean: clean rm -f Makefile octave .fname so_locations rm -f stamp-prereq - -rmdir pic .PHONY: distclean maintainer-clean: distclean rm -f tags TAGS y.tab.c y.tab.h y.output yy.lex.c lex.cc parse.cc rm -f oct-gperf.h stamp-prereq - -rmdir pic .PHONY: maintainer-clean dist: parse.cc lex.cc oct-gperf.h
--- a/src/data.cc +++ b/src/data.cc @@ -1115,16 +1115,16 @@ void symbols_of_data (void) { - DEFCONST (I, Complex (0.0, 1.0), 0, 0, + DEFCONST (I, Complex (0.0, 1.0), "sqrt (-1)"); - DEFCONST (Inf, octave_Inf, 0, 0, + DEFCONST (Inf, octave_Inf, "infinity"); - DEFCONST (J, Complex (0.0, 1.0), 0, 0, + DEFCONST (J, Complex (0.0, 1.0), "sqrt (-1)"); - DEFCONST (NaN, octave_NaN, 0, 0, + DEFCONST (NaN, octave_NaN, "not a number"); #if defined (M_E) @@ -1133,22 +1133,22 @@ double e_val = exp (1.0); #endif - DEFCONST (e, e_val, 0, 0, + DEFCONST (e, e_val, "exp (1)"); - DEFCONST (eps, DBL_EPSILON, 0, 0, + DEFCONST (eps, DBL_EPSILON, "machine precision"); - DEFCONST (i, Complex (0.0, 1.0), 1, 0, + DEFCONST (i, Complex (0.0, 1.0), "sqrt (-1)"); - DEFCONST (inf, octave_Inf, 0, 0, + DEFCONST (inf, octave_Inf, "infinity"); - DEFCONST (j, Complex (0.0, 1.0), 1, 0, + DEFCONST (j, Complex (0.0, 1.0), "sqrt (-1)"); - DEFCONST (nan, octave_NaN, 0, 0, + DEFCONST (nan, octave_NaN, "not a number"); #if defined (M_PI) @@ -1157,13 +1157,13 @@ double pi_val = 4.0 * atan (1.0); #endif - DEFCONST (pi, pi_val, 0, 0, + DEFCONST (pi, pi_val, "ratio of the circumference of a circle to its diameter"); - DEFCONST (realmax, DBL_MAX, 0, 0, + DEFCONST (realmax, DBL_MAX, "realmax (): return largest representable floating point number"); - DEFCONST (realmin, DBL_MIN, 0, 0, + DEFCONST (realmin, DBL_MIN, "realmin (): return smallest representable floating point number"); DEFVAR (treat_neg_dim_as_zero, 0.0, 0, treat_neg_dim_as_zero,
--- a/src/defaults.cc +++ b/src/defaults.cc @@ -53,8 +53,9 @@ string Voctave_home; string Vbin_dir; -string Vlib_dir; string Vinfo_dir; +string Vdata_dir; +string Vlibexec_dir; string Varch_lib_dir; string Vlocal_arch_lib_dir; string Vfcn_file_dir; @@ -113,6 +114,18 @@ } static void +set_default_data_dir (void) +{ + Vdata_dir = subst_octave_home (OCTAVE_DATADIR); +} + +static void +set_default_libexec_dir (void) +{ + Vlibexec_dir = subst_octave_home (OCTAVE_LIBEXECDIR); +} + +static void set_default_arch_lib_dir (void) { Varch_lib_dir = subst_octave_home (OCTAVE_ARCHLIBDIR); @@ -137,12 +150,6 @@ } static void -set_default_lib_dir (void) -{ - Vlib_dir = subst_octave_home (OCTAVE_LIBDIR); -} - -static void set_default_exec_path (void) { string octave_exec_path = octave_env::getenv ("OCTAVE_EXEC_PATH"); @@ -192,10 +199,7 @@ string oct_info_prog = octave_env::getenv ("OCTAVE_INFO_PROGRAM"); if (oct_info_prog.empty ()) - { - Vinfo_prog = Varch_lib_dir; - Vinfo_prog.append ("/info"); - } + Vinfo_prog = "info"; else Vinfo_prog = string (oct_info_prog); } @@ -258,6 +262,10 @@ set_default_info_dir (); + set_default_data_dir (); + + set_default_libexec_dir (); + set_default_arch_lib_dir (); set_default_local_arch_lib_dir (); @@ -266,8 +274,6 @@ set_default_bin_dir (); - set_default_lib_dir (); - set_default_exec_path (); set_default_path (); @@ -317,9 +323,8 @@ { Vexec_path = s; - string std_path = Vlocal_arch_lib_dir; - std_path.append (SEPCHAR_STR); - std_path.append (Varch_lib_dir); + string std_path = Vlocal_arch_lib_dir + string (SEPCHAR_STR) + + Varch_lib_dir + string (SEPCHAR_STR) + Vbin_dir; string path; @@ -405,10 +410,10 @@ DEFVAR (IMAGEPATH, OCTAVE_IMAGEPATH, 0, imagepath, "colon separated list of directories to search for image files"); - DEFCONST (OCTAVE_HOME, Voctave_home, 0, 0, + DEFCONST (OCTAVE_HOME, Voctave_home, "top-level Octave installation directory"); - DEFCONSTX ("OCTAVE_VERSION", SBV_OCTAVE_VERSION, OCTAVE_VERSION, 0, 0, + DEFCONSTX ("OCTAVE_VERSION", SBV_OCTAVE_VERSION, OCTAVE_VERSION, "Octave version"); }
--- a/src/defaults.h.in +++ b/src/defaults.h.in @@ -42,10 +42,18 @@ #define OCTAVE_DATADIR %OCTAVE_DATADIR% #endif +#ifndef OCTAVE_LIBEXECDIR +#define OCTAVE_LIBEXECDIR %OCTAVE_LIBEXECDIR% +#endif + #ifndef OCTAVE_LIBDIR #define OCTAVE_LIBDIR %OCTAVE_LIBDIR% #endif +#ifndef OCTAVE_OCTLIBDIR +#define OCTAVE_OCTLIBDIR %OCTAVE_OCTLIBDIR% +#endif + #ifndef OCTAVE_BINDIR #define OCTAVE_BINDIR %OCTAVE_BINDIR% #endif @@ -109,8 +117,9 @@ extern string Voctave_home; extern string Vbin_dir; -extern string Vlib_dir; extern string Vinfo_dir; +extern string Vdata_dir; +extern string Vlibexec_dir; extern string Varch_lib_dir; extern string Vlocal_arch_lib_dir; extern string Vfcn_file_dir;
--- a/src/defun.h +++ b/src/defun.h @@ -35,7 +35,7 @@ // // defn is the initial value for the variable. // -// ins_as_fcn is a flag that says whether to install the variable as +// inst_as_fcn is a flag that says whether to install the variable as // if it were a function (allowing the name to also be used as a // variable by users, but recover its original definition if cleared). // @@ -53,27 +53,26 @@ // doc is the simple help text for this variable. #define DEFVAR(name, defn, inst_as_fcn, chg_fcn, doc) \ - DEFVAR_INTERNAL (#name, SBV_ ## name, defn, inst_as_fcn, 0, chg_fcn, doc) + DEFVAR_INTERNAL (#name, SBV_ ## name, defn, inst_as_fcn, false, chg_fcn, doc) -// Define a builtin-constant, and a corresponding variable that can be -// redefined. This is just the same as DEFVAR, except that it defines -// `name' as a variable, and `__name__' as a constant that cannot be -// redefined. +// Define a builtin-constant `__name__', and a corresponding variable +// `name' that can be redefined. (The variable is actually installed +// in the symbol table as a function, so that it doesn't work like a +// global variable when redefined.) -#define DEFCONST(name, defn, inst_as_fcn, chg_fcn, doc) \ - DEFVAR_INTERNAL (#name, SBV_ ## name, defn, inst_as_fcn, false, \ - chg_fcn, doc); \ +#define DEFCONST(name, defn, doc) \ + DEFVAR_INTERNAL (#name, SBV_ ## name, defn, true, false, 0, doc); \ DEFVAR_INTERNAL ("__" ## #name ## "__", XSBV_ ## name, defn, false, \ - true, chg_fcn, doc) + true, 0, doc) // This one can be used when `name' cannot be used directly (if it is // already defined as a macro). In that case, name is already a // quoted string, and the name of the structure has to be passed too. -#define DEFCONSTX(name, sname, defn, inst_as_fcn, chg_fcn, doc) \ - DEFVAR_INTERNAL (name, sname, defn, inst_as_fcn, false, chg_fcn, doc); \ +#define DEFCONSTX(name, sname, defn, doc) \ + DEFVAR_INTERNAL (name, sname, defn, true, false, 0, doc); \ DEFVAR_INTERNAL ("__" ## name ## "__", X ## sname, defn, false, true, \ - chg_fcn, doc) + 0, doc) // Define a builtin function. //
--- a/src/error.cc +++ b/src/error.cc @@ -326,7 +326,7 @@ DEFVAR (beep_on_error, 0.0, 0, beep_on_error, "if true, beep before printing error messages"); - DEFCONST (error_text, "", 0, 0, + DEFCONST (error_text, "", "the text of error messages that would have been printed in the\n\ body of the most recent unwind_protect statement or the TRY part of\n\ the most recent eval() command. Outside of unwind_protect and\n\
--- a/src/file-io.cc +++ b/src/file-io.cc @@ -1380,22 +1380,22 @@ // NOTE: the values of SEEK_SET, SEEK_CUR, and SEEK_END have to be // this way for Matlab compatibility. - DEFCONST (SEEK_SET, -1.0, 0, 0, + DEFCONST (SEEK_SET, -1.0, "used with fseek to position file relative to the beginning"); - DEFCONST (SEEK_CUR, 0.0, 0, 0, + DEFCONST (SEEK_CUR, 0.0, "used with fseek to position file relative to the current position"); - DEFCONST (SEEK_END, 1.0, 0, 0, + DEFCONST (SEEK_END, 1.0, "used with fseek to position file relative to the end"); - DEFCONSTX ("stdin", SBV_stdin, stdin_file, 0, 0, + DEFCONSTX ("stdin", SBV_stdin, stdin_file, "file number of the standard input stream"); - DEFCONSTX ("stdout", SBV_stdout, stdout_file, 0, 0, + DEFCONSTX ("stdout", SBV_stdout, stdout_file, "file number of the standard output stream"); - DEFCONSTX ("stderr", SBV_stderr, stderr_file, 0, 0, + DEFCONSTX ("stderr", SBV_stderr, stderr_file, "file number of the standard error stream"); }
--- a/src/help.cc +++ b/src/help.cc @@ -453,7 +453,7 @@ if (print) os << name - << " is the function defined from:\n" + << " is the function defined from: " << ff << "\n"; else retval = ff; @@ -724,7 +724,7 @@ if (! h.empty ()) { - octave_stdout << argv[i] << " is the file:\n" + octave_stdout << argv[i] << " is the file: " << path << "\n\n" << h << "\n"; continue; @@ -831,7 +831,7 @@ symbol_record *sym_rec = lookup_by_name (id, 0); - if (sym_rec) + if (sym_rec && sym_rec->is_defined ()) { if (sym_rec->is_user_function ()) { @@ -851,7 +851,7 @@ { if (nargout == 0 && ! quiet) output_buf << argv[i] - << " is the function defined from:\n" + << " is the function defined from: " << ff << "\n\n"; char ch; @@ -927,7 +927,31 @@ output_buf << "type: `" << argv[i] << "' has unknown type!\n"; } else - output_buf << "type: `" << argv[i] << "' undefined\n"; + { + string ff = fcn_file_in_path (argv[i]); + + if (! ff.empty ()) + { + ifstream fs (ff.c_str (), ios::in); + + if (fs) + { + if (nargout == 0 && ! quiet) + output_buf << argv[i] << " is the script file: " + << ff << "\n\n"; + + char ch; + + while (fs.get (ch)) + output_buf << ch; + } + else + output_buf << "unable to open `" << ff + << "' for reading!\n"; + } + else + output_buf << "type: `" << argv[i] << "' undefined\n"; + } } output_buf << ends; @@ -971,7 +995,7 @@ { symbol_record *sym_rec = lookup_by_name (argv[i], 0); - if (sym_rec) + if (sym_rec && sym_rec->is_defined ()) { int print = (nargout == 0); @@ -982,10 +1006,25 @@ } else { - if (nargout == 0) - octave_stdout << "which: `" << argv[i] << "' is undefined\n"; + string path = fcn_file_in_path (argv[i]); + + if (! path.empty ()) + { + if (nargout == 0) + octave_stdout << "which: `" << argv[i] + << "' is the script file: " + << path << "\n"; + else + retval(i) = path; + } else - retval(i) = "undefined"; + { + if (nargout == 0) + octave_stdout << "which: `" << argv[i] + << "' is undefined\n"; + else + retval(i) = "undefined"; + } } } }
--- a/src/octave.cc +++ b/src/octave.cc @@ -170,22 +170,17 @@ // This may seem odd, but doing it this way means that we don't have // to modify the kpathsea library... - string odb = octave_env::getenv ("OCTAVE_DB_DIR"); + string odb = octave_env::getenv ("OCTAVE_DB_PATH"); + + // For backward compatibility. if (odb.empty ()) - { - string oh = octave_env::getenv ("OCTAVE_HOME"); + odb = octave_env::getenv ("OCTAVE_DB_DIR"); - if (oh.empty ()) - octave_env::putenv ("TEXMF", OCTAVE_DATADIR "/octave"); - else - { - oh.append ("/lib/octave"); - octave_env::putenv ("TEXMF", oh); - } - } - else - octave_env::putenv ("TEXMF", odb); + if (odb.empty ()) + odb = Vdata_dir + string ("/octave:") + Vlibexec_dir + string ("/octave"); + + octave_env::putenv ("TEXMFDBS", odb); } // Initialize by reading startup files.
--- a/src/syscalls.cc +++ b/src/syscalls.cc @@ -723,77 +723,77 @@ symbols_of_syscalls (void) { #if defined (F_DUPFD) - DEFCONST (F_DUPFD, static_cast<double> (F_DUPFD), 0, 0, + DEFCONST (F_DUPFD, static_cast<double> (F_DUPFD), ""); #endif #if defined (F_GETFD) - DEFCONST (F_GETFD, static_cast<double> (F_GETFD), 0, 0, + DEFCONST (F_GETFD, static_cast<double> (F_GETFD), ""); #endif #if defined (F_GETFL) - DEFCONST (F_GETFL, static_cast<double> (F_GETFL), 0, 0, + DEFCONST (F_GETFL, static_cast<double> (F_GETFL), ""); #endif #if defined (F_SETFD) - DEFCONST (F_SETFD, static_cast<double> (F_SETFD), 0, 0, + DEFCONST (F_SETFD, static_cast<double> (F_SETFD), ""); #endif #if defined (F_SETFL) - DEFCONST (F_SETFL, static_cast<double> (F_SETFL), 0, 0, + DEFCONST (F_SETFL, static_cast<double> (F_SETFL), ""); #endif #if defined (O_APPEND) - DEFCONST (O_APPEND, static_cast<double> (O_APPEND), 0, 0, + DEFCONST (O_APPEND, static_cast<double> (O_APPEND), ""); #endif #if defined (O_ASYNC) - DEFCONST (O_ASYNC, static_cast<double> (O_ASYNC), 0, 0, + DEFCONST (O_ASYNC, static_cast<double> (O_ASYNC), ""); #endif #if defined (O_CREAT) - DEFCONST (O_CREAT, static_cast<double> (O_CREAT), 0, 0, + DEFCONST (O_CREAT, static_cast<double> (O_CREAT), ""); #endif #if defined (O_EXCL) - DEFCONST (O_EXCL, static_cast<double> (O_EXCL), 0, 0, + DEFCONST (O_EXCL, static_cast<double> (O_EXCL), ""); #endif #if defined (O_NONBLOCK) - DEFCONST (O_NONBLOCK, static_cast<double> (O_NONBLOCK), 0, 0, + DEFCONST (O_NONBLOCK, static_cast<double> (O_NONBLOCK), ""); #endif #if defined (O_RDONLY) - DEFCONST (O_RDONLY, static_cast<double> (O_RDONLY), 0, 0, + DEFCONST (O_RDONLY, static_cast<double> (O_RDONLY), ""); #endif #if defined (O_RDWR) - DEFCONST (O_RDWR, static_cast<double> (O_RDWR), 0, 0, + DEFCONST (O_RDWR, static_cast<double> (O_RDWR), ""); #endif #if defined (O_SYNC) - DEFCONST (O_SYNC, static_cast<double> (O_SYNC), 0, 0, + DEFCONST (O_SYNC, static_cast<double> (O_SYNC), ""); #endif #if defined (O_TRUNC) - DEFCONST (O_TRUNC, static_cast<double> (O_TRUNC), 0, 0, + DEFCONST (O_TRUNC, static_cast<double> (O_TRUNC), ""); #endif #if defined (O_WRONLY) - DEFCONST (O_WRONLY, static_cast<double> (O_WRONLY), 0, 0, + DEFCONST (O_WRONLY, static_cast<double> (O_WRONLY), ""); #endif }
--- a/src/toplev.cc +++ b/src/toplev.cc @@ -541,6 +541,8 @@ Octave_map m; + // XXX FIXME XXX -- should we perform OCTAVE_HOME substitution on these? + m ["default_pager"] = DEFAULT_PAGER; m ["prefix"] = OCTAVE_PREFIX; m ["exec_prefix"] = OCTAVE_EXEC_PREFIX; @@ -646,15 +648,15 @@ void symbols_of_toplev (void) { - DEFCONST (argv, , 0, 0, + DEFCONST (argv, , "the command line arguments this program was invoked with"); DEFCONST (program_invocation_name, - octave_env::get_program_invocation_name (), 0, 0, + octave_env::get_program_invocation_name (), "the full name of the current program or script, including the\n\ directory specification"); - DEFCONST (program_name, octave_env::get_program_name (), 0, 0, + DEFCONST (program_name, octave_env::get_program_name (), "the name of the current program or script"); }
--- a/src/version.h +++ b/src/version.h @@ -1,6 +1,6 @@ /* -Copyright (C) 1996, 1997 John W. Eaton +Copyright (C) 1996, 1997, 1998 John W. Eaton This file is part of Octave. @@ -26,7 +26,7 @@ #define OCTAVE_VERSION "2.1.4" #define OCTAVE_COPYRIGHT \ - "Copyright (C) 1996, 1997 John W. Eaton." + "Copyright (C) 1996, 1997, 1998 John W. Eaton." #define OCTAVE_NAME_AND_VERSION \ "Octave, version " OCTAVE_VERSION " (" TARGET_HOST_TYPE ")"