Mercurial > hg > octave-nkf
changeset 3597:26662775f4e9
[project @ 2000-02-12 02:24:41 by jwe]
author | jwe |
---|---|
date | Sat, 12 Feb 2000 02:24:46 +0000 |
parents | edcaebe1b81b |
children | 0ae310231c46 |
files | ChangeLog Makeconf.in configure.in liboctave/ChangeLog liboctave/Makefile.in liboctave/oct-time.cc scripts/ChangeLog scripts/miscellaneous/bug_report.m scripts/plot/hist.m scripts/set/create_set.m src/ChangeLog src/Makefile.in src/defaults.cc src/defaults.h.in src/octave.cc src/toplev.cc |
diffstat | 16 files changed, 169 insertions(+), 47 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2000-02-11 John W. Eaton <jwe@bevo.che.wisc.edu> + + * configure.in (octincludedir): Delete trailing /octave here. + * Makeconf.in (mk-includedir-link): Append it here. + (MKOCTFILE_INCFLAGS): Use both -I$(octincludedir) and + -I$(octincludedir)/octave. + + * configure.in (localveroctfiledir, localverarchlibdir, + localverfcnfiledir): New variables. + (localfcnfilepath): Prepend localverfcnfiledir. + (localoctfilepath): Prepend localveroctfiledir. + * Makeconf.in: Substitute them here. + + * Makeconf.in (do-subst-default-vals): Substitute + OCTAVE_LOCALVERARCHLIBDIR, OCTAVE_LOCALVERFCNFILEDIR, + OCTAVE_LOCALVEROCTFILEDIR. + 2000-02-08 John W. Eaton <jwe@bevo.che.wisc.edu> * config.guess: Update to latest from subversions.gnu.org.
--- a/Makeconf.in +++ b/Makeconf.in @@ -199,7 +199,8 @@ # These variables hold the values specific to Octave. They are # based on the values of the standard Make variables above. -# Where to install Octave's include files. The default is +# Where to install Octave's include files (they will actually be +# installed in a subdirectory called octave). The default is # ${includedir}/octave-${version} octincludedir = @octincludedir@ @@ -214,6 +215,7 @@ # ${fcnfiledir}. This should be a colon-separated list of # directories. localfcnfiledir = @localfcnfiledir@ +localverfcnfiledir = @localverfcnfiledir@ localfcnfilepath = @localfcnfilepath@ # Where to put executables to be run by Octave rather than @@ -225,6 +227,7 @@ # Where to put executables to be run by Octave rather than by the # user that are specific to this site. localarchlibdir = @localarchlibdir@ +localverarchlibdir = @localverarchlibdir@ # Where to put object files that will by dynamically loaded. # This path usually includes the Octave version and configuration @@ -237,6 +240,7 @@ # (i.e. customizations), before consulting ${octfiledir}. This should # be a colon-separated list of directories. localoctfiledir = @localoctfiledir@ +localveroctfiledir = @localveroctfiledir@ localoctfilepath = @localoctfilepath@ # Where Octave will search to find its function files. Before @@ -253,7 +257,8 @@ canonical_host_type = @canonical_host_type@ # The -I flags to use for the mkoctfile script. -MKOCTFILE_INCFLAGS = -I$(octincludedir) -I$(includedir) +MKOCTFILE_INCFLAGS = \ + -I$(octincludedir) -I$(octincludedir)/octave -I$(includedir) # The following pattern rules and the substitution functions require # GNU make. If you don't have it, get it! @@ -416,6 +421,9 @@ -e "s;%OCTAVE_LOCALFCNFILEPATH%;\"${localfcnfilepath}\";" \ -e "s;%OCTAVE_LOCALOCTFILEDIR%;\"${localoctfiledir}\";" \ -e "s;%OCTAVE_LOCALOCTFILEPATH%;\"${localoctfilepath}\";" \ + -e "s;%OCTAVE_LOCALVERARCHLIBDIR%;\"${localverarchlibdir}\";" \ + -e "s;%OCTAVE_LOCALVERFCNFILEDIR%;\"${localverfcnfiledir}\";" \ + -e "s;%OCTAVE_LOCALVEROCTFILEDIR%;\"${localveroctfiledir}\";" \ -e "s;%OCTAVE_MAN1DIR%;\"${man1dir}\";" \ -e "s;%OCTAVE_MAN1EXT%;\"${man1ext}\";" \ -e "s;%OCTAVE_MANDIR%;\"${mandir}\";" \ @@ -426,13 +434,14 @@ $(top_srcdir)/move-if-change $@.tmp $@ endef -# Make a relative symbolic link from $includedir/octave to $octincludedir. +# Make a relative symbolic link from $includedir/octave to +# $octincludedir/octave. # XXX FIXME XXX -- this assumes that $octincludedir is a subdirectory # of $includedir. define mk-includedir-link -src=`echo $(octincludedir) | sed 's|^$(includedir)/*||'`; \ +src=`echo $(octincludedir)/octave | sed 's|^$(includedir)/*||'`; \ echo $$src; \ if [ "$$src" = "octave" ]; then \ true; \
--- 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.322 $) +AC_REVISION($Revision: 1.323 $) AC_PREREQ(2.9) AC_INIT(src/octave.cc) AC_CONFIG_HEADER(config.h) @@ -35,20 +35,27 @@ OCTAVE_SET_DEFAULT(man1dir, '$(mandir)/man1') OCTAVE_SET_DEFAULT(man1ext, '.1') OCTAVE_SET_DEFAULT(infofile, '$(infodir)/octave.info') -OCTAVE_SET_DEFAULT(octincludedir, '$(includedir)/octave-$(version)/octave') +OCTAVE_SET_DEFAULT(octincludedir, '$(includedir)/octave-$(version)') OCTAVE_SET_DEFAULT(fcnfiledir, '$(datadir)/octave/$(version)/m') OCTAVE_SET_DEFAULT(localfcnfiledir, '$(datadir)/octave/site/m') -OCTAVE_SET_DEFAULT(localfcnfilepath, '$(localfcnfiledir)//') +OCTAVE_SET_DEFAULT(localverfcnfiledir, '$(datadir)/octave/$(version)/site/m') +OCTAVE_SET_DEFAULT(localfcnfilepath, + '$(localverfcnfiledir)//:$(localfcnfiledir)//') OCTAVE_SET_DEFAULT(octlibdir, '$(libdir)/octave-$(version)') OCTAVE_SET_DEFAULT(archlibdir, '$(libexecdir)/octave/$(version)/exec/$(canonical_host_type)') OCTAVE_SET_DEFAULT(localarchlibdir, '$(libexecdir)/octave/site/exec/$(canonical_host_type)') +OCTAVE_SET_DEFAULT(localverarchlibdir, + '$(libexecdir)/octave/$(version)/site/exec/$(canonical_host_type)') OCTAVE_SET_DEFAULT(octfiledir, '$(libexecdir)/octave/$(version)/oct/$(canonical_host_type)') OCTAVE_SET_DEFAULT(localoctfiledir, '$(libexecdir)/octave/site/oct/$(canonical_host_type)') -OCTAVE_SET_DEFAULT(localoctfilepath, '$(localoctfiledir)//') +OCTAVE_SET_DEFAULT(localveroctfiledir, + '$(libexecdir)/octave/$(version)/site/oct/$(canonical_host_type)') +OCTAVE_SET_DEFAULT(localoctfilepath, + '$(localveroctfiledir)//:$(localoctfiledir)//') OCTAVE_SET_DEFAULT(fcnfilepath, '.:$(localoctfilepath):$(localfcnfilepath):$(octfiledir)//:$(fcnfiledir)//') OCTAVE_SET_DEFAULT(imagedir, '$(datadir)/octave/$(version)/imagelib')
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,12 @@ +2000-02-11 John W. Eaton <jwe@bevo.che.wisc.edu> + + * Makefile.in (install-inc): Install files in + $(octincludedir)/octave. + (uninstall): Remove them from the correct directory too. + + * oct-time.cc: Temporarily define _BSD_SOURCE and _XOPEN_SOURCE if + they are not already defined. + 2000-02-08 John W. Eaton <jwe@bevo.che.wisc.edu> * CRowVector.cc, CRowVector.h, CColVector.cc, CColVector.h:
--- a/liboctave/Makefile.in +++ b/liboctave/Makefile.in @@ -198,10 +198,10 @@ .PHONY: install-lib install-inc: - $(top_srcdir)/mkinstalldirs $(octincludedir) + $(top_srcdir)/mkinstalldirs $(octincludedir)/octave for f in $(INCLUDES_FOR_INSTALL); do \ - rm -f $(octincludedir)/$$f; \ - $(INSTALL_DATA) $(srcdir)/$$f $(octincludedir)/$$f; \ + rm -f $(octincludedir)/octave/$$f; \ + $(INSTALL_DATA) $(srcdir)/$$f $(octincludedir)/octave/$$f; \ done $(mk-includedir-link) .PHONY: install-inc @@ -210,7 +210,7 @@ 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 + for f in $(INCLUDES); do rm -f $(octincludedir)/octave/$$f; done .PHONY: uninstall tags: $(SOURCES)
--- a/liboctave/oct-time.cc +++ b/liboctave/oct-time.cc @@ -24,14 +24,40 @@ #include <config.h> #endif +// I am told that without _BSD_SOURCE, tm_zone won't be declared on +// some systems. Defining _XOPEN_SOURCE provides the declaration for +// strptime on some others. +// +// These defines go here, before any system header files are included, +// because the system header files may define other macros that are +// actually used to determine the feature set. If we wait until after +// some system header file is included, it may be too late. + +#if !defined (_BSD_SOURCE) +#define _BSD_SOURCE 1 +#define OCTAVE_UNDEFINE_BSD_SOURCE +#endif + +#if !defined (_XOPEN_SOURCE) +#define _XOPEN_SOURCE 1 +#define OCTAVE_UNDEFINE_XOPEN_SOURCE +#endif + #include <climits> #include <cmath> #include "lo-error.h" #include "lo-utils.h" -#define __USE_XOPEN #include "oct-time.h" +#if defined (OCTAVE_UNDEFINE_BSD_SOURCE) +#undef _BSD_SOURCE +#endif + +#if defined (OCTAVE_UNDEFINE_XOPEN_SOURCE) +#undef _XOPEN_SOURCE +#endif + #if !defined (HAVE_STRPTIME) extern "C" char *strptime (const char *buf, const char *format, struct tm *tm); #endif
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,16 @@ +2000-02-11 Georg Thimm <mgeorg@SGraphicsWS1.mpe.ntu.edu.sg> + + * set/create_set.m: Use find to avoid while loop. + +2000-02-11 Stephen Eglen <stephen@cogsci.ed.ac.uk> + + * plot/hist.m: New optional third argument. + +2000-02-10 John W. Eaton <jwe@bevo.che.wisc.edu> + + * miscellaneous/bug_report.m: Use octave-bug script with version + number appended. + 2000-02-04 John W. Eaton <jwe@bevo.che.wisc.edu> * gethelp.cc: Sprinkle with std:: qualifier.
--- a/scripts/miscellaneous/bug_report.m +++ b/scripts/miscellaneous/bug_report.m @@ -50,7 +50,7 @@ endif endif - cmd = "octave-bug"; + cmd = strcat ("octave-bug-", __OCTAVE_VERSION__); if (length (subject) > 0) cmd = sprintf ("%s -s \"%s\"", cmd, subject);
--- a/scripts/plot/hist.m +++ b/scripts/plot/hist.m @@ -18,7 +18,7 @@ ## 02111-1307, USA. ## -*- texinfo -*- -## @deftypefn {Function File} {} hist (@var{y}, @var{x}) +## @deftypefn {Function File} {} hist (@var{y}, @var{x}, @var{norm}) ## Produce histogram counts or plots. ## ## With one vector input argument, plot a histogram of the values with @@ -31,6 +31,9 @@ ## with the width of the bins determined from the adjacent values in ## the vector. ## +## If third argument is provided, the histogram is normalised such that +## the sum of the bars is equal to @var{norm}. +## ## Extreme values are lumped in the first and last bins. ## ## With two output arguments, produce the values @var{nn} and @var{xx} such @@ -40,10 +43,10 @@ ## Author: jwe -function [nn, xx] = hist (y, x) +function [nn, xx] = hist (y, x, norm) if (nargin < 1 || nargin > 2) - usage ("[nn, xx] = hist (y, x)"); + usage ("[nn, xx] = hist (y, x, norm)"); endif if (is_vector (y)) @@ -58,7 +61,8 @@ delta = (max_val - min_val) / n / 2; x = linspace (min_val+delta, max_val-delta, n); cutoff = x + delta; - elseif (nargin == 2) + else + ## nargin is either 2 or 3 if (is_scalar (x)) n = x; if (n <= 0) @@ -90,6 +94,11 @@ endfor freq (n) = sum (y >= cutoff (n-1)); + if (nargin == 3) + ## Normalise the histogram. + freq = freq / length(y) * norm; + endif + if (nargout > 0) nn = freq; xx = x;
--- a/scripts/set/create_set.m +++ b/scripts/set/create_set.m @@ -39,26 +39,13 @@ usage ("create_set(x)"); endif - if(isempty(x)) + if (isempty(x)) y = []; else - [nrx, ncx] = size(x); - nelx = nrx*ncx; - x = reshape(x,1,nelx); - y = zeros(1,nelx); - - x = sort(x); - cur_val = y(1) = x(1); - yindex = xindex = 2; - - while (xindex <= nelx) - if(cur_val != x(xindex)) - cur_val = x(xindex); - y(yindex++) = cur_val; - endif - xindex++; - endwhile - y = y(1:(yindex-1)); + [nrx, ncx] = size (x); + nelx = nrx * ncx; + y = sort (reshape (x, 1, nelx)); + y = y ([1, (find (y(1:nelx-1) != y(2:nelx)) + 1)]); endif endfunction
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,6 +1,23 @@ +2000-02-11 John W. Eaton <jwe@bevo.che.wisc.edu> + + * Makefile.in (install-inc): Install files in + $(octincludedir)/octave. + (uninstall): Remove them from the correct directory too. + + * defaults.h, defaults.cc (Vlocal_ver_arch_lib_dir): New variable. + * defaults.cc (set_default_local_ver_arch_lib_dir): New function. + (install_defaults): Call it. + (exec_path): Prepend the versioned form of the local arch lib + directory to the standard path. + * defaults.h.in (OCTAVE_LOCALVERARCHLIBDIR, + OCTAVE_LOCALVERFCNFILEDIR, OCTAVE_LOCALVEROCTFILEDIR): + Substitute these too. + * toplev.cc (Foctave_config_info): Add them to the struct. + 2000-02-08 John W. Eaton <jwe@bevo.che.wisc.edu> - * toplev.cc (octave_config_info): Add MKOCTFILE_INCFLAGS to the struct. + * toplev.cc (Foctave_config_info): Add MKOCTFILE_INCFLAGS to the + struct. * oct-conf.h.in (OCTAVE_CONF_MKOCTFILE_INCFLAGS): Define. 2000-02-07 John W. Eaton <jwe@bevo.che.wisc.edu>
--- a/src/Makefile.in +++ b/src/Makefile.in @@ -350,17 +350,17 @@ .PHONY: install-lib install-inc: - $(top_srcdir)/mkinstalldirs $(octincludedir) + $(top_srcdir)/mkinstalldirs $(octincludedir)/octave for f in $(INCLUDES); do \ - rm -f $(octincludedir)/$$f; \ - $(INSTALL_DATA) $(srcdir)/$$f $(octincludedir)/$$f; \ + rm -f $(octincludedir)/octave/$$f; \ + $(INSTALL_DATA) $(srcdir)/$$f $(octincludedir)/octave/$$f; \ done for f in defaults.h oct-conf.h oct-gperf.h; do \ - rm -f $(octincludedir)/$$f; \ + rm -f $(octincludedir)/octave/$$f; \ if [ -f $$f ]; then \ - $(INSTALL_DATA) $$f $(octincludedir)/$$f ; \ + $(INSTALL_DATA) $$f $(octincludedir)/octave/$$f ; \ else \ - $(INSTALL_DATA) $(srcdir)/$$f $(octincludedir)/$$f ; \ + $(INSTALL_DATA) $(srcdir)/$$f $(octincludedir)/octave/$$f ; \ fi ; \ done $(mk-includedir-link) @@ -372,7 +372,7 @@ 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; \ + rm -f $(octincludedir)/octave/$$f; \ done .PHONY: uninstall
--- a/src/defaults.cc +++ b/src/defaults.cc @@ -59,6 +59,7 @@ std::string Vlibexec_dir; std::string Varch_lib_dir; std::string Vlocal_arch_lib_dir; +std::string Vlocal_ver_arch_lib_dir; std::string Vfcn_file_dir; // The path that will be searched for programs that we execute. @@ -145,6 +146,12 @@ } static void +set_default_local_ver_arch_lib_dir (void) +{ + Vlocal_ver_arch_lib_dir = subst_octave_home (OCTAVE_LOCALVERARCHLIBDIR); +} + +static void set_default_fcn_file_dir (void) { Vfcn_file_dir = subst_octave_home (OCTAVE_FCNFILEDIR); @@ -282,6 +289,8 @@ set_default_local_arch_lib_dir (); + set_default_local_ver_arch_lib_dir (); + set_default_fcn_file_dir (); set_default_bin_dir (); @@ -335,8 +344,11 @@ { Vexec_path = s; - std::string std_path = Vlocal_arch_lib_dir + std::string (SEPCHAR_STR) - + Varch_lib_dir + std::string (SEPCHAR_STR) + Vbin_dir; + std::string std_path + = Vlocal_ver_arch_lib_dir + std::string (SEPCHAR_STR) + + Vlocal_arch_lib_dir + std::string (SEPCHAR_STR) + + Varch_lib_dir + std::string (SEPCHAR_STR) + + Vbin_dir; std::string path;
--- a/src/defaults.h.in +++ b/src/defaults.h.in @@ -116,6 +116,18 @@ #define OCTAVE_LOCALSTARTUPFILEDIR OCTAVE_LOCALFCNFILEDIR "/startup" #endif +#ifndef OCTAVE_LOCALVERARCHLIBDIR +#define OCTAVE_LOCALVERARCHLIBDIR %OCTAVE_LOCALVERARCHLIBDIR% +#endif + +#ifndef OCTAVE_LOCALVERFCNFILEDIR +#define OCTAVE_LOCALVERFCNFILEDIR %OCTAVE_LOCALVERFCNFILEDIR% +#endif + +#ifndef OCTAVE_LOCALVEROCTFILEDIR +#define OCTAVE_LOCALVEROCTFILEDIR %OCTAVE_LOCALVEROCTFILEDIR% +#endif + #ifndef OCTAVE_MAN1DIR #define OCTAVE_MAN1DIR %OCTAVE_MAN1DIR% #endif @@ -156,6 +168,7 @@ extern std::string Vlibexec_dir; extern std::string Varch_lib_dir; extern std::string Vlocal_arch_lib_dir; +extern std::string Vlocal_ver_arch_lib_dir; extern std::string Vfcn_file_dir; // The path that will be searched for programs that we execute.
--- a/src/octave.cc +++ b/src/octave.cc @@ -209,7 +209,7 @@ // Execute commands from the site-wide configuration file. // First from the file $(prefix)/lib/octave/site/m/octaverc // (if it exists), then from the file - // $(prefix)/lib/octave/$(version)/m/octaverc (if it exists). + // $(prefix)/share/octave/$(version)/m/octaverc (if it exists). parse_and_execute (Vlocal_site_defaults_file, verbose);
--- a/src/toplev.cc +++ b/src/toplev.cc @@ -698,6 +698,9 @@ m ["localoctfiledir"] = OCTAVE_LOCALOCTFILEDIR; m ["localoctfilepath"] = OCTAVE_LOCALOCTFILEPATH; m ["localstartupfiledir"] = OCTAVE_LOCALSTARTUPFILEDIR; + m ["localverarchlibdir"] = OCTAVE_LOCALVERARCHLIBDIR; + m ["localverfcnfiledir"] = OCTAVE_LOCALVERFCNFILEDIR; + m ["localveroctfiledir"] = OCTAVE_LOCALVEROCTFILEDIR; m ["man1dir"] = OCTAVE_MAN1DIR; m ["man1ext"] = OCTAVE_MAN1EXT; m ["mandir"] = OCTAVE_MANDIR;