# HG changeset patch # User jwe # Date 861141913 0 # Node ID 95e85daad1483dceba8e96cd83f1b9a798602782 # Parent 6dcb8e1c9bb21b2d19e6428907e85852da5492f4 [project @ 1997-04-15 22:00:57 by jwe] diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Tue Apr 8 12:38:18 1997 John W. Eaton + + * mkoctfile.in: Do substitute SH_LD and SH_LDFLAGS. Don't + substitute or use LIBFLAGS, RLD_FLAG, OCTAVE_LIBS, FLIBS, LEXLIB, + TERMLIBS, LIBS, LDFLAGS, LIBPLPLOT, or LIBDLFCN. Use $SH_LD and + $SH_LDFLAGS, not $CXX -shared. + + * Makeconf.in (do-subst-config-vals): Also substitute SH_LD and + SH_LDFLAGS. + Fri Mar 28 16:53:08 1997 John W. Eaton * configure.in: Don't add -fpe1 to FFLAGS on Alpha OSF/1 systems diff --git a/Makeconf.in b/Makeconf.in --- a/Makeconf.in +++ b/Makeconf.in @@ -294,41 +294,47 @@ $(foreach d, $(SUBDIRS), $(do-subdir-for-command)) endef +# Yes, the second sed command near the end is needed, to avoid limits +# in command lengths for some versions of sed. UGLY_DEFS is often +# quite large, so it makes sense to split this command there. + define do-subst-config-vals echo "making $@ from $<" sed < $< \ - -e "s;%VERSION%;\"${version}\";" \ - -e "s;%config_opts%;\"${config_opts}\";" \ - -e "s;%TARGET_HOST_TYPE%;\"${target_host_type}\";" \ - -e "s;%F77%;\"${F77}\";" \ - -e "s;%FFLAGS%;\"${FFLAGS}\";" \ - -e "s;%FPICFLAG%;\"${FPICFLAG}\";" \ - -e "s;%F2C%;\"${F2C}\";" \ - -e "s;%F2CFLAGS%;\"${F2CFLAGS}\";" \ - -e "s;%FLIBS%;\"${FLIBS}\";" \ - -e "s;%CPPFLAGS%;\"${CPPFLAGS}\";" \ - -e "s;%INCFLAGS%;\"-I${includedir} -I${octincludedir}\";" \ + -e "s;%BUG_CXXFLAGS%;\"${BUG_CXXFLAGS}\";" \ -e "s;%CC%;\"${CC}\";" \ -e "s;%CC_VERSION%;\"${CC_VERSION}\";" \ -e "s;%CFLAGS%;\"${BUG_CFLAGS}\";" \ -e "s;%CPICFLAG%;\"${CPICFLAG}\";" \ + -e "s;%CPPFLAGS%;\"${CPPFLAGS}\";" \ -e "s;%CXX%;\"${CXX}\";" \ - -e "s;%CXX_VERSION%;\"${CXX_VERSION}\";" \ -e "s;%CXXFLAGS%;\"${CXXFLAGS}\";" \ -e "s;%CXXPICFLAG%;\"${CXXPICFLAG}\";" \ - -e "s;%BUG_CXXFLAGS%;\"${BUG_CXXFLAGS}\";" \ + -e "s;%CXX_VERSION%;\"${CXX_VERSION}\";" \ + -e "s;%F2C%;\"${F2C}\";" \ + -e "s;%F2CFLAGS%;\"${F2CFLAGS}\";" \ + -e "s;%F77%;\"${F77}\";" \ + -e "s;%FFLAGS%;\"${FFLAGS}\";" \ + -e "s;%FLIBS%;\"${FLIBS}\";" \ + -e "s;%FPICFLAG%;\"${FPICFLAG}\";" \ + -e "s;%GCC_IEEE_FP_FLAG%;\"${GCC_IEEE_FP_FLAG}\";" \ -e "s;%HOST_CXXFLAGS%;\"${HOST_CXXFLAGS}\";" \ + -e "s;%INCFLAGS%;\"-I${includedir} -I${octincludedir}\";" \ + -e "s;%LDFLAGS%;\"${LDFLAGS}\";" \ + -e "s;%LEXLIB%;\"${LEXLIB}\";" \ + -e "s;%LIBDLFCN%;\"${LIBDLFCN}\";" \ + -e "s;%LIBFLAGS%;\"-L${libdir}\";" \ + -e "s;%LIBPLPLOT%;\"${LIBPLPLOT}\";" \ + -e "s;%LIBS%;\"${LIBS}\";" \ -e "s;%NO_IMPLICIT_TEMPLATES%;\"${NO_IMPLICIT_TEMPLATES}\";" \ - -e "s;%GCC_IEEE_FP_FLAG%;\"${GCC_IEEE_FP_FLAG}\";" \ - -e "s;%LDFLAGS%;\"${LDFLAGS}\";" \ - -e "s;%LIBFLAGS%;\"-L${libdir}\";" \ -e "s;%RLD_FLAG%;\"${RLD_FLAG}\";" \ + -e "s;%SH_LD%;\"${SH_LD}\";" \ + -e "s;%SH_LDFLAGS%;\"${SH_LDFLAGS}\";" \ + -e "s;%TARGET_HOST_TYPE%;\"${target_host_type}\";" \ -e "s;%TERMLIBS%;\"${TERMLIBS}\";" \ - -e "s;%LIBS%;\"${LIBS}\";" \ - -e "s;%LEXLIB%;\"${LEXLIB}\";" \ - -e "s;%LIBPLPLOT%;\"${LIBPLPLOT}\";" \ - -e "s;%LIBDLFCN%;\"${LIBDLFCN}\";" | sed \ - -e "s;%DEFS%;\"${UGLY_DEFS}\";" > $@.tmp + -e "s;%VERSION%;\"${version}\";" \ + -e "s;%config_opts%;\"${config_opts}\";" | \ + sed -e "s;%DEFS%;\"${UGLY_DEFS}\";" > $@.tmp $(top_srcdir)/move-if-change $@.tmp $@ endef @@ -336,22 +342,22 @@ echo "making $@ from $<" sed < $< > $@.tmp \ -e "s;%DEFAULT_PAGER%;\"${DEFAULT_PAGER}\";" \ - -e "s;%OCTAVE_PREFIX%;\"${prefix}\";" \ - -e "s;%OCTAVE_EXEC_PREFIX%;\"${exec_prefix}\";" \ + -e "s;%OCTAVE_ARCHLIBDIR%;\"${archlibdir}\";" \ + -e "s;%OCTAVE_BINDIR%;\"${bindir}\";" \ -e "s;%OCTAVE_DATADIR%;\"${datadir}\";" \ - -e "s;%OCTAVE_BINDIR%;\"${bindir}\";" \ - -e "s;%OCTAVE_LIBDIR%;\"${libdir}\";" \ + -e "s;%OCTAVE_EXEC_PREFIX%;\"${exec_prefix}\";" \ + -e "s;%OCTAVE_FCNFILEDIR%;\"${fcnfiledir}\";" \ + -e "s;%OCTAVE_FCNFILEPATH%;\"${fcnfilepath}\";" \ + -e "s;%OCTAVE_IMAGEPATH%;\"${imagepath}\";" \ -e "s;%OCTAVE_INFODIR%;\"${infodir}\";" \ -e "s;%OCTAVE_INFOFILE%;\"${infofile}\";" \ - -e "s;%OCTAVE_FCNFILEDIR%;\"${fcnfiledir}\";" \ + -e "s;%OCTAVE_LIBDIR%;\"${libdir}\";" \ + -e "s;%OCTAVE_LOCALARCHLIBDIR%;\"${localarchlibdir}\";" \ -e "s;%OCTAVE_LOCALFCNFILEDIR%;\"${localfcnfiledir}\";" \ -e "s;%OCTAVE_LOCALFCNFILEPATH%;\"${localfcnfilepath}\";" \ - -e "s;%OCTAVE_ARCHLIBDIR%;\"${archlibdir}\";" \ - -e "s;%OCTAVE_LOCALARCHLIBDIR%;\"${localarchlibdir}\";" \ + -e "s;%OCTAVE_LOCALOCTFILEPATH%;\"${localoctfilepath}\";" \ -e "s;%OCTAVE_OCTFILEDIR%;\"${octfiledir}\";" \ - -e "s;%OCTAVE_LOCALOCTFILEPATH%;\"${localoctfilepath}\";" \ - -e "s;%OCTAVE_FCNFILEPATH%;\"${fcnfilepath}\";" \ - -e "s;%OCTAVE_IMAGEPATH%;\"${imagepath}\";" \ + -e "s;%OCTAVE_PREFIX%;\"${prefix}\";" \ -e "s;%TARGET_HOST_TYPE%;\"${target_host_type}\";" $(top_srcdir)/move-if-change $@.tmp $@ endef diff --git a/PROJECTS b/PROJECTS --- a/PROJECTS +++ b/PROJECTS @@ -440,7 +440,7 @@ * Eliminate force_numeric and make_numeric functions. * Is Matrix::fortran_vec() really necessary? -b + * print_usage() should set error_state in most cases? * Make statements like this @@ -476,6 +476,8 @@ * On systems that support matherr(), make it possible for users to enable the printing of warning messages. + * Make it possible to mark variables and functions as read-only. + ------- History: ------- @@ -483,6 +485,11 @@ * Add an option to allow saving input from script files in the history list. + * Add an option to include information about the Octave session in + the history list. Possibly a time/date stamp and the current + Octave line number, appended as a comment (users should probably + be able to control the format). + * Fix history problems -- core dump if multiple processes are writing to the same history file? diff --git a/aclocal.m4 b/aclocal.m4 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -155,7 +155,7 @@ exists=true fi done - if $exists + if $exists; then arg= else case "$arg" in diff --git a/doc/interpreter/install.texi b/doc/interpreter/install.texi --- a/doc/interpreter/install.texi +++ b/doc/interpreter/install.texi @@ -56,18 +56,27 @@ Create shared libraries. If you are planning to use @code{--enable-lite-kernelel} or the dynamic loading features, you will probably want to use this option. It will make your @file{.oct} files -much smaller. You may also want to build a shared version of -@code{libg++}, if your system doesn't already have one. +much smaller. + +You may also want to build a shared version of @code{libg++}, if your +system doesn't already have one. Note that a patch is needed to build +shared versions of version 2.7.2 of @code{libg++} and @code{libstdc++} +on the HP-PA architecture. You can find the patch at +@url{ftp://ftp.cygnus.com/pub/g++/libg++-2.7.2-hppa-gcc-fix}. @item --enable-dl Use @code{dlopen} and friends to make Octave capable of dynamically linking externally compiled functions. This only works on systems that -actually have these functions. +actually have these functions. If you plan on using this feature, you +should probably also use @code{--enable-shared} to reduce the size of +your @file{.oct} files. @item --enable-shl Use @code{shl_load} and friends to make Octave capable of dynamically linking externally compiled functions. This only works on systems that -actually have these functions (only HP-UX systems). +actually have these functions (only HP-UX systems). If you plan on +using this feature, you should probably also use @code{--enable-shared} +to reduce the size of your @file{.oct} files. @item --enable-lite-kernel Compile smaller kernel. This currently requires the dynamic linking @@ -231,6 +240,14 @@ @code{ldso} package. @item +Building @file{.oct} files doesn't work. + +You should probably have a shared version of @code{libg++}. A patch is +needed to build shared versions of version 2.7.2 of @code{libg++} and +@code{libstdc++} on the HP-PA architecture. You can find the patch at +@url{ftp://ftp.cygnus.com/pub/g++/libg++-2.7.2-hppa-gcc-fix}. + +@item If you encounter errors like @smallexample diff --git a/mkoctfile.in b/mkoctfile.in --- a/mkoctfile.in +++ b/mkoctfile.in @@ -27,21 +27,8 @@ NO_IMPLICIT_TEMPLATES=%NO_IMPLICIT_TEMPLATES% GCC_IEEE_FP_FLAG=%GCC_IEEE_FP_FLAG% -LDFLAGS=%LDFLAGS% -LIBFLAGS=%LIBFLAGS% -RLD_FLAG=%RLD_FLAG% -FLIBS=%FLIBS% -LIBS=%LIBS% -LEXLIB=%LEXLIB% -TERMLIBS=%TERMLIBS% -LIBPLPLOT=%LIBPLPLOT% -LIBDLFCN=%LIBDLFCN% - -# For now, leave -lglob out (glob/Makefile.in needs to be fixed to -# install it. - -OCTAVE_LIBS="-loctinterp -loctave -ltinst -lcruft \ - $LIBPLPLOT -lreadline -lkpathsea $LIBDLFCN" +SH_LD=%SH_LD% +SH_LDFLAGS=%SH_LDFLAGS% ALL_CXXFLAGS="$INCFLAGS $HOST_CXXFLAGS $NO_IMPLICIT_TEMPLATES \ $GCC_IEEE_FP_FLAG $CXXFLAGS" @@ -52,4 +39,4 @@ echo "making $octfile from $objfile" -$CXX -shared -o $octfile $objfile $LIBFLAGS $RLD_FLAG $OCTAVE_LIBS $FLIBS $LEXLIB $TERMLIBS $LIBS +$SH_LD $SH_LDFLAGS -o $octfile $objfile diff --git a/src/Makefile.in b/src/Makefile.in --- a/src/Makefile.in +++ b/src/Makefile.in @@ -32,10 +32,10 @@ ifeq ($(OCTAVE_LITE), true) ifdef CXXPICFLAG %.oct : pic/%.o - $(CXX) $(SH_LDFLAGS) -o $@ $< + $(SH_LD) $(SH_LDFLAGS) -o $@ $< else %.oct : %.o - $(CXX) $(SH_LDFLAGS) -o $@ $< + $(SH_LD) $(SH_LDFLAGS) -o $@ $< endif endif diff --git a/src/dynamic-ld.cc b/src/dynamic-ld.cc --- a/src/dynamic-ld.cc +++ b/src/dynamic-ld.cc @@ -49,6 +49,7 @@ #include "error.h" #include "toplev.h" #include "pathsearch.h" +#include "oct-obj.h" #include "ov.h" #include "utils.h" #include "variables.h" @@ -57,12 +58,6 @@ #if defined (WITH_DYNAMIC_LINKING) -// XXX FIXME XXX -- need to provide some way to ensure that functions -// that we are going to use will use the same naming convention as -// Octave's internal functions. It needs to be simpler than the -// current DEFUN_DLD() macro, which assumes you know how to name the -// function, the struct, and the helper function. - static string mangle_octave_oct_file_name (const string& name) { @@ -200,12 +195,6 @@ return retval; } -void -init_dynamic_linker (void) -{ - // Nothing to do anymore... -} - /* ;;; Local Variables: *** ;;; mode: C++ *** diff --git a/src/dynamic-ld.h b/src/dynamic-ld.h --- a/src/dynamic-ld.h +++ b/src/dynamic-ld.h @@ -23,14 +23,14 @@ #if !defined (octave_dynamic_ld_h) #define octave_dynamic_ld_h 1 -#include "oct-obj.h" +#include + +class octave_value_list; typedef octave_value_list (*Octave_builtin_fcn)(const octave_value_list&, int); extern int load_octave_oct_file (const string& name); -extern void init_dynamic_linker (void); - #endif /* diff --git a/src/input.cc b/src/input.cc --- a/src/input.cc +++ b/src/input.cc @@ -444,12 +444,13 @@ char *buf = static_cast (malloc (max_size)); char *bufptr = buf; + int len = 0; do { if (fgets (bufptr, grow_size, curr_stream)) { - int len = strlen (bufptr); + len = strlen (bufptr); if (len == grow_size - 1) { @@ -475,7 +476,12 @@ retval = buf; } else - break; + { + if (len == 0) + free (buf); + + break; + } } while (! retval); } @@ -607,7 +613,15 @@ } } else if (chars_left == 0) - status = 0; + { + if (input_buf) + { + free (input_buf); + input_buf = 0; + } + + status = 0; + } else status = -1; diff --git a/src/octave.cc b/src/octave.cc --- a/src/octave.cc +++ b/src/octave.cc @@ -522,8 +522,6 @@ initialize_readline (); - init_dynamic_linker (); - if (! inhibit_startup_message) cout << OCTAVE_STARTUP_MESSAGE "\n" << endl; diff --git a/src/parse.y b/src/parse.y --- a/src/parse.y +++ b/src/parse.y @@ -381,10 +381,6 @@ %left UNARY PLUS_PLUS MINUS_MINUS EXPR_NOT %right POW EPOW -// There are 18 shift/reduce conflicts, ok? But this only works with -// bison... -// %expect 18 - // Where to start. %start input diff --git a/src/time.cc b/src/time.cc --- a/src/time.cc +++ b/src/time.cc @@ -54,13 +54,12 @@ m ["wday"] = static_cast (tm->tm_wday); m ["yday"] = static_cast (tm->tm_yday); m ["isdst"] = static_cast (tm->tm_isdst); + #if defined (HAVE_TM_ZONE) m ["zone"] = tm->tm_zone; #elif defined (HAVE_TZNAME) if (tm->tm_isdst == 0 || tm->tm_isdst == 1) m ["zone"] = tzname[tm->tm_isdst]; -#else - m ["zone"] = zone_name (tm); #endif return m; @@ -81,7 +80,8 @@ tm.tm_wday = static_cast (m ["wday"] . double_value ()); tm.tm_yday = static_cast (m ["yday"] . double_value ()); tm.tm_isdst = static_cast (m ["isdst"] . double_value ()); -#ifdef HAVE_TMZONE + +#if defined (HAVE_TM_ZONE) string tstr = m ["zone"] . string_value (); tm.tm_zone = tstr.c_str (); #endif @@ -98,11 +98,11 @@ time_t now; double fraction = 0.0; -#ifdef HAVE_GETTIMEOFDAY +#if defined (HAVE_GETTIMEOFDAY) struct timeval tp; -#ifdef GETTIMEOFDAY_NO_TZ +#if defined (GETTIMEOFDAY_NO_TZ) gettimeofday (&tp); #else gettimeofday (&tp, 0); diff --git a/src/toplev.cc b/src/toplev.cc --- a/src/toplev.cc +++ b/src/toplev.cc @@ -60,6 +60,7 @@ #include #include "oct-hist.h" #include "oct-map.h" +#include "oct-obj.h" #include "pager.h" #include "parse.h" #include "pathsearch.h"