# HG changeset patch # User jwe # Date 849833521 0 # Node ID bcdd6bf533ea4995acefa825f457eebc6f603b55 # Parent 9a1e59a60b5683e05c6aac10a080d9bddefc1333 [project @ 1996-12-06 00:51:31 by jwe] diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,13 @@ Thu Dec 5 11:05:02 1996 John W. Eaton + * Makeconf.in (ALL_LDFLAGS): Add $(FORTRAN_MAIN_FLAG). + * configure.in (FORTRAN_MAIN_FLAG): Substitute it. + * octave-bug.in: Prompt for abort, edit, list, or send. Get subject from message in case it has been edited. * configure.in: When looking for libf2c, provide definitions for - MAIN_ and MAIN__, just in case. + MAIN_ and MAIN__. Tue Dec 3 11:35:35 1996 John W. Eaton diff --git a/Makeconf.in b/Makeconf.in --- a/Makeconf.in +++ b/Makeconf.in @@ -53,6 +53,7 @@ FFLAGS = @FFLAGS@ FPICFLAG = @FPICFLAG@ FUGLY = @FUGLY@ +FORTRAN_MAIN_FLAG = @FORTRAN_MAIN_FLAG@ ALL_FFLAGS = $(FUGLY) $(FFLAGS) # cc and associated flags. @@ -109,7 +110,8 @@ LDFLAGS = @LDFLAGS@ LD_STATIC_FLAG = @LD_STATIC_FLAG@ -ALL_LDFLAGS = $(LIBFLAGS) $(GCC_IEEE_FP_FLAG) $(LD_STATIC_FLAG) $(LDFLAGS) +ALL_LDFLAGS = $(LIBFLAGS) $(FORTRAN_MAIN_FLAG) $(GCC_IEEE_FP_FLAG) \ + $(LD_STATIC_FLAG) $(LDFLAGS) RLD_FLAG = @RLD_FLAG@ diff --git a/configure.in b/configure.in --- 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.237 $) +AC_REVISION($Revision: 1.238 $) AC_PREREQ(2.9) AC_INIT(src/octave.cc) AC_CONFIG_HEADER(config.h) @@ -567,6 +567,7 @@ fi fi + f77_rules_frag=Makerules.f77 if $have_fortran_compiler; then changequote(,)dnl @@ -633,6 +634,16 @@ AC_MSG_ERROR([See the file INSTALL for more information.]) fi +FORTRAN_MAIN_FLAG= +case "$canonical_host_type" in + *-linux-*) + FORTRAN_MAIN_FLAG="-u MAIN__" + ;; +esac +if test -n "$FORTRAN_MAIN_FLAG"; then + AC_MSG_RESULT([defining FORTRAN_MAIN_FLAG to be $FORTRAN_MAIN_FLAG]) +fi + FC=$F77 AC_SUBST(FC) AC_SUBST(F77) @@ -641,6 +652,7 @@ AC_SUBST(FLIBS) AC_SUBST(F2C) AC_SUBST(F2CFLAGS) +AC_SUBST(FORTRAN_MAIN_FLAG) AC_SUBST_FILE(f77_rules_frag) ### Checks for header files. diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog --- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,5 +1,11 @@ Thu Dec 5 13:05:18 1996 John W. Eaton + * sun-utils.h: Don't declare MAIN_ or MAIN__ here. + * sun-utils.cc: Delete. + * f2c-main.c: New file + + * Makefile.in: Fix file name lists. + * CMatrix.cc (lssolve): Don't redeclare retval, resize it. Wed Dec 4 12:24:24 1996 John W. Eaton diff --git a/liboctave/Makefile.in b/liboctave/Makefile.in --- a/liboctave/Makefile.in +++ b/liboctave/Makefile.in @@ -62,12 +62,12 @@ SOURCES := Bounds.cc CollocWt.cc DAE.cc DASSL.cc FEGrid.cc FSQP.cc \ LinConst.cc LPsolve.cc LSODE.cc NLEqn.cc NPSOL.cc QPSOL.cc \ Quad.cc Range.cc acosh.c asinh.c atanh.c cmd-hist.cc \ - data-conv.cc dir-ops.cc erf.c erfc.c file-ops.cc \ + data-conv.cc dir-ops.cc erf.c erfc.c f2c-main.c file-ops.cc \ filemode.c gamma.c getopt.c getopt1.c idx-vector.cc lgamma.c \ lo-ieee.cc lo-mappers.cc lo-utils.cc mach-info.cc mkdir.c \ oct-alloc.cc oct-glob.cc oct-term.cc pathsearch.cc \ - prog-args.cc rename.c rmdir.c str-vec.cc sun-utils.cc \ - tempname.c tempnam.c \ + prog-args.cc rename.c rmdir.c str-vec.cc tempname.c \ + tempnam.c \ $(TEMPLATE_SRC) \ $(TI_SRC) \ $(MATRIX_SRC) diff --git a/liboctave/f2c-main.c b/liboctave/f2c-main.c new file mode 100644 --- /dev/null +++ b/liboctave/f2c-main.c @@ -0,0 +1,50 @@ +/* + +Copyright (C) 1996 John W. Eaton + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#include + +// I think that this is really only needed if linking to Fortran +// compiled libraries on a Sun. It also seems to be needed on +// some Linux/ELF systems with g77. It should never be called. + +#if defined (sun) +int +MAIN_ () +{ + assert (0); + return 0; +} +#elif defined (__linux__) +int +MAIN__ () +{ + assert (0); + return 0; +} +#endif + +/* +;;; Local Variables: *** +;;; mode: C++ *** +;;; End: *** +*/ + diff --git a/liboctave/sun-utils.cc b/liboctave/sun-utils.cc deleted file mode 100644 --- a/liboctave/sun-utils.cc +++ /dev/null @@ -1,52 +0,0 @@ -/* - -Copyright (C) 1996 John W. Eaton - -This file is part of Octave. - -Octave is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -Octave is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with Octave; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ - -#include - -#include "sun-utils.h" - -// I think that this is really only needed if linking to Fortran -// compiled libraries on a Sun. It also seems to be needed on -// Linux/ELF systems with g77. It should never be called. - -#if defined (sun) -int -MAIN_ () -{ - assert (0); - return 0; -} -#elif defined (linux) && defined (__ELF__) -int -MAIN__ () -{ - assert (0); - return 0; -} -#endif - -/* -;;; Local Variables: *** -;;; mode: C++ *** -;;; End: *** -*/ - diff --git a/liboctave/sun-utils.h b/liboctave/sun-utils.h --- a/liboctave/sun-utils.h +++ b/liboctave/sun-utils.h @@ -23,16 +23,6 @@ #if !defined (octave_sun_utils_h) #define octave_sun_utils_h 1 -// I think that this is really only needed if linking to Fortran -// compiled libraries on a Sun. It also seems to be needed on -// Linux/ELF systems with g77. It should never be called. - -#if defined (sun) -extern "C" int MAIN_ (); -#elif defined (linux) && defined (__ELF__) -extern "C" int MAIN__ (); -#endif - // This is only needed to dereference pointers to doubles if mixing // GCC and Sun f77/cc compiled code. See the GCC manual (where the // function access_double() is described) and the Sun f77 manual, diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +Thu Dec 5 18:36:44 1996 John W. Eaton + + * octave.cc: Don't include sun-utils.h. + Tue Dec 3 23:47:09 1996 John W. Eaton * op-str-str.cc (eq, ne): Handle operations with scalars. diff --git a/src/octave.cc b/src/octave.cc --- a/src/octave.cc +++ b/src/octave.cc @@ -49,7 +49,6 @@ #include "lo-error.h" #include "str-vec.h" -#include "sun-utils.h" #include "builtins.h" #include