summaryrefslogtreecommitdiffstats
path: root/contrib/libf2c/libF77
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>1999-09-18 10:51:31 +0000
committerobrien <obrien@FreeBSD.org>1999-09-18 10:51:31 +0000
commit98e51635e2084da6cfe0d3b1782cb95b80fd2caa (patch)
tree0938eb35cebcf917f447463078144fc4832576c6 /contrib/libf2c/libF77
parent0bedf4fb30066e5e1d4342a1d3914dae7d37cba7 (diff)
downloadFreeBSD-src-98e51635e2084da6cfe0d3b1782cb95b80fd2caa.zip
FreeBSD-src-98e51635e2084da6cfe0d3b1782cb95b80fd2caa.tar.gz
Virgin import of EGCS 1.1.2's libf2c
Diffstat (limited to 'contrib/libf2c/libF77')
-rw-r--r--contrib/libf2c/libF77/F77_aloc.c32
-rw-r--r--contrib/libf2c/libF77/Makefile.in124
-rw-r--r--contrib/libf2c/libF77/Notice23
-rw-r--r--contrib/libf2c/libF77/README.netlib108
-rw-r--r--contrib/libf2c/libF77/Version.c67
-rw-r--r--contrib/libf2c/libF77/abort_.c18
-rw-r--r--contrib/libf2c/libF77/c_abs.c14
-rw-r--r--contrib/libf2c/libF77/c_cos.c21
-rw-r--r--contrib/libf2c/libF77/c_div.c40
-rw-r--r--contrib/libf2c/libF77/c_exp.c23
-rw-r--r--contrib/libf2c/libF77/c_log.c21
-rw-r--r--contrib/libf2c/libF77/c_sin.c21
-rw-r--r--contrib/libf2c/libF77/c_sqrt.c38
-rw-r--r--contrib/libf2c/libF77/cabs.c27
-rwxr-xr-xcontrib/libf2c/libF77/configure1495
-rw-r--r--contrib/libf2c/libF77/configure.in107
-rw-r--r--contrib/libf2c/libF77/d_abs.c12
-rw-r--r--contrib/libf2c/libF77/d_acos.c13
-rw-r--r--contrib/libf2c/libF77/d_asin.c13
-rw-r--r--contrib/libf2c/libF77/d_atan.c13
-rw-r--r--contrib/libf2c/libF77/d_atn2.c13
-rw-r--r--contrib/libf2c/libF77/d_cnjg.c17
-rw-r--r--contrib/libf2c/libF77/d_cos.c13
-rw-r--r--contrib/libf2c/libF77/d_cosh.c13
-rw-r--r--contrib/libf2c/libF77/d_dim.c10
-rw-r--r--contrib/libf2c/libF77/d_exp.c13
-rw-r--r--contrib/libf2c/libF77/d_imag.c10
-rw-r--r--contrib/libf2c/libF77/d_int.c13
-rw-r--r--contrib/libf2c/libF77/d_lg10.c15
-rw-r--r--contrib/libf2c/libF77/d_log.c13
-rw-r--r--contrib/libf2c/libF77/d_mod.c40
-rw-r--r--contrib/libf2c/libF77/d_nint.c14
-rw-r--r--contrib/libf2c/libF77/d_prod.c10
-rw-r--r--contrib/libf2c/libF77/d_sign.c12
-rw-r--r--contrib/libf2c/libF77/d_sin.c13
-rw-r--r--contrib/libf2c/libF77/d_sinh.c13
-rw-r--r--contrib/libf2c/libF77/d_sqrt.c13
-rw-r--r--contrib/libf2c/libF77/d_tan.c13
-rw-r--r--contrib/libf2c/libF77/d_tanh.c13
-rw-r--r--contrib/libf2c/libF77/derf_.c12
-rw-r--r--contrib/libf2c/libF77/derfc_.c14
-rw-r--r--contrib/libf2c/libF77/dtime_.c47
-rw-r--r--contrib/libf2c/libF77/ef1asc_.c21
-rw-r--r--contrib/libf2c/libF77/ef1cmc_.c14
-rw-r--r--contrib/libf2c/libF77/erf_.c12
-rw-r--r--contrib/libf2c/libF77/erfc_.c12
-rw-r--r--contrib/libf2c/libF77/etime_.c40
-rw-r--r--contrib/libf2c/libF77/exit_.c37
-rw-r--r--contrib/libf2c/libF77/f2ch.add162
-rw-r--r--contrib/libf2c/libF77/getarg_.c28
-rw-r--r--contrib/libf2c/libF77/getenv_.c51
-rw-r--r--contrib/libf2c/libF77/h_abs.c12
-rw-r--r--contrib/libf2c/libF77/h_dim.c10
-rw-r--r--contrib/libf2c/libF77/h_dnnt.c13
-rw-r--r--contrib/libf2c/libF77/h_indx.c26
-rw-r--r--contrib/libf2c/libF77/h_len.c10
-rw-r--r--contrib/libf2c/libF77/h_mod.c10
-rw-r--r--contrib/libf2c/libF77/h_nint.c13
-rw-r--r--contrib/libf2c/libF77/h_sign.c12
-rw-r--r--contrib/libf2c/libF77/hl_ge.c12
-rw-r--r--contrib/libf2c/libF77/hl_gt.c12
-rw-r--r--contrib/libf2c/libF77/hl_le.c12
-rw-r--r--contrib/libf2c/libF77/hl_lt.c12
-rw-r--r--contrib/libf2c/libF77/i_abs.c12
-rw-r--r--contrib/libf2c/libF77/i_dim.c10
-rw-r--r--contrib/libf2c/libF77/i_dnnt.c13
-rw-r--r--contrib/libf2c/libF77/i_indx.c26
-rw-r--r--contrib/libf2c/libF77/i_len.c10
-rw-r--r--contrib/libf2c/libF77/i_mod.c10
-rw-r--r--contrib/libf2c/libF77/i_nint.c13
-rw-r--r--contrib/libf2c/libF77/i_sign.c12
-rw-r--r--contrib/libf2c/libF77/iargc_.c11
-rw-r--r--contrib/libf2c/libF77/l_ge.c12
-rw-r--r--contrib/libf2c/libF77/l_gt.c12
-rw-r--r--contrib/libf2c/libF77/l_le.c12
-rw-r--r--contrib/libf2c/libF77/l_lt.c12
-rw-r--r--contrib/libf2c/libF77/lbitbits.c62
-rw-r--r--contrib/libf2c/libF77/lbitshft.c11
-rw-r--r--contrib/libf2c/libF77/main.c68
-rw-r--r--contrib/libf2c/libF77/makefile.netlib103
-rw-r--r--contrib/libf2c/libF77/pow_ci.c20
-rw-r--r--contrib/libf2c/libF77/pow_dd.c13
-rw-r--r--contrib/libf2c/libF77/pow_di.c35
-rw-r--r--contrib/libf2c/libF77/pow_hh.c33
-rw-r--r--contrib/libf2c/libF77/pow_ii.c33
-rw-r--r--contrib/libf2c/libF77/pow_qq.c33
-rw-r--r--contrib/libf2c/libF77/pow_ri.c35
-rw-r--r--contrib/libf2c/libF77/pow_zi.c61
-rw-r--r--contrib/libf2c/libF77/pow_zz.c23
-rw-r--r--contrib/libf2c/libF77/qbitbits.c66
-rw-r--r--contrib/libf2c/libF77/qbitshft.c11
-rw-r--r--contrib/libf2c/libF77/r_abs.c12
-rw-r--r--contrib/libf2c/libF77/r_acos.c13
-rw-r--r--contrib/libf2c/libF77/r_asin.c13
-rw-r--r--contrib/libf2c/libF77/r_atan.c13
-rw-r--r--contrib/libf2c/libF77/r_atn2.c13
-rw-r--r--contrib/libf2c/libF77/r_cnjg.c16
-rw-r--r--contrib/libf2c/libF77/r_cos.c13
-rw-r--r--contrib/libf2c/libF77/r_cosh.c13
-rw-r--r--contrib/libf2c/libF77/r_dim.c10
-rw-r--r--contrib/libf2c/libF77/r_exp.c13
-rw-r--r--contrib/libf2c/libF77/r_imag.c10
-rw-r--r--contrib/libf2c/libF77/r_int.c13
-rw-r--r--contrib/libf2c/libF77/r_lg10.c15
-rw-r--r--contrib/libf2c/libF77/r_log.c13
-rw-r--r--contrib/libf2c/libF77/r_mod.c40
-rw-r--r--contrib/libf2c/libF77/r_nint.c14
-rw-r--r--contrib/libf2c/libF77/r_sign.c12
-rw-r--r--contrib/libf2c/libF77/r_sin.c13
-rw-r--r--contrib/libf2c/libF77/r_sinh.c13
-rw-r--r--contrib/libf2c/libF77/r_sqrt.c13
-rw-r--r--contrib/libf2c/libF77/r_tan.c13
-rw-r--r--contrib/libf2c/libF77/r_tanh.c13
-rw-r--r--contrib/libf2c/libF77/s_cat.c75
-rw-r--r--contrib/libf2c/libF77/s_cmp.c44
-rw-r--r--contrib/libf2c/libF77/s_copy.c51
-rw-r--r--contrib/libf2c/libF77/s_paus.c88
-rw-r--r--contrib/libf2c/libF77/s_rnge.c26
-rw-r--r--contrib/libf2c/libF77/s_stop.c37
-rw-r--r--contrib/libf2c/libF77/setarg.c29
-rw-r--r--contrib/libf2c/libF77/setsig.c101
-rw-r--r--contrib/libf2c/libF77/sig_die.c45
-rw-r--r--contrib/libf2c/libF77/signal1.h5
-rw-r--r--contrib/libf2c/libF77/signal1.h037
-rw-r--r--contrib/libf2c/libF77/signal_.c16
-rw-r--r--contrib/libf2c/libF77/system_.c36
-rw-r--r--contrib/libf2c/libF77/z_abs.c12
-rw-r--r--contrib/libf2c/libF77/z_cos.c19
-rw-r--r--contrib/libf2c/libF77/z_div.c39
-rw-r--r--contrib/libf2c/libF77/z_exp.c21
-rw-r--r--contrib/libf2c/libF77/z_log.c20
-rw-r--r--contrib/libf2c/libF77/z_sin.c19
-rw-r--r--contrib/libf2c/libF77/z_sqrt.c33
133 files changed, 4941 insertions, 0 deletions
diff --git a/contrib/libf2c/libF77/F77_aloc.c b/contrib/libf2c/libF77/F77_aloc.c
new file mode 100644
index 0000000..8754fe2
--- /dev/null
+++ b/contrib/libf2c/libF77/F77_aloc.c
@@ -0,0 +1,32 @@
+#include "f2c.h"
+#undef abs
+#undef min
+#undef max
+#include <stdio.h>
+
+static integer memfailure = 3;
+
+#ifdef KR_headers
+extern char *malloc();
+extern void G77_exit_0 ();
+
+ char *
+F77_aloc(Len, whence) integer Len; char *whence;
+#else
+#include <stdlib.h>
+extern void G77_exit_0 (integer*);
+
+ char *
+F77_aloc(integer Len, char *whence)
+#endif
+{
+ char *rv;
+ unsigned int uLen = (unsigned int) Len; /* for K&R C */
+
+ if (!(rv = (char*)malloc(uLen))) {
+ fprintf(stderr, "malloc(%u) failure in %s\n",
+ uLen, whence);
+ G77_exit_0 (&memfailure);
+ }
+ return rv;
+ }
diff --git a/contrib/libf2c/libF77/Makefile.in b/contrib/libf2c/libF77/Makefile.in
new file mode 100644
index 0000000..83ac3f9
--- /dev/null
+++ b/contrib/libf2c/libF77/Makefile.in
@@ -0,0 +1,124 @@
+# Makefile for GNU F77 compiler runtime.
+# Copyright 1990 - 1994 by AT&T Bell Laboratories and Bellcore (see the
+# file `Notice').
+# Portions of this file Copyright (C) 1995-1998 Free Software Foundation, Inc.
+# Contributed by Dave Love (d.love@dl.ac.uk).
+#
+#This file is part of GNU Fortran.
+#
+#GNU Fortran 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.
+#
+#GNU Fortran 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 GNU Fortran; see the file COPYING. If not, write to
+#the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+#02111-1307, USA.
+
+#### Start of system configuration section. ####
+
+# $(srcdir) must be set to the g77 runtime libF77 source directory.
+srcdir = @srcdir@
+VPATH = @srcdir@
+
+# configure sets this to all the -D options appropriate for the
+# configuration.
+DEFS = @DEFS@
+
+LIBG2C = ../libg2c.a
+
+F2C_H_DIR = @srcdir@/..
+G2C_H_DIR = ..
+CC = @CC@
+CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+AR = @AR@
+ARFLAGS = rc
+@SET_MAKE@
+
+SHELL = /bin/sh
+
+#### End of system configuration section. ####
+
+ALL_CFLAGS = -I. -I$(srcdir) -I$(G2C_H_DIR) -I$(F2C_H_DIR) $(CPPFLAGS) $(DEFS) $(CFLAGS)
+
+.SUFFIXES:
+.SUFFIXES: .c .o
+
+.c.o:
+ $(CC) -c -DSkip_f2c_Undefs $(ALL_CFLAGS) $<
+
+MISC = F77_aloc.o VersionF.o main.o s_rnge.o abort_.o getarg_.o iargc_.o\
+ getenv_.o signal_.o s_stop.o s_paus.o system_.o cabs.o\
+ derf_.o derfc_.o erf_.o erfc_.o sig_die.o exit_.o setarg.o setsig.o
+POW = pow_ci.o pow_dd.o pow_di.o pow_hh.o pow_ii.o pow_ri.o pow_zi.o pow_zz.o \
+ pow_qq.o
+CX = c_abs.o c_cos.o c_div.o c_exp.o c_log.o c_sin.o c_sqrt.o
+DCX = z_abs.o z_cos.o z_div.o z_exp.o z_log.o z_sin.o z_sqrt.o
+REAL = r_abs.o r_acos.o r_asin.o r_atan.o r_atn2.o r_cnjg.o r_cos.o\
+ r_cosh.o r_dim.o r_exp.o r_imag.o r_int.o\
+ r_lg10.o r_log.o r_mod.o r_nint.o r_sign.o\
+ r_sin.o r_sinh.o r_sqrt.o r_tan.o r_tanh.o
+DBL = d_abs.o d_acos.o d_asin.o d_atan.o d_atn2.o\
+ d_cnjg.o d_cos.o d_cosh.o d_dim.o d_exp.o\
+ d_imag.o d_int.o d_lg10.o d_log.o d_mod.o\
+ d_nint.o d_prod.o d_sign.o d_sin.o d_sinh.o\
+ d_sqrt.o d_tan.o d_tanh.o
+INT = i_abs.o i_dim.o i_dnnt.o i_indx.o i_len.o i_mod.o i_nint.o i_sign.o
+HALF = h_abs.o h_dim.o h_dnnt.o h_indx.o h_len.o h_mod.o h_nint.o h_sign.o
+CMP = l_ge.o l_gt.o l_le.o l_lt.o hl_ge.o hl_gt.o hl_le.o hl_lt.o
+EFL = ef1asc_.o ef1cmc_.o
+CHAR = s_cat.o s_cmp.o s_copy.o
+F90BIT = lbitbits.o lbitshft.o qbitbits.o qbitshft.o
+
+OBJS = $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) \
+ $(HALF) $(CMP) $(EFL) $(CHAR) $(F90BIT)
+
+all: ../s-libf77
+
+../s-libf77: $(OBJS)
+ echo timestamp > ../s-libf77
+
+archive:
+ $(AR) $(ARFLAGS) $(LIBG2C) $(OBJS)
+
+Makefile: Makefile.in config.status
+ $(SHELL) config.status
+
+config.status: configure
+ rm -f config.cache
+ CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \
+ CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
+
+${srcdir}/configure: configure.in
+ rm -f config.cache
+ cd ${srcdir} && autoconf
+
+VersionF.o: Version.c
+ $(CC) -c $(ALL_CFLAGS) -o $@ $(srcdir)/Version.c
+
+# Not quite all these actually do depend on f2c.h...
+$(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) $(HALF) $(CMP) $(EFL) \
+ $(CHAR) $(F90BIT): $(F2C_H_DIR)/f2c.h $(G2C_H_DIR)/g2c.h
+
+check install uninstall install-strip dist installcheck installdirs:
+
+mostlyclean:
+ rm -f *.o
+
+clean: mostlyclean
+ rm -f config.log
+
+distclean: clean
+ rm -f config.cache config.status Makefile ../s-libf77 configure
+
+maintainer-clean:
+
+.PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \
+ install-strip dist installcheck installdirs archive
diff --git a/contrib/libf2c/libF77/Notice b/contrib/libf2c/libF77/Notice
new file mode 100644
index 0000000..261b719
--- /dev/null
+++ b/contrib/libf2c/libF77/Notice
@@ -0,0 +1,23 @@
+/****************************************************************
+Copyright 1990 - 1997 by AT&T, Lucent Technologies and Bellcore.
+
+Permission to use, copy, modify, and distribute this software
+and its documentation for any purpose and without fee is hereby
+granted, provided that the above copyright notice appear in all
+copies and that both that the copyright notice and this
+permission notice and warranty disclaimer appear in supporting
+documentation, and that the names of AT&T, Bell Laboratories,
+Lucent or Bellcore or any of their entities not be used in
+advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+AT&T, Lucent and Bellcore disclaim all warranties with regard to
+this software, including all implied warranties of
+merchantability and fitness. In no event shall AT&T, Lucent or
+Bellcore be liable for any special, indirect or consequential
+damages or any damages whatsoever resulting from loss of use,
+data or profits, whether in an action of contract, negligence or
+other tortious action, arising out of or in connection with the
+use or performance of this software.
+****************************************************************/
+
diff --git a/contrib/libf2c/libF77/README.netlib b/contrib/libf2c/libF77/README.netlib
new file mode 100644
index 0000000..7668215
--- /dev/null
+++ b/contrib/libf2c/libF77/README.netlib
@@ -0,0 +1,108 @@
+If your compiler does not recognize ANSI C headers,
+compile with KR_headers defined: either add -DKR_headers
+to the definition of CFLAGS in the makefile, or insert
+
+#define KR_headers
+
+at the top of f2c.h , cabs.c , main.c , and sig_die.c .
+
+Under MS-DOS, compile s_paus.c with -DMSDOS.
+
+If you have a really ancient K&R C compiler that does not understand
+void, add -Dvoid=int to the definition of CFLAGS in the makefile.
+
+If you use a C++ compiler, first create a local f2c.h by appending
+f2ch.add to the usual f2c.h, e.g., by issuing the command
+ make f2c.h
+which assumes f2c.h is installed in /usr/include .
+
+If your system lacks onexit() and you are not using an ANSI C
+compiler, then you should compile main.c, s_paus.c, s_stop.c, and
+sig_die.c with NO_ONEXIT defined. See the comments about onexit in
+the makefile.
+
+If your system has a double drem() function such that drem(a,b)
+is the IEEE remainder function (with double a, b), then you may
+wish to compile r_mod.c and d_mod.c with IEEE_drem defined.
+On some systems, you may also need to compile with -Ddrem=remainder .
+
+To check for transmission errors, issue the command
+ make check
+This assumes you have the xsum program whose source, xsum.c,
+is distributed as part of "all from f2c/src". If you do not
+have xsum, you can obtain xsum.c by sending the following E-mail
+message to netlib@netlib.bell-labs.com
+ send xsum.c from f2c/src
+
+The makefile assumes you have installed f2c.h in a standard
+place (and does not cause recompilation when f2c.h is changed);
+f2c.h comes with "all from f2c" (the source for f2c) and is
+available separately ("f2c.h from f2c").
+
+Most of the routines in libF77 are support routines for Fortran
+intrinsic functions or for operations that f2c chooses not
+to do "in line". There are a few exceptions, summarized below --
+functions and subroutines that appear to your program as ordinary
+external Fortran routines.
+
+1. CALL ABORT prints a message and causes a core dump.
+
+2. ERF(r) and DERF(d) and the REAL and DOUBLE PRECISION
+ error functions (with x REAL and d DOUBLE PRECISION);
+ DERF must be declared DOUBLE PRECISION in your program.
+ Both ERF and DERF assume your C library provides the
+ underlying erf() function (which not all systems do).
+
+3. ERFC(r) and DERFC(d) are the complementary error functions:
+ ERFC(r) = 1 - ERF(r) and DERFC(d) = 1.d0 - DERFC(d)
+ (except that their results may be more accurate than
+ explicitly evaluating the above formulae would give).
+ Again, ERFC and r are REAL, and DERFC and d are DOUBLE
+ PRECISION (and must be declared as such in your program),
+ and ERFC and DERFC rely on your system's erfc().
+
+4. CALL GETARG(n,s), where n is an INTEGER and s is a CHARACTER
+ variable, sets s to the n-th command-line argument (or to
+ all blanks if there are fewer than n command-line arguments);
+ CALL GETARG(0,s) sets s to the name of the program (on systems
+ that support this feature). See IARGC below.
+
+5. CALL GETENV(name, value), where name and value are of type
+ CHARACTER, sets value to the environment value, $name, of
+ name (or to blanks if $name has not been set).
+
+6. NARGS = IARGC() sets NARGS to the number of command-line
+ arguments (an INTEGER value).
+
+7. CALL SIGNAL(n,func), where n is an INTEGER and func is an
+ EXTERNAL procedure, arranges for func to be invoked when
+ signal n occurs (on systems where this makes sense).
+
+8. CALL SYSTEM(cmd), where cmd is of type CHARACTER, passes
+ cmd to the system's command processor (on systems where
+ this can be done).
+
+The makefile does not attempt to compile pow_qq.c, qbitbits.c,
+and qbitshft.c, which are meant for use with INTEGER*8. To use
+INTEGER*8, you must modify f2c.h to declare longint and ulongint
+appropriately; then add pow_qq.o to the POW = line in the makefile,
+and add " qbitbits.o qbitshft.o" to the makefile's F90BIT = line.
+
+Following Fortran 90, s_cat.c and s_copy.c allow the target of a
+(character string) assignment to be appear on its right-hand, at
+the cost of some extra overhead for all run-time concatenations.
+If you prefer the extra efficiency that comes with the Fortran 77
+requirement that the left-hand side of a character assignment not
+be involved in the right-hand side, compile s_cat.c and s_copy.c
+with -DNO_OVERWRITE .
+
+If your system lacks a ranlib command, you don't need it.
+Either comment out the makefile's ranlib invocation, or install
+a harmless "ranlib" command somewhere in your PATH, such as the
+one-line shell script
+
+ exit 0
+
+or (on some systems)
+
+ exec /usr/bin/ar lts $1 >/dev/null
diff --git a/contrib/libf2c/libF77/Version.c b/contrib/libf2c/libF77/Version.c
new file mode 100644
index 0000000..3e46ce8
--- /dev/null
+++ b/contrib/libf2c/libF77/Version.c
@@ -0,0 +1,67 @@
+static char junk[] = "\n@(#)LIBF77 VERSION 19970919\n";
+
+/*
+*/
+
+char __G77_LIBF77_VERSION__[] = "0.5.24";
+
+/*
+2.00 11 June 1980. File version.c added to library.
+2.01 31 May 1988. s_paus() flushes stderr; names of hl_* fixed
+ [ d]erf[c ] added
+ 8 Aug. 1989: #ifdefs for f2c -i2 added to s_cat.c
+ 29 Nov. 1989: s_cmp returns long (for f2c)
+ 30 Nov. 1989: arg types from f2c.h
+ 12 Dec. 1989: s_rnge allows long names
+ 19 Dec. 1989: getenv_ allows unsorted environment
+ 28 Mar. 1990: add exit(0) to end of main()
+ 2 Oct. 1990: test signal(...) == SIG_IGN rather than & 01 in main
+ 17 Oct. 1990: abort() calls changed to sig_die(...,1)
+ 22 Oct. 1990: separate sig_die from main
+ 25 Apr. 1991: minor, theoretically invisible tweaks to s_cat, sig_die
+ 31 May 1991: make system_ return status
+ 18 Dec. 1991: change long to ftnlen (for -i2) many places
+ 28 Feb. 1992: repair z_sqrt.c (scribbled on input, gave wrong answer)
+ 18 July 1992: for n < 0, repair handling of 0**n in pow_[dr]i.c
+ and m**n in pow_hh.c and pow_ii.c;
+ catch SIGTRAP in main() for error msg before abort
+ 23 July 1992: switch to ANSI prototypes unless KR_headers is #defined
+ 23 Oct. 1992: fix botch in signal_.c (erroneous deref of 2nd arg);
+ change Cabs to f__cabs.
+ 12 March 1993: various tweaks for C++
+ 2 June 1994: adjust so abnormal terminations invoke f_exit just once
+ 16 Sept. 1994: s_cmp: treat characters as unsigned in comparisons.
+ 19 Sept. 1994: s_paus: flush after end of PAUSE; add -DMSDOS
+ 12 Jan. 1995: pow_[dhiqrz][hiq]: adjust x**i to work on machines
+ that sign-extend right shifts when i is the most
+ negative integer.
+ 26 Jan. 1995: adjust s_cat.c, s_copy.c to permit the left-hand side
+ of character assignments to appear on the right-hand
+ side (unless compiled with -DNO_OVERWRITE).
+ 27 Jan. 1995: minor tweak to s_copy.c: copy forward whenever
+ possible (for better cache behavior).
+ 30 May 1995: added subroutine exit(rc) integer rc. Version not changed.
+ 29 Aug. 1995: add F77_aloc.c; use it in s_cat.c and system_.c.
+ 6 Sept. 1995: fix return type of system_ under -DKR_headers.
+ 19 Dec. 1995: s_cat.c: fix bug when 2nd or later arg overlaps lhs.
+ 19 Mar. 1996: s_cat.c: supply missing break after overlap detection.
+ 13 May 1996: add [lq]bitbits.c and [lq]bitshft.c (f90 bit intrinsics).
+ 19 June 1996: add casts to unsigned in [lq]bitshft.c.
+ 26 Feb. 1997: adjust functions with a complex output argument
+ to permit aliasing it with input arguments.
+ (For now, at least, this is just for possible
+ benefit of g77.)
+ 4 April 1997: [cz]_div.c: tweaks invisible on most systems (that may
+ affect systems using gratuitous extra precision).
+ 19 Sept. 1997: [de]time_.c (Unix systems only): change return
+ type to double.
+*/
+
+#include <stdio.h>
+
+void
+g77__fvers__ ()
+{
+ fprintf (stderr, "__G77_LIBF77_VERSION__: %s", __G77_LIBF77_VERSION__);
+ fputs (junk, stderr);
+}
diff --git a/contrib/libf2c/libF77/abort_.c b/contrib/libf2c/libF77/abort_.c
new file mode 100644
index 0000000..8efdc42
--- /dev/null
+++ b/contrib/libf2c/libF77/abort_.c
@@ -0,0 +1,18 @@
+#include <stdio.h>
+#include "f2c.h"
+
+#ifdef KR_headers
+extern VOID sig_die();
+
+int G77_abort_0 ()
+#else
+extern void sig_die(char*,int);
+
+int G77_abort_0 (void)
+#endif
+{
+sig_die("Fortran abort routine called", 1);
+#ifdef __cplusplus
+return 0;
+#endif
+}
diff --git a/contrib/libf2c/libF77/c_abs.c b/contrib/libf2c/libF77/c_abs.c
new file mode 100644
index 0000000..041fbd3
--- /dev/null
+++ b/contrib/libf2c/libF77/c_abs.c
@@ -0,0 +1,14 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+extern double f__cabs();
+
+double c_abs(z) complex *z;
+#else
+extern double f__cabs(double, double);
+
+double c_abs(complex *z)
+#endif
+{
+return( f__cabs( z->r, z->i ) );
+}
diff --git a/contrib/libf2c/libF77/c_cos.c b/contrib/libf2c/libF77/c_cos.c
new file mode 100644
index 0000000..9e833c16
--- /dev/null
+++ b/contrib/libf2c/libF77/c_cos.c
@@ -0,0 +1,21 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+extern double sin(), cos(), sinh(), cosh();
+
+VOID c_cos(resx, z) complex *resx, *z;
+#else
+#undef abs
+#include <math.h>
+
+void c_cos(complex *resx, complex *z)
+#endif
+{
+complex res;
+
+res.r = cos(z->r) * cosh(z->i);
+res.i = - sin(z->r) * sinh(z->i);
+
+resx->r = res.r;
+resx->i = res.i;
+}
diff --git a/contrib/libf2c/libF77/c_div.c b/contrib/libf2c/libF77/c_div.c
new file mode 100644
index 0000000..9568354
--- /dev/null
+++ b/contrib/libf2c/libF77/c_div.c
@@ -0,0 +1,40 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+extern VOID sig_die();
+VOID c_div(resx, a, b)
+complex *a, *b, *resx;
+#else
+extern void sig_die(char*,int);
+void c_div(complex *resx, complex *a, complex *b)
+#endif
+{
+double ratio, den;
+double abr, abi;
+complex res;
+
+if( (abr = b->r) < 0.)
+ abr = - abr;
+if( (abi = b->i) < 0.)
+ abi = - abi;
+if( abr <= abi )
+ {
+ if(abi == 0)
+ sig_die("complex division by zero", 1);
+ ratio = (double)b->r / b->i ;
+ den = b->i * (1 + ratio*ratio);
+ res.r = (a->r*ratio + a->i) / den;
+ res.i = (a->i*ratio - a->r) / den;
+ }
+
+else
+ {
+ ratio = (double)b->i / b->r ;
+ den = b->r * (1 + ratio*ratio);
+ res.r = (a->r + a->i*ratio) / den;
+ res.i = (a->i - a->r*ratio) / den;
+ }
+
+resx->r = res.r;
+resx->i = res.i;
+}
diff --git a/contrib/libf2c/libF77/c_exp.c b/contrib/libf2c/libF77/c_exp.c
new file mode 100644
index 0000000..8d3d33d
--- /dev/null
+++ b/contrib/libf2c/libF77/c_exp.c
@@ -0,0 +1,23 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+extern double exp(), cos(), sin();
+
+ VOID c_exp(resx, z) complex *resx, *z;
+#else
+#undef abs
+#include <math.h>
+
+void c_exp(complex *resx, complex *z)
+#endif
+{
+double expx;
+complex res;
+
+expx = exp(z->r);
+res.r = expx * cos(z->i);
+res.i = expx * sin(z->i);
+
+resx->r = res.r;
+resx->i = res.i;
+}
diff --git a/contrib/libf2c/libF77/c_log.c b/contrib/libf2c/libF77/c_log.c
new file mode 100644
index 0000000..6715131
--- /dev/null
+++ b/contrib/libf2c/libF77/c_log.c
@@ -0,0 +1,21 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+extern double log(), f__cabs(), atan2();
+VOID c_log(resx, z) complex *resx, *z;
+#else
+#undef abs
+#include <math.h>
+extern double f__cabs(double, double);
+
+void c_log(complex *resx, complex *z)
+#endif
+{
+complex res;
+
+res.i = atan2(z->i, z->r);
+res.r = log( f__cabs(z->r, z->i) );
+
+resx->r = res.r;
+resx->i = res.i;
+}
diff --git a/contrib/libf2c/libF77/c_sin.c b/contrib/libf2c/libF77/c_sin.c
new file mode 100644
index 0000000..7bf3e39
--- /dev/null
+++ b/contrib/libf2c/libF77/c_sin.c
@@ -0,0 +1,21 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+extern double sin(), cos(), sinh(), cosh();
+
+VOID c_sin(resx, z) complex *resx, *z;
+#else
+#undef abs
+#include <math.h>
+
+void c_sin(complex *resx, complex *z)
+#endif
+{
+complex res;
+
+res.r = sin(z->r) * cosh(z->i);
+res.i = cos(z->r) * sinh(z->i);
+
+resx->r = res.r;
+resx->i = res.i;
+}
diff --git a/contrib/libf2c/libF77/c_sqrt.c b/contrib/libf2c/libF77/c_sqrt.c
new file mode 100644
index 0000000..775977a
--- /dev/null
+++ b/contrib/libf2c/libF77/c_sqrt.c
@@ -0,0 +1,38 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+extern double sqrt(), f__cabs();
+
+VOID c_sqrt(resx, z) complex *resx, *z;
+#else
+#undef abs
+#include <math.h>
+extern double f__cabs(double, double);
+
+void c_sqrt(complex *resx, complex *z)
+#endif
+{
+double mag, t;
+complex res;
+
+if( (mag = f__cabs(z->r, z->i)) == 0.)
+ res.r = res.i = 0.;
+else if(z->r > 0)
+ {
+ res.r = t = sqrt(0.5 * (mag + z->r) );
+ t = z->i / t;
+ res.i = 0.5 * t;
+ }
+else
+ {
+ t = sqrt(0.5 * (mag - z->r) );
+ if(z->i < 0)
+ t = -t;
+ res.i = t;
+ t = z->i / t;
+ res.r = 0.5 * t;
+ }
+
+resx->r = res.r;
+resx->i = res.i;
+}
diff --git a/contrib/libf2c/libF77/cabs.c b/contrib/libf2c/libF77/cabs.c
new file mode 100644
index 0000000..2fad044
--- /dev/null
+++ b/contrib/libf2c/libF77/cabs.c
@@ -0,0 +1,27 @@
+#ifdef KR_headers
+extern double sqrt();
+double f__cabs(real, imag) double real, imag;
+#else
+#undef abs
+#include <math.h>
+double f__cabs(double real, double imag)
+#endif
+{
+double temp;
+
+if(real < 0)
+ real = -real;
+if(imag < 0)
+ imag = -imag;
+if(imag > real){
+ temp = real;
+ real = imag;
+ imag = temp;
+}
+if((real+imag) == real)
+ return(real);
+
+temp = imag/real;
+temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/
+return(temp);
+}
diff --git a/contrib/libf2c/libF77/configure b/contrib/libf2c/libF77/configure
new file mode 100755
index 0000000..3f738bf
--- /dev/null
+++ b/contrib/libf2c/libF77/configure
@@ -0,0 +1,1495 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.12.1
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.12.1"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=getarg_.c
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+# For g77 we'll set CC to point at the built gcc, but this will get it into
+# the makefiles
+# Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:529: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="gcc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:558: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ ac_prog_rejected=no
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# -gt 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ set dummy "$ac_dir/$ac_word" "$@"
+ shift
+ ac_cv_prog_CC="$@"
+ fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:606: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext <<EOF
+#line 616 "configure"
+#include "confdefs.h"
+main(){return(0);}
+EOF
+if { (eval echo configure:620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ ac_cv_prog_cc_works=yes
+ # If we can't run a trivial program, we are probably using a cross compiler.
+ if (./conftest; exit) 2>/dev/null; then
+ ac_cv_prog_cc_cross=no
+ else
+ ac_cv_prog_cc_cross=yes
+ fi
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:640: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:645: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.c <<EOF
+#ifdef __GNUC__
+ yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:654: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ ac_cv_prog_gcc=yes
+else
+ ac_cv_prog_gcc=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+ GCC=yes
+ ac_test_CFLAGS="${CFLAGS+set}"
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS=
+ echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:669: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+ ac_cv_prog_cc_g=yes
+else
+ ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+ if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+ elif test $ac_cv_prog_cc_g = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-O2"
+ fi
+else
+ GCC=
+ test "${CFLAGS+set}" = set || CFLAGS="-g"
+fi
+
+
+test "$AR" || AR=ar
+
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:700: checking whether ${MAKE-make} sets \${MAKE}" >&5
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftestmake <<\EOF
+all:
+ @echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ SET_MAKE=
+else
+ echo "$ac_t""no" 1>&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+
+# Sanity check for the cross-compilation case:
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:730: checking how to run the C preprocessor" >&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # This must be in double quotes, not single quotes, because CPP may get
+ # substituted into the Makefile and "${CC-cc}" will confuse make.
+ CPP="${CC-cc} -E"
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp.
+ cat > conftest.$ac_ext <<EOF
+#line 745 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:751: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -E -traditional-cpp"
+ cat > conftest.$ac_ext <<EOF
+#line 762 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:768: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP=/lib/cpp
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+ ac_cv_prog_CPP="$CPP"
+fi
+ CPP="$ac_cv_prog_CPP"
+else
+ ac_cv_prog_CPP="$CPP"
+fi
+echo "$ac_t""$CPP" 1>&6
+
+ac_safe=`echo "stdio.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for stdio.h""... $ac_c" 1>&6
+echo "configure:792: checking for stdio.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 797 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:802: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+else
+ echo "$ac_t""no" 1>&6
+{ echo "configure: error: Can't find stdio.h.
+You must have a usable C system for the target already installed, at least
+including headers and, preferably, the library, before you can configure
+the G77 runtime system. If necessary, install gcc now with \`LANGUAGES=c',
+then the target library, then build with \`LANGUAGES=f77'." 1>&2; exit 1; }
+fi
+
+
+echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
+echo "configure:830: checking for ANSI C header files" >&5
+if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 835 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:843: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ ac_cv_header_stdc=yes
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 860 "configure"
+#include "confdefs.h"
+#include <string.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "memchr" >/dev/null 2>&1; then
+ :
+else
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 878 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "free" >/dev/null 2>&1; then
+ :
+else
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+if test "$cross_compiling" = yes; then
+ :
+else
+ cat > conftest.$ac_ext <<EOF
+#line 899 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int main () { int i; for (i = 0; i < 256; i++)
+if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
+exit (0); }
+
+EOF
+if { (eval echo configure:910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_header_stdc=no
+fi
+rm -fr conftest*
+fi
+
+fi
+fi
+
+echo "$ac_t""$ac_cv_header_stdc" 1>&6
+if test $ac_cv_header_stdc = yes; then
+ cat >> confdefs.h <<\EOF
+#define STDC_HEADERS 1
+EOF
+
+fi
+
+
+echo $ac_n "checking for posix""... $ac_c" 1>&6
+echo "configure:935: checking for posix" >&5
+if eval "test \"`echo '$''{'g77_cv_header_posix'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 940 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <unistd.h>
+#ifdef _POSIX_VERSION
+ yes
+#endif
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "yes" >/dev/null 2>&1; then
+ rm -rf conftest*
+ g77_cv_header_posix=yes
+else
+ rm -rf conftest*
+ g77_cv_header_posix=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$g77_cv_header_posix" 1>&6
+
+# We can rely on the GNU library being posix-ish. I guess checking the
+# header isn't actually like checking the functions, though...
+echo $ac_n "checking for GNU library""... $ac_c" 1>&6
+echo "configure:966: checking for GNU library" >&5
+if eval "test \"`echo '$''{'g77_cv_lib_gnu'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 971 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+#ifdef __GNU_LIBRARY__
+ yes
+#endif
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "yes" >/dev/null 2>&1; then
+ rm -rf conftest*
+ g77_cv_lib_gnu=yes
+else
+ rm -rf conftest*
+ g77_cv_lib_gnu=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$g77_cv_lib_gnu" 1>&6
+
+echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
+echo "configure:994: checking return type of signal handlers" >&5
+if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 999 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <signal.h>
+#ifdef signal
+#undef signal
+#endif
+#ifdef __cplusplus
+extern "C" void (*signal (int, void (*)(int)))(int);
+#else
+void (*signal ()) ();
+#endif
+
+int main() {
+int i;
+; return 0; }
+EOF
+if { (eval echo configure:1016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_type_signal=void
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_type_signal=int
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_type_signal" 1>&6
+cat >> confdefs.h <<EOF
+#define RETSIGTYPE $ac_cv_type_signal
+EOF
+
+
+# we'll get atexit by default
+if test $ac_cv_header_stdc != yes; then
+echo $ac_n "checking for atexit""... $ac_c" 1>&6
+echo "configure:1037: checking for atexit" >&5
+if eval "test \"`echo '$''{'ac_cv_func_atexit'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1042 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char atexit(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char atexit();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_atexit) || defined (__stub___atexit)
+choke me
+#else
+atexit();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_func_atexit=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_atexit=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'atexit`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define onexit atexit
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+ cat >> confdefs.h <<\EOF
+#define NO_ONEXIT 1
+EOF
+
+ echo $ac_n "checking for onexit""... $ac_c" 1>&6
+echo "configure:1090: checking for onexit" >&5
+if eval "test \"`echo '$''{'ac_cv_func_onexit'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1095 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char onexit(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char onexit();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_onexit) || defined (__stub___onexit)
+choke me
+#else
+onexit();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_func_onexit=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_onexit=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'onexit`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+else
+ echo "$ac_t""no" 1>&6
+echo $ac_n "checking for on_exit""... $ac_c" 1>&6
+echo "configure:1136: checking for on_exit" >&5
+if eval "test \"`echo '$''{'ac_cv_func_on_exit'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1141 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char on_exit(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char on_exit();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_on_exit) || defined (__stub___on_exit)
+choke me
+#else
+on_exit();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_func_on_exit=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_on_exit=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'on_exit`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define onexit on_exit
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+fi
+
+else true
+fi
+
+echo $ac_n "checking for drem in -lm""... $ac_c" 1>&6
+echo "configure:1194: checking for drem in -lm" >&5
+ac_lib_var=`echo m'_'drem | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lm $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1202 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char drem();
+
+int main() {
+drem()
+; return 0; }
+EOF
+if { (eval echo configure:1213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define IEEE_drem 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+cat >> confdefs.h <<\EOF
+#define Skip_f2c_Undefs 1
+EOF
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+
+trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@CC@%$CC%g
+s%@AR@%$AR%g
+s%@SET_MAKE@%$SET_MAKE%g
+s%@CPP@%$CPP%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
+
diff --git a/contrib/libf2c/libF77/configure.in b/contrib/libf2c/libF77/configure.in
new file mode 100644
index 0000000..660fb1a
--- /dev/null
+++ b/contrib/libf2c/libF77/configure.in
@@ -0,0 +1,107 @@
+# Process this file with autoconf to produce a configure script.
+# Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc.
+# Contributed by Dave Love (d.love@dl.ac.uk).
+#
+#This file is part of GNU Fortran.
+#
+#GNU Fortran 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.
+#
+#GNU Fortran 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 GNU Fortran; see the file COPYING. If not, write to
+#the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+#02111-1307, USA.
+
+AC_INIT(getarg_.c)
+
+dnl Checks for programs.
+# For g77 we'll set CC to point at the built gcc, but this will get it into
+# the makefiles
+AC_PROG_CC
+
+test "$AR" || AR=ar
+AC_SUBST(AR)
+AC_PROG_MAKE_SET
+
+dnl Checks for libraries.
+
+dnl Checks for header files.
+# Sanity check for the cross-compilation case:
+AC_CHECK_HEADER(stdio.h,:,
+ [AC_MSG_ERROR([Can't find stdio.h.
+You must have a usable C system for the target already installed, at least
+including headers and, preferably, the library, before you can configure
+the G77 runtime system. If necessary, install gcc now with \`LANGUAGES=c',
+then the target library, then build with \`LANGUAGES=f77'.])])
+
+AC_HEADER_STDC
+dnl We could do this if we didn't know we were using gcc
+dnl AC_MSG_CHECKING(for prototype-savvy compiler)
+dnl AC_CACHE_VAL(g77_cv_sys_proto,
+dnl [AC_TRY_LINK(,
+dnl dnl looks screwy because TRY_LINK expects a function body
+dnl [return 0;} int foo (int * bar) {],
+dnl g77_cv_sys_proto=yes,
+dnl [g77_cv_sys_proto=no
+dnl AC_DEFINE(KR_headers)])])
+dnl AC_MSG_RESULT($g77_cv_sys_proto)
+
+AC_MSG_CHECKING(for posix)
+AC_CACHE_VAL(g77_cv_header_posix,
+ AC_EGREP_CPP(yes,
+ [#include <sys/types.h>
+#include <unistd.h>
+#ifdef _POSIX_VERSION
+ yes
+#endif
+],
+ g77_cv_header_posix=yes,
+ g77_cv_header_posix=no))
+AC_MSG_RESULT($g77_cv_header_posix)
+
+# We can rely on the GNU library being posix-ish. I guess checking the
+# header isn't actually like checking the functions, though...
+AC_MSG_CHECKING(for GNU library)
+AC_CACHE_VAL(g77_cv_lib_gnu,
+ AC_EGREP_CPP(yes,
+ [#include <stdio.h>
+#ifdef __GNU_LIBRARY__
+ yes
+#endif
+],
+ g77_cv_lib_gnu=yes, g77_cv_lib_gnu=no))
+AC_MSG_RESULT($g77_cv_lib_gnu)
+
+dnl Checks for library functions.
+AC_TYPE_SIGNAL
+# we'll get atexit by default
+if test $ac_cv_header_stdc != yes; then
+AC_CHECK_FUNC(atexit,
+ AC_DEFINE(onexit,atexit),dnl just in case
+ [AC_DEFINE(NO_ONEXIT)
+ AC_CHECK_FUNC(onexit,,
+ [AC_CHECK_FUNC(on_exit,
+ AC_DEFINE(onexit,on_exit),)])])
+else true
+fi
+
+dnl perhaps should check also for remainder
+dnl Unfortunately, the message implies we're just checking for -lm...
+AC_CHECK_LIB(m,drem,AC_DEFINE(IEEE_drem))
+
+AC_DEFINE(Skip_f2c_Undefs)
+
+AC_OUTPUT(Makefile)
+
+dnl Local Variables:
+dnl comment-start: "dnl "
+dnl comment-end: ""
+dnl comment-start-skip: "\\bdnl\\b\\s *"
+dnl End:
diff --git a/contrib/libf2c/libF77/d_abs.c b/contrib/libf2c/libF77/d_abs.c
new file mode 100644
index 0000000..cb157e0
--- /dev/null
+++ b/contrib/libf2c/libF77/d_abs.c
@@ -0,0 +1,12 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double d_abs(x) doublereal *x;
+#else
+double d_abs(doublereal *x)
+#endif
+{
+if(*x >= 0)
+ return(*x);
+return(- *x);
+}
diff --git a/contrib/libf2c/libF77/d_acos.c b/contrib/libf2c/libF77/d_acos.c
new file mode 100644
index 0000000..33da536
--- /dev/null
+++ b/contrib/libf2c/libF77/d_acos.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double acos();
+double d_acos(x) doublereal *x;
+#else
+#undef abs
+#include <math.h>
+double d_acos(doublereal *x)
+#endif
+{
+return( acos(*x) );
+}
diff --git a/contrib/libf2c/libF77/d_asin.c b/contrib/libf2c/libF77/d_asin.c
new file mode 100644
index 0000000..79b33ca
--- /dev/null
+++ b/contrib/libf2c/libF77/d_asin.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double asin();
+double d_asin(x) doublereal *x;
+#else
+#undef abs
+#include <math.h>
+double d_asin(doublereal *x)
+#endif
+{
+return( asin(*x) );
+}
diff --git a/contrib/libf2c/libF77/d_atan.c b/contrib/libf2c/libF77/d_atan.c
new file mode 100644
index 0000000..caea4a4
--- /dev/null
+++ b/contrib/libf2c/libF77/d_atan.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double atan();
+double d_atan(x) doublereal *x;
+#else
+#undef abs
+#include <math.h>
+double d_atan(doublereal *x)
+#endif
+{
+return( atan(*x) );
+}
diff --git a/contrib/libf2c/libF77/d_atn2.c b/contrib/libf2c/libF77/d_atn2.c
new file mode 100644
index 0000000..6748a55
--- /dev/null
+++ b/contrib/libf2c/libF77/d_atn2.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double atan2();
+double d_atn2(x,y) doublereal *x, *y;
+#else
+#undef abs
+#include <math.h>
+double d_atn2(doublereal *x, doublereal *y)
+#endif
+{
+return( atan2(*x,*y) );
+}
diff --git a/contrib/libf2c/libF77/d_cnjg.c b/contrib/libf2c/libF77/d_cnjg.c
new file mode 100644
index 0000000..1afa3bc
--- /dev/null
+++ b/contrib/libf2c/libF77/d_cnjg.c
@@ -0,0 +1,17 @@
+#include "f2c.h"
+
+ VOID
+#ifdef KR_headers
+d_cnjg(resx, z) doublecomplex *resx, *z;
+#else
+d_cnjg(doublecomplex *resx, doublecomplex *z)
+#endif
+{
+doublecomplex res;
+
+res.r = z->r;
+res.i = - z->i;
+
+resx->r = res.r;
+resx->i = res.i;
+}
diff --git a/contrib/libf2c/libF77/d_cos.c b/contrib/libf2c/libF77/d_cos.c
new file mode 100644
index 0000000..fa4d6ca
--- /dev/null
+++ b/contrib/libf2c/libF77/d_cos.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double cos();
+double d_cos(x) doublereal *x;
+#else
+#undef abs
+#include <math.h>
+double d_cos(doublereal *x)
+#endif
+{
+return( cos(*x) );
+}
diff --git a/contrib/libf2c/libF77/d_cosh.c b/contrib/libf2c/libF77/d_cosh.c
new file mode 100644
index 0000000..edc0ebc
--- /dev/null
+++ b/contrib/libf2c/libF77/d_cosh.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double cosh();
+double d_cosh(x) doublereal *x;
+#else
+#undef abs
+#include <math.h>
+double d_cosh(doublereal *x)
+#endif
+{
+return( cosh(*x) );
+}
diff --git a/contrib/libf2c/libF77/d_dim.c b/contrib/libf2c/libF77/d_dim.c
new file mode 100644
index 0000000..1d0ecb7
--- /dev/null
+++ b/contrib/libf2c/libF77/d_dim.c
@@ -0,0 +1,10 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double d_dim(a,b) doublereal *a, *b;
+#else
+double d_dim(doublereal *a, doublereal *b)
+#endif
+{
+return( *a > *b ? *a - *b : 0);
+}
diff --git a/contrib/libf2c/libF77/d_exp.c b/contrib/libf2c/libF77/d_exp.c
new file mode 100644
index 0000000..be12fd7
--- /dev/null
+++ b/contrib/libf2c/libF77/d_exp.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double exp();
+double d_exp(x) doublereal *x;
+#else
+#undef abs
+#include <math.h>
+double d_exp(doublereal *x)
+#endif
+{
+return( exp(*x) );
+}
diff --git a/contrib/libf2c/libF77/d_imag.c b/contrib/libf2c/libF77/d_imag.c
new file mode 100644
index 0000000..793a3f9
--- /dev/null
+++ b/contrib/libf2c/libF77/d_imag.c
@@ -0,0 +1,10 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double d_imag(z) doublecomplex *z;
+#else
+double d_imag(doublecomplex *z)
+#endif
+{
+return(z->i);
+}
diff --git a/contrib/libf2c/libF77/d_int.c b/contrib/libf2c/libF77/d_int.c
new file mode 100644
index 0000000..beff1e7
--- /dev/null
+++ b/contrib/libf2c/libF77/d_int.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double floor();
+double d_int(x) doublereal *x;
+#else
+#undef abs
+#include <math.h>
+double d_int(doublereal *x)
+#endif
+{
+return( (*x>0) ? floor(*x) : -floor(- *x) );
+}
diff --git a/contrib/libf2c/libF77/d_lg10.c b/contrib/libf2c/libF77/d_lg10.c
new file mode 100644
index 0000000..c0892bd
--- /dev/null
+++ b/contrib/libf2c/libF77/d_lg10.c
@@ -0,0 +1,15 @@
+#include "f2c.h"
+
+#define log10e 0.43429448190325182765
+
+#ifdef KR_headers
+double log();
+double d_lg10(x) doublereal *x;
+#else
+#undef abs
+#include <math.h>
+double d_lg10(doublereal *x)
+#endif
+{
+return( log10e * log(*x) );
+}
diff --git a/contrib/libf2c/libF77/d_log.c b/contrib/libf2c/libF77/d_log.c
new file mode 100644
index 0000000..592015b
--- /dev/null
+++ b/contrib/libf2c/libF77/d_log.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double log();
+double d_log(x) doublereal *x;
+#else
+#undef abs
+#include <math.h>
+double d_log(doublereal *x)
+#endif
+{
+return( log(*x) );
+}
diff --git a/contrib/libf2c/libF77/d_mod.c b/contrib/libf2c/libF77/d_mod.c
new file mode 100644
index 0000000..23f1929
--- /dev/null
+++ b/contrib/libf2c/libF77/d_mod.c
@@ -0,0 +1,40 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+#ifdef IEEE_drem
+double drem();
+#else
+double floor();
+#endif
+double d_mod(x,y) doublereal *x, *y;
+#else
+#ifdef IEEE_drem
+double drem(double, double);
+#else
+#undef abs
+#include <math.h>
+#endif
+double d_mod(doublereal *x, doublereal *y)
+#endif
+{
+#ifdef IEEE_drem
+ double xa, ya, z;
+ if ((ya = *y) < 0.)
+ ya = -ya;
+ z = drem(xa = *x, ya);
+ if (xa > 0) {
+ if (z < 0)
+ z += ya;
+ }
+ else if (z > 0)
+ z -= ya;
+ return z;
+#else
+ double quotient;
+ if( (quotient = *x / *y) >= 0)
+ quotient = floor(quotient);
+ else
+ quotient = -floor(-quotient);
+ return(*x - (*y) * quotient );
+#endif
+}
diff --git a/contrib/libf2c/libF77/d_nint.c b/contrib/libf2c/libF77/d_nint.c
new file mode 100644
index 0000000..064beff
--- /dev/null
+++ b/contrib/libf2c/libF77/d_nint.c
@@ -0,0 +1,14 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double floor();
+double d_nint(x) doublereal *x;
+#else
+#undef abs
+#include <math.h>
+double d_nint(doublereal *x)
+#endif
+{
+return( (*x)>=0 ?
+ floor(*x + .5) : -floor(.5 - *x) );
+}
diff --git a/contrib/libf2c/libF77/d_prod.c b/contrib/libf2c/libF77/d_prod.c
new file mode 100644
index 0000000..3d4cef7
--- /dev/null
+++ b/contrib/libf2c/libF77/d_prod.c
@@ -0,0 +1,10 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double d_prod(x,y) real *x, *y;
+#else
+double d_prod(real *x, real *y)
+#endif
+{
+return( (*x) * (*y) );
+}
diff --git a/contrib/libf2c/libF77/d_sign.c b/contrib/libf2c/libF77/d_sign.c
new file mode 100644
index 0000000..514ff0b
--- /dev/null
+++ b/contrib/libf2c/libF77/d_sign.c
@@ -0,0 +1,12 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double d_sign(a,b) doublereal *a, *b;
+#else
+double d_sign(doublereal *a, doublereal *b)
+#endif
+{
+double x;
+x = (*a >= 0 ? *a : - *a);
+return( *b >= 0 ? x : -x);
+}
diff --git a/contrib/libf2c/libF77/d_sin.c b/contrib/libf2c/libF77/d_sin.c
new file mode 100644
index 0000000..fdd699e
--- /dev/null
+++ b/contrib/libf2c/libF77/d_sin.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double sin();
+double d_sin(x) doublereal *x;
+#else
+#undef abs
+#include <math.h>
+double d_sin(doublereal *x)
+#endif
+{
+return( sin(*x) );
+}
diff --git a/contrib/libf2c/libF77/d_sinh.c b/contrib/libf2c/libF77/d_sinh.c
new file mode 100644
index 0000000..77f3690
--- /dev/null
+++ b/contrib/libf2c/libF77/d_sinh.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double sinh();
+double d_sinh(x) doublereal *x;
+#else
+#undef abs
+#include <math.h>
+double d_sinh(doublereal *x)
+#endif
+{
+return( sinh(*x) );
+}
diff --git a/contrib/libf2c/libF77/d_sqrt.c b/contrib/libf2c/libF77/d_sqrt.c
new file mode 100644
index 0000000..b5cf83b
--- /dev/null
+++ b/contrib/libf2c/libF77/d_sqrt.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double sqrt();
+double d_sqrt(x) doublereal *x;
+#else
+#undef abs
+#include <math.h>
+double d_sqrt(doublereal *x)
+#endif
+{
+return( sqrt(*x) );
+}
diff --git a/contrib/libf2c/libF77/d_tan.c b/contrib/libf2c/libF77/d_tan.c
new file mode 100644
index 0000000..af94a05
--- /dev/null
+++ b/contrib/libf2c/libF77/d_tan.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double tan();
+double d_tan(x) doublereal *x;
+#else
+#undef abs
+#include <math.h>
+double d_tan(doublereal *x)
+#endif
+{
+return( tan(*x) );
+}
diff --git a/contrib/libf2c/libF77/d_tanh.c b/contrib/libf2c/libF77/d_tanh.c
new file mode 100644
index 0000000..92a02d4
--- /dev/null
+++ b/contrib/libf2c/libF77/d_tanh.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double tanh();
+double d_tanh(x) doublereal *x;
+#else
+#undef abs
+#include <math.h>
+double d_tanh(doublereal *x)
+#endif
+{
+return( tanh(*x) );
+}
diff --git a/contrib/libf2c/libF77/derf_.c b/contrib/libf2c/libF77/derf_.c
new file mode 100644
index 0000000..fba6b6b
--- /dev/null
+++ b/contrib/libf2c/libF77/derf_.c
@@ -0,0 +1,12 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double erf();
+double G77_derf_0 (x) doublereal *x;
+#else
+extern double erf(double);
+double G77_derf_0 (doublereal *x)
+#endif
+{
+return( erf(*x) );
+}
diff --git a/contrib/libf2c/libF77/derfc_.c b/contrib/libf2c/libF77/derfc_.c
new file mode 100644
index 0000000..ae1ac74
--- /dev/null
+++ b/contrib/libf2c/libF77/derfc_.c
@@ -0,0 +1,14 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+extern double erfc();
+
+double G77_derfc_0 (x) doublereal *x;
+#else
+extern double erfc(double);
+
+double G77_derfc_0 (doublereal *x)
+#endif
+{
+return( erfc(*x) );
+}
diff --git a/contrib/libf2c/libF77/dtime_.c b/contrib/libf2c/libF77/dtime_.c
new file mode 100644
index 0000000..95db94f
--- /dev/null
+++ b/contrib/libf2c/libF77/dtime_.c
@@ -0,0 +1,47 @@
+#include "time.h"
+#ifndef USE_CLOCK
+#define _INCLUDE_POSIX_SOURCE /* for HP-UX */
+#define _INCLUDE_XOPEN_SOURCE /* for HP-UX */
+#include "sys/types.h"
+#include "sys/times.h"
+#endif
+
+#undef Hz
+#ifdef CLK_TCK
+#define Hz CLK_TCK
+#else
+#ifdef HZ
+#define Hz HZ
+#else
+#define Hz 60
+#endif
+#endif
+
+ double
+#ifdef KR_headers
+dtime_(tarray) float *tarray;
+#else
+dtime_(float *tarray)
+#endif
+{
+#ifdef USE_CLOCK
+#ifndef CLOCKS_PER_SECOND
+#define CLOCKS_PER_SECOND Hz
+#endif
+ static double t0;
+ double t = clock();
+ tarray[1] = 0;
+ tarray[0] = (t - t0) / CLOCKS_PER_SECOND;
+ t0 = t;
+ return tarray[0];
+#else
+ struct tms t;
+ static struct tms t0;
+
+ times(&t);
+ tarray[0] = (t.tms_utime - t0.tms_utime) / Hz;
+ tarray[1] = (t.tms_stime - t0.tms_stime) / Hz;
+ t0 = t;
+ return tarray[0] + tarray[1];
+#endif
+ }
diff --git a/contrib/libf2c/libF77/ef1asc_.c b/contrib/libf2c/libF77/ef1asc_.c
new file mode 100644
index 0000000..a922a1d
--- /dev/null
+++ b/contrib/libf2c/libF77/ef1asc_.c
@@ -0,0 +1,21 @@
+/* EFL support routine to copy string b to string a */
+
+#include "f2c.h"
+
+
+#define M ( (long) (sizeof(long) - 1) )
+#define EVEN(x) ( ( (x)+ M) & (~M) )
+
+#ifdef KR_headers
+extern VOID s_copy();
+G77_ef1asc_0 (a, la, b, lb) ftnint *a, *b; ftnlen *la, *lb;
+#else
+extern void s_copy(char*,char*,ftnlen,ftnlen);
+int G77_ef1asc_0 (ftnint *a, ftnlen *la, ftnint *b, ftnlen *lb)
+#endif
+{
+s_copy( (char *)a, (char *)b, EVEN(*la), *lb );
+#ifdef __cplusplus
+return 0;
+#endif
+}
diff --git a/contrib/libf2c/libF77/ef1cmc_.c b/contrib/libf2c/libF77/ef1cmc_.c
new file mode 100644
index 0000000..f471172
--- /dev/null
+++ b/contrib/libf2c/libF77/ef1cmc_.c
@@ -0,0 +1,14 @@
+/* EFL support routine to compare two character strings */
+
+#include "f2c.h"
+
+#ifdef KR_headers
+extern integer s_cmp();
+integer G77_ef1cmc_0 (a, la, b, lb) ftnint *a, *b; ftnlen *la, *lb;
+#else
+extern integer s_cmp(char*,char*,ftnlen,ftnlen);
+integer G77_ef1cmc_0 (ftnint *a, ftnlen *la, ftnint *b, ftnlen *lb)
+#endif
+{
+return( s_cmp( (char *)a, (char *)b, *la, *lb) );
+}
diff --git a/contrib/libf2c/libF77/erf_.c b/contrib/libf2c/libF77/erf_.c
new file mode 100644
index 0000000..1ba4350
--- /dev/null
+++ b/contrib/libf2c/libF77/erf_.c
@@ -0,0 +1,12 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double erf();
+double G77_erf_0 (x) real *x;
+#else
+extern double erf(double);
+double G77_erf_0 (real *x)
+#endif
+{
+return( erf(*x) );
+}
diff --git a/contrib/libf2c/libF77/erfc_.c b/contrib/libf2c/libF77/erfc_.c
new file mode 100644
index 0000000..f44b1d4
--- /dev/null
+++ b/contrib/libf2c/libF77/erfc_.c
@@ -0,0 +1,12 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double erfc();
+double G77_erfc_0 (x) real *x;
+#else
+extern double erfc(double);
+double G77_erfc_0 (real *x)
+#endif
+{
+return( erfc(*x) );
+}
diff --git a/contrib/libf2c/libF77/etime_.c b/contrib/libf2c/libF77/etime_.c
new file mode 100644
index 0000000..7ed3fce
--- /dev/null
+++ b/contrib/libf2c/libF77/etime_.c
@@ -0,0 +1,40 @@
+#include "time.h"
+#ifndef USE_CLOCK
+#define _INCLUDE_POSIX_SOURCE /* for HP-UX */
+#define _INCLUDE_XOPEN_SOURCE /* for HP-UX */
+#include "sys/types.h"
+#include "sys/times.h"
+#endif
+
+#undef Hz
+#ifdef CLK_TCK
+#define Hz CLK_TCK
+#else
+#ifdef HZ
+#define Hz HZ
+#else
+#define Hz 60
+#endif
+#endif
+
+ double
+#ifdef KR_headers
+etime_(tarray) float *tarray;
+#else
+etime_(float *tarray)
+#endif
+{
+#ifdef USE_CLOCK
+#ifndef CLOCKS_PER_SECOND
+#define CLOCKS_PER_SECOND Hz
+#endif
+ double t = clock();
+ tarray[1] = 0;
+ return tarray[0] = t / CLOCKS_PER_SECOND;
+#else
+ struct tms t;
+
+ times(&t);
+ return (tarray[0] = t.tms_utime/Hz) + (tarray[1] = t.tms_stime/Hz);
+#endif
+ }
diff --git a/contrib/libf2c/libF77/exit_.c b/contrib/libf2c/libF77/exit_.c
new file mode 100644
index 0000000..4c0582a
--- /dev/null
+++ b/contrib/libf2c/libF77/exit_.c
@@ -0,0 +1,37 @@
+/* This gives the effect of
+
+ subroutine exit(rc)
+ integer*4 rc
+ stop
+ end
+
+ * with the added side effect of supplying rc as the program's exit code.
+ */
+
+#include "f2c.h"
+#undef abs
+#undef min
+#undef max
+#ifndef KR_headers
+#include <stdlib.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern void f_exit(void);
+#endif
+
+ void
+#ifdef KR_headers
+G77_exit_0 (rc) integer *rc;
+#else
+G77_exit_0 (integer *rc)
+#endif
+{
+#ifdef NO_ONEXIT
+ f_exit();
+#endif
+ exit(*rc);
+ }
+#ifdef __cplusplus
+}
+#endif
diff --git a/contrib/libf2c/libF77/f2ch.add b/contrib/libf2c/libF77/f2ch.add
new file mode 100644
index 0000000..a2acc17
--- /dev/null
+++ b/contrib/libf2c/libF77/f2ch.add
@@ -0,0 +1,162 @@
+/* If you are using a C++ compiler, append the following to f2c.h
+ for compiling libF77 and libI77. */
+
+#ifdef __cplusplus
+extern "C" {
+extern int abort_(void);
+extern double c_abs(complex *);
+extern void c_cos(complex *, complex *);
+extern void c_div(complex *, complex *, complex *);
+extern void c_exp(complex *, complex *);
+extern void c_log(complex *, complex *);
+extern void c_sin(complex *, complex *);
+extern void c_sqrt(complex *, complex *);
+extern double d_abs(double *);
+extern double d_acos(double *);
+extern double d_asin(double *);
+extern double d_atan(double *);
+extern double d_atn2(double *, double *);
+extern void d_cnjg(doublecomplex *, doublecomplex *);
+extern double d_cos(double *);
+extern double d_cosh(double *);
+extern double d_dim(double *, double *);
+extern double d_exp(double *);
+extern double d_imag(doublecomplex *);
+extern double d_int(double *);
+extern double d_lg10(double *);
+extern double d_log(double *);
+extern double d_mod(double *, double *);
+extern double d_nint(double *);
+extern double d_prod(float *, float *);
+extern double d_sign(double *, double *);
+extern double d_sin(double *);
+extern double d_sinh(double *);
+extern double d_sqrt(double *);
+extern double d_tan(double *);
+extern double d_tanh(double *);
+extern double derf_(double *);
+extern double derfc_(double *);
+extern integer do_fio(ftnint *, char *, ftnlen);
+extern integer do_lio(ftnint *, ftnint *, char *, ftnlen);
+extern integer do_uio(ftnint *, char *, ftnlen);
+extern integer e_rdfe(void);
+extern integer e_rdue(void);
+extern integer e_rsfe(void);
+extern integer e_rsfi(void);
+extern integer e_rsle(void);
+extern integer e_rsli(void);
+extern integer e_rsue(void);
+extern integer e_wdfe(void);
+extern integer e_wdue(void);
+extern integer e_wsfe(void);
+extern integer e_wsfi(void);
+extern integer e_wsle(void);
+extern integer e_wsli(void);
+extern integer e_wsue(void);
+extern int ef1asc_(ftnint *, ftnlen *, ftnint *, ftnlen *);
+extern integer ef1cmc_(ftnint *, ftnlen *, ftnint *, ftnlen *);
+extern double erf(double);
+extern double erf_(float *);
+extern double erfc(double);
+extern double erfc_(float *);
+extern integer f_back(alist *);
+extern integer f_clos(cllist *);
+extern integer f_end(alist *);
+extern void f_exit(void);
+extern integer f_inqu(inlist *);
+extern integer f_open(olist *);
+extern integer f_rew(alist *);
+extern int flush_(void);
+extern void getarg_(integer *, char *, ftnlen);
+extern void getenv_(char *, char *, ftnlen, ftnlen);
+extern short h_abs(short *);
+extern short h_dim(short *, short *);
+extern short h_dnnt(double *);
+extern short h_indx(char *, char *, ftnlen, ftnlen);
+extern short h_len(char *, ftnlen);
+extern short h_mod(short *, short *);
+extern short h_nint(float *);
+extern short h_sign(short *, short *);
+extern short hl_ge(char *, char *, ftnlen, ftnlen);
+extern short hl_gt(char *, char *, ftnlen, ftnlen);
+extern short hl_le(char *, char *, ftnlen, ftnlen);
+extern short hl_lt(char *, char *, ftnlen, ftnlen);
+extern integer i_abs(integer *);
+extern integer i_dim(integer *, integer *);
+extern integer i_dnnt(double *);
+extern integer i_indx(char *, char *, ftnlen, ftnlen);
+extern integer i_len(char *, ftnlen);
+extern integer i_mod(integer *, integer *);
+extern integer i_nint(float *);
+extern integer i_sign(integer *, integer *);
+extern integer iargc_(void);
+extern ftnlen l_ge(char *, char *, ftnlen, ftnlen);
+extern ftnlen l_gt(char *, char *, ftnlen, ftnlen);
+extern ftnlen l_le(char *, char *, ftnlen, ftnlen);
+extern ftnlen l_lt(char *, char *, ftnlen, ftnlen);
+extern void pow_ci(complex *, complex *, integer *);
+extern double pow_dd(double *, double *);
+extern double pow_di(double *, integer *);
+extern short pow_hh(short *, shortint *);
+extern integer pow_ii(integer *, integer *);
+extern double pow_ri(float *, integer *);
+extern void pow_zi(doublecomplex *, doublecomplex *, integer *);
+extern void pow_zz(doublecomplex *, doublecomplex *, doublecomplex *);
+extern double r_abs(float *);
+extern double r_acos(float *);
+extern double r_asin(float *);
+extern double r_atan(float *);
+extern double r_atn2(float *, float *);
+extern void r_cnjg(complex *, complex *);
+extern double r_cos(float *);
+extern double r_cosh(float *);
+extern double r_dim(float *, float *);
+extern double r_exp(float *);
+extern double r_imag(complex *);
+extern double r_int(float *);
+extern double r_lg10(float *);
+extern double r_log(float *);
+extern double r_mod(float *, float *);
+extern double r_nint(float *);
+extern double r_sign(float *, float *);
+extern double r_sin(float *);
+extern double r_sinh(float *);
+extern double r_sqrt(float *);
+extern double r_tan(float *);
+extern double r_tanh(float *);
+extern void s_cat(char *, char **, integer *, integer *, ftnlen);
+extern integer s_cmp(char *, char *, ftnlen, ftnlen);
+extern void s_copy(char *, char *, ftnlen, ftnlen);
+extern int s_paus(char *, ftnlen);
+extern integer s_rdfe(cilist *);
+extern integer s_rdue(cilist *);
+extern integer s_rnge(char *, integer, char *, integer);
+extern integer s_rsfe(cilist *);
+extern integer s_rsfi(icilist *);
+extern integer s_rsle(cilist *);
+extern integer s_rsli(icilist *);
+extern integer s_rsne(cilist *);
+extern integer s_rsni(icilist *);
+extern integer s_rsue(cilist *);
+extern int s_stop(char *, ftnlen);
+extern integer s_wdfe(cilist *);
+extern integer s_wdue(cilist *);
+extern integer s_wsfe(cilist *);
+extern integer s_wsfi(icilist *);
+extern integer s_wsle(cilist *);
+extern integer s_wsli(icilist *);
+extern integer s_wsne(cilist *);
+extern integer s_wsni(icilist *);
+extern integer s_wsue(cilist *);
+extern void sig_die(char *, int);
+extern integer signal_(integer *, void (*)(int));
+extern integer system_(char *, ftnlen);
+extern double z_abs(doublecomplex *);
+extern void z_cos(doublecomplex *, doublecomplex *);
+extern void z_div(doublecomplex *, doublecomplex *, doublecomplex *);
+extern void z_exp(doublecomplex *, doublecomplex *);
+extern void z_log(doublecomplex *, doublecomplex *);
+extern void z_sin(doublecomplex *, doublecomplex *);
+extern void z_sqrt(doublecomplex *, doublecomplex *);
+ }
+#endif
diff --git a/contrib/libf2c/libF77/getarg_.c b/contrib/libf2c/libF77/getarg_.c
new file mode 100644
index 0000000..5cf3ffb
--- /dev/null
+++ b/contrib/libf2c/libF77/getarg_.c
@@ -0,0 +1,28 @@
+#include "f2c.h"
+
+/*
+ * subroutine getarg(k, c)
+ * returns the kth unix command argument in fortran character
+ * variable argument c
+*/
+
+#ifdef KR_headers
+VOID G77_getarg_0 (n, s, ls) ftnint *n; register char *s; ftnlen ls;
+#else
+void G77_getarg_0 (ftnint *n, register char *s, ftnlen ls)
+#endif
+{
+extern int f__xargc;
+extern char **f__xargv;
+register char *t;
+register int i;
+
+if(*n>=0 && *n<f__xargc)
+ t = f__xargv[*n];
+else
+ t = "";
+for(i = 0; i<ls && *t!='\0' ; ++i)
+ *s++ = *t++;
+for( ; i<ls ; ++i)
+ *s++ = ' ';
+}
diff --git a/contrib/libf2c/libF77/getenv_.c b/contrib/libf2c/libF77/getenv_.c
new file mode 100644
index 0000000..b9916e6
--- /dev/null
+++ b/contrib/libf2c/libF77/getenv_.c
@@ -0,0 +1,51 @@
+#include "f2c.h"
+
+/*
+ * getenv - f77 subroutine to return environment variables
+ *
+ * called by:
+ * call getenv (ENV_NAME, char_var)
+ * where:
+ * ENV_NAME is the name of an environment variable
+ * char_var is a character variable which will receive
+ * the current value of ENV_NAME, or all blanks
+ * if ENV_NAME is not defined
+ */
+
+#ifdef KR_headers
+VOID G77_getenv_0 (fname, value, flen, vlen) char *value, *fname; ftnlen vlen, flen;
+#else
+void G77_getenv_0 (char *fname, char *value, ftnlen flen, ftnlen vlen)
+#endif
+{
+extern char **environ;
+register char *ep, *fp, *flast;
+register char **env = environ;
+
+flast = fname + flen;
+for(fp = fname ; fp < flast ; ++fp)
+ if(*fp == ' ')
+ {
+ flast = fp;
+ break;
+ }
+
+while (ep = *env++)
+ {
+ for(fp = fname; fp<flast ; )
+ if(*fp++ != *ep++)
+ goto endloop;
+
+ if(*ep++ == '=') { /* copy right hand side */
+ while( *ep && --vlen>=0 )
+ *value++ = *ep++;
+
+ goto blank;
+ }
+endloop: ;
+ }
+
+blank:
+ while( --vlen >= 0 )
+ *value++ = ' ';
+}
diff --git a/contrib/libf2c/libF77/h_abs.c b/contrib/libf2c/libF77/h_abs.c
new file mode 100644
index 0000000..73b8215
--- /dev/null
+++ b/contrib/libf2c/libF77/h_abs.c
@@ -0,0 +1,12 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+shortint h_abs(x) shortint *x;
+#else
+shortint h_abs(shortint *x)
+#endif
+{
+if(*x >= 0)
+ return(*x);
+return(- *x);
+}
diff --git a/contrib/libf2c/libF77/h_dim.c b/contrib/libf2c/libF77/h_dim.c
new file mode 100644
index 0000000..ceff660
--- /dev/null
+++ b/contrib/libf2c/libF77/h_dim.c
@@ -0,0 +1,10 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+shortint h_dim(a,b) shortint *a, *b;
+#else
+shortint h_dim(shortint *a, shortint *b)
+#endif
+{
+return( *a > *b ? *a - *b : 0);
+}
diff --git a/contrib/libf2c/libF77/h_dnnt.c b/contrib/libf2c/libF77/h_dnnt.c
new file mode 100644
index 0000000..005ac6f
--- /dev/null
+++ b/contrib/libf2c/libF77/h_dnnt.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double floor();
+shortint h_dnnt(x) doublereal *x;
+#else
+#undef abs
+#include <math.h>
+shortint h_dnnt(doublereal *x)
+#endif
+{
+return (shortint)(*x >= 0. ? floor(*x + .5) : -floor(.5 - *x));
+}
diff --git a/contrib/libf2c/libF77/h_indx.c b/contrib/libf2c/libF77/h_indx.c
new file mode 100644
index 0000000..a211cc7
--- /dev/null
+++ b/contrib/libf2c/libF77/h_indx.c
@@ -0,0 +1,26 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+shortint h_indx(a, b, la, lb) char *a, *b; ftnlen la, lb;
+#else
+shortint h_indx(char *a, char *b, ftnlen la, ftnlen lb)
+#endif
+{
+ftnlen i, n;
+char *s, *t, *bend;
+
+n = la - lb + 1;
+bend = b + lb;
+
+for(i = 0 ; i < n ; ++i)
+ {
+ s = a + i;
+ t = b;
+ while(t < bend)
+ if(*s++ != *t++)
+ goto no;
+ return((shortint)i+1);
+ no: ;
+ }
+return(0);
+}
diff --git a/contrib/libf2c/libF77/h_len.c b/contrib/libf2c/libF77/h_len.c
new file mode 100644
index 0000000..00a2151
--- /dev/null
+++ b/contrib/libf2c/libF77/h_len.c
@@ -0,0 +1,10 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+shortint h_len(s, n) char *s; ftnlen n;
+#else
+shortint h_len(char *s, ftnlen n)
+#endif
+{
+return(n);
+}
diff --git a/contrib/libf2c/libF77/h_mod.c b/contrib/libf2c/libF77/h_mod.c
new file mode 100644
index 0000000..43431c1
--- /dev/null
+++ b/contrib/libf2c/libF77/h_mod.c
@@ -0,0 +1,10 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+shortint h_mod(a,b) short *a, *b;
+#else
+shortint h_mod(short *a, short *b)
+#endif
+{
+return( *a % *b);
+}
diff --git a/contrib/libf2c/libF77/h_nint.c b/contrib/libf2c/libF77/h_nint.c
new file mode 100644
index 0000000..6b8dc29
--- /dev/null
+++ b/contrib/libf2c/libF77/h_nint.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double floor();
+shortint h_nint(x) real *x;
+#else
+#undef abs
+#include <math.h>
+shortint h_nint(real *x)
+#endif
+{
+return (shortint)(*x >= 0 ? floor(*x + .5) : -floor(.5 - *x));
+}
diff --git a/contrib/libf2c/libF77/h_sign.c b/contrib/libf2c/libF77/h_sign.c
new file mode 100644
index 0000000..7b06c15
--- /dev/null
+++ b/contrib/libf2c/libF77/h_sign.c
@@ -0,0 +1,12 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+shortint h_sign(a,b) shortint *a, *b;
+#else
+shortint h_sign(shortint *a, shortint *b)
+#endif
+{
+shortint x;
+x = (*a >= 0 ? *a : - *a);
+return( *b >= 0 ? x : -x);
+}
diff --git a/contrib/libf2c/libF77/hl_ge.c b/contrib/libf2c/libF77/hl_ge.c
new file mode 100644
index 0000000..4c29527
--- /dev/null
+++ b/contrib/libf2c/libF77/hl_ge.c
@@ -0,0 +1,12 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+extern integer s_cmp();
+shortlogical hl_ge(a,b,la,lb) char *a, *b; ftnlen la, lb;
+#else
+extern integer s_cmp(char *, char *, ftnlen, ftnlen);
+shortlogical hl_ge(char *a, char *b, ftnlen la, ftnlen lb)
+#endif
+{
+return(s_cmp(a,b,la,lb) >= 0);
+}
diff --git a/contrib/libf2c/libF77/hl_gt.c b/contrib/libf2c/libF77/hl_gt.c
new file mode 100644
index 0000000..c4f345a
--- /dev/null
+++ b/contrib/libf2c/libF77/hl_gt.c
@@ -0,0 +1,12 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+extern integer s_cmp();
+shortlogical hl_gt(a,b,la,lb) char *a, *b; ftnlen la, lb;
+#else
+extern integer s_cmp(char *, char *, ftnlen, ftnlen);
+shortlogical hl_gt(char *a, char *b, ftnlen la, ftnlen lb)
+#endif
+{
+return(s_cmp(a,b,la,lb) > 0);
+}
diff --git a/contrib/libf2c/libF77/hl_le.c b/contrib/libf2c/libF77/hl_le.c
new file mode 100644
index 0000000..a9cce59
--- /dev/null
+++ b/contrib/libf2c/libF77/hl_le.c
@@ -0,0 +1,12 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+extern integer s_cmp();
+shortlogical hl_le(a,b,la,lb) char *a, *b; ftnlen la, lb;
+#else
+extern integer s_cmp(char *, char *, ftnlen, ftnlen);
+shortlogical hl_le(char *a, char *b, ftnlen la, ftnlen lb)
+#endif
+{
+return(s_cmp(a,b,la,lb) <= 0);
+}
diff --git a/contrib/libf2c/libF77/hl_lt.c b/contrib/libf2c/libF77/hl_lt.c
new file mode 100644
index 0000000..162d919
--- /dev/null
+++ b/contrib/libf2c/libF77/hl_lt.c
@@ -0,0 +1,12 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+extern integer s_cmp();
+shortlogical hl_lt(a,b,la,lb) char *a, *b; ftnlen la, lb;
+#else
+extern integer s_cmp(char *, char *, ftnlen, ftnlen);
+shortlogical hl_lt(char *a, char *b, ftnlen la, ftnlen lb)
+#endif
+{
+return(s_cmp(a,b,la,lb) < 0);
+}
diff --git a/contrib/libf2c/libF77/i_abs.c b/contrib/libf2c/libF77/i_abs.c
new file mode 100644
index 0000000..be21295
--- /dev/null
+++ b/contrib/libf2c/libF77/i_abs.c
@@ -0,0 +1,12 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+integer i_abs(x) integer *x;
+#else
+integer i_abs(integer *x)
+#endif
+{
+if(*x >= 0)
+ return(*x);
+return(- *x);
+}
diff --git a/contrib/libf2c/libF77/i_dim.c b/contrib/libf2c/libF77/i_dim.c
new file mode 100644
index 0000000..6e1b170
--- /dev/null
+++ b/contrib/libf2c/libF77/i_dim.c
@@ -0,0 +1,10 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+integer i_dim(a,b) integer *a, *b;
+#else
+integer i_dim(integer *a, integer *b)
+#endif
+{
+return( *a > *b ? *a - *b : 0);
+}
diff --git a/contrib/libf2c/libF77/i_dnnt.c b/contrib/libf2c/libF77/i_dnnt.c
new file mode 100644
index 0000000..4ede56a
--- /dev/null
+++ b/contrib/libf2c/libF77/i_dnnt.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double floor();
+integer i_dnnt(x) doublereal *x;
+#else
+#undef abs
+#include <math.h>
+integer i_dnnt(doublereal *x)
+#endif
+{
+return (integer)(*x >= 0. ? floor(*x + .5) : -floor(.5 - *x));
+}
diff --git a/contrib/libf2c/libF77/i_indx.c b/contrib/libf2c/libF77/i_indx.c
new file mode 100644
index 0000000..96e7bc5
--- /dev/null
+++ b/contrib/libf2c/libF77/i_indx.c
@@ -0,0 +1,26 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+integer i_indx(a, b, la, lb) char *a, *b; ftnlen la, lb;
+#else
+integer i_indx(char *a, char *b, ftnlen la, ftnlen lb)
+#endif
+{
+ftnlen i, n;
+char *s, *t, *bend;
+
+n = la - lb + 1;
+bend = b + lb;
+
+for(i = 0 ; i < n ; ++i)
+ {
+ s = a + i;
+ t = b;
+ while(t < bend)
+ if(*s++ != *t++)
+ goto no;
+ return(i+1);
+ no: ;
+ }
+return(0);
+}
diff --git a/contrib/libf2c/libF77/i_len.c b/contrib/libf2c/libF77/i_len.c
new file mode 100644
index 0000000..4020fee
--- /dev/null
+++ b/contrib/libf2c/libF77/i_len.c
@@ -0,0 +1,10 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+integer i_len(s, n) char *s; ftnlen n;
+#else
+integer i_len(char *s, ftnlen n)
+#endif
+{
+return(n);
+}
diff --git a/contrib/libf2c/libF77/i_mod.c b/contrib/libf2c/libF77/i_mod.c
new file mode 100644
index 0000000..6937c42
--- /dev/null
+++ b/contrib/libf2c/libF77/i_mod.c
@@ -0,0 +1,10 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+integer i_mod(a,b) integer *a, *b;
+#else
+integer i_mod(integer *a, integer *b)
+#endif
+{
+return( *a % *b);
+}
diff --git a/contrib/libf2c/libF77/i_nint.c b/contrib/libf2c/libF77/i_nint.c
new file mode 100644
index 0000000..411ce32
--- /dev/null
+++ b/contrib/libf2c/libF77/i_nint.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double floor();
+integer i_nint(x) real *x;
+#else
+#undef abs
+#include <math.h>
+integer i_nint(real *x)
+#endif
+{
+return (integer)(*x >= 0 ? floor(*x + .5) : -floor(.5 - *x));
+}
diff --git a/contrib/libf2c/libF77/i_sign.c b/contrib/libf2c/libF77/i_sign.c
new file mode 100644
index 0000000..94009b8
--- /dev/null
+++ b/contrib/libf2c/libF77/i_sign.c
@@ -0,0 +1,12 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+integer i_sign(a,b) integer *a, *b;
+#else
+integer i_sign(integer *a, integer *b)
+#endif
+{
+integer x;
+x = (*a >= 0 ? *a : - *a);
+return( *b >= 0 ? x : -x);
+}
diff --git a/contrib/libf2c/libF77/iargc_.c b/contrib/libf2c/libF77/iargc_.c
new file mode 100644
index 0000000..1e04c77
--- /dev/null
+++ b/contrib/libf2c/libF77/iargc_.c
@@ -0,0 +1,11 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+ftnint G77_iargc_0 ()
+#else
+ftnint G77_iargc_0 (void)
+#endif
+{
+extern int f__xargc;
+return ( f__xargc - 1 );
+}
diff --git a/contrib/libf2c/libF77/l_ge.c b/contrib/libf2c/libF77/l_ge.c
new file mode 100644
index 0000000..86b4a1f
--- /dev/null
+++ b/contrib/libf2c/libF77/l_ge.c
@@ -0,0 +1,12 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+extern integer s_cmp();
+logical l_ge(a,b,la,lb) char *a, *b; ftnlen la, lb;
+#else
+extern integer s_cmp(char *, char *, ftnlen, ftnlen);
+logical l_ge(char *a, char *b, ftnlen la, ftnlen lb)
+#endif
+{
+return(s_cmp(a,b,la,lb) >= 0);
+}
diff --git a/contrib/libf2c/libF77/l_gt.c b/contrib/libf2c/libF77/l_gt.c
new file mode 100644
index 0000000..c4b52f5
--- /dev/null
+++ b/contrib/libf2c/libF77/l_gt.c
@@ -0,0 +1,12 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+extern integer s_cmp();
+logical l_gt(a,b,la,lb) char *a, *b; ftnlen la, lb;
+#else
+extern integer s_cmp(char *, char *, ftnlen, ftnlen);
+logical l_gt(char *a, char *b, ftnlen la, ftnlen lb)
+#endif
+{
+return(s_cmp(a,b,la,lb) > 0);
+}
diff --git a/contrib/libf2c/libF77/l_le.c b/contrib/libf2c/libF77/l_le.c
new file mode 100644
index 0000000..f2740a2
--- /dev/null
+++ b/contrib/libf2c/libF77/l_le.c
@@ -0,0 +1,12 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+extern integer s_cmp();
+logical l_le(a,b,la,lb) char *a, *b; ftnlen la, lb;
+#else
+extern integer s_cmp(char *, char *, ftnlen, ftnlen);
+logical l_le(char *a, char *b, ftnlen la, ftnlen lb)
+#endif
+{
+return(s_cmp(a,b,la,lb) <= 0);
+}
diff --git a/contrib/libf2c/libF77/l_lt.c b/contrib/libf2c/libF77/l_lt.c
new file mode 100644
index 0000000..c48dc94
--- /dev/null
+++ b/contrib/libf2c/libF77/l_lt.c
@@ -0,0 +1,12 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+extern integer s_cmp();
+logical l_lt(a,b,la,lb) char *a, *b; ftnlen la, lb;
+#else
+extern integer s_cmp(char *, char *, ftnlen, ftnlen);
+logical l_lt(char *a, char *b, ftnlen la, ftnlen lb)
+#endif
+{
+return(s_cmp(a,b,la,lb) < 0);
+}
diff --git a/contrib/libf2c/libF77/lbitbits.c b/contrib/libf2c/libF77/lbitbits.c
new file mode 100644
index 0000000..75e9f9c
--- /dev/null
+++ b/contrib/libf2c/libF77/lbitbits.c
@@ -0,0 +1,62 @@
+#include "f2c.h"
+
+#ifndef LONGBITS
+#define LONGBITS 32
+#endif
+
+ integer
+#ifdef KR_headers
+lbit_bits(a, b, len) integer a, b, len;
+#else
+lbit_bits(integer a, integer b, integer len)
+#endif
+{
+ /* Assume 2's complement arithmetic */
+
+ unsigned long x, y;
+
+ x = (unsigned long) a;
+ y = (unsigned long)-1L;
+ x >>= b;
+ y <<= len;
+ return (integer)(x & ~y);
+ }
+
+ integer
+#ifdef KR_headers
+lbit_cshift(a, b, len) integer a, b, len;
+#else
+lbit_cshift(integer a, integer b, integer len)
+#endif
+{
+ unsigned long x, y, z;
+
+ x = (unsigned long)a;
+ if (len <= 0) {
+ if (len == 0)
+ return 0;
+ goto full_len;
+ }
+ if (len >= LONGBITS) {
+ full_len:
+ if (b >= 0) {
+ b %= LONGBITS;
+ return (integer)(x << b | x >> LONGBITS -b );
+ }
+ b = -b;
+ b %= LONGBITS;
+ return (integer)(x << LONGBITS - b | x >> b);
+ }
+ y = z = (unsigned long)-1;
+ y <<= len;
+ z &= ~y;
+ y &= x;
+ x &= z;
+ if (b >= 0) {
+ b %= len;
+ return (integer)(y | z & (x << b | x >> len - b));
+ }
+ b = -b;
+ b %= len;
+ return (integer)(y | z & (x >> b | x << len - b));
+ }
diff --git a/contrib/libf2c/libF77/lbitshft.c b/contrib/libf2c/libF77/lbitshft.c
new file mode 100644
index 0000000..81b0fdb
--- /dev/null
+++ b/contrib/libf2c/libF77/lbitshft.c
@@ -0,0 +1,11 @@
+#include "f2c.h"
+
+ integer
+#ifdef KR_headers
+lbit_shift(a, b) integer a; integer b;
+#else
+lbit_shift(integer a, integer b)
+#endif
+{
+ return b >= 0 ? a << b : (integer)((uinteger)a >> -b);
+ }
diff --git a/contrib/libf2c/libF77/main.c b/contrib/libf2c/libF77/main.c
new file mode 100644
index 0000000..17bf449
--- /dev/null
+++ b/contrib/libf2c/libF77/main.c
@@ -0,0 +1,68 @@
+/* STARTUP PROCEDURE FOR UNIX FORTRAN PROGRAMS */
+
+#include <stdio.h>
+#include "signal1.h"
+
+#ifndef KR_headers
+#undef VOID
+#include <stdlib.h>
+#endif
+
+#ifndef VOID
+#define VOID void
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef NO__STDC
+#define ONEXIT onexit
+extern VOID f_exit();
+#else
+#ifndef KR_headers
+extern void f_exit(void);
+#ifndef NO_ONEXIT
+#define ONEXIT atexit
+extern int atexit(void (*)(void));
+#endif
+#else
+#ifndef NO_ONEXIT
+#define ONEXIT onexit
+extern VOID f_exit();
+#endif
+#endif
+#endif
+
+#ifdef KR_headers
+extern VOID f_init();
+extern int MAIN__();
+#else
+extern void f_init(void);
+extern int MAIN__(void);
+#endif
+
+#ifdef __cplusplus
+ }
+#endif
+
+#ifdef KR_headers
+main(argc, argv) int argc; char **argv;
+#else
+main(int argc, char **argv)
+#endif
+{
+f_setarg(argc, argv);
+f_setsig();
+f_init();
+#ifndef NO_ONEXIT
+ONEXIT(f_exit);
+#endif
+MAIN__();
+#ifdef NO_ONEXIT
+f_exit();
+#endif
+exit(0); /* exit(0) rather than return(0) to bypass Cray bug */
+return 0; /* For compilers that complain of missing return values; */
+ /* others will complain that this is unreachable code. */
+}
diff --git a/contrib/libf2c/libF77/makefile.netlib b/contrib/libf2c/libF77/makefile.netlib
new file mode 100644
index 0000000..230ca7e
--- /dev/null
+++ b/contrib/libf2c/libF77/makefile.netlib
@@ -0,0 +1,103 @@
+.SUFFIXES: .c .o
+CC = cc
+SHELL = /bin/sh
+CFLAGS = -O
+
+# If your system lacks onexit() and you are not using an
+# ANSI C compiler, then you should add -DNO_ONEXIT to CFLAGS,
+# e.g., by changing the above "CFLAGS =" line to
+# CFLAGS = -O -DNO_ONEXIT
+
+# On at least some Sun systems, it is more appropriate to change the
+# "CFLAGS =" line to
+# CFLAGS = -O -Donexit=on_exit
+
+# compile, then strip unnecessary symbols
+.c.o:
+ $(CC) -c -DSkip_f2c_Undefs $(CFLAGS) $*.c
+ ld -r -x -o $*.xxx $*.o
+ mv $*.xxx $*.o
+## Under Solaris (and other systems that do not understand ld -x),
+## omit -x in the ld line above.
+## If your system does not have the ld command, comment out
+## or remove both the ld and mv lines above.
+
+MISC = F77_aloc.o Version.o main.o s_rnge.o abort_.o getarg_.o iargc_.o \
+ getenv_.o signal_.o s_stop.o s_paus.o system_.o cabs.o\
+ derf_.o derfc_.o erf_.o erfc_.o sig_die.o exit_.o
+POW = pow_ci.o pow_dd.o pow_di.o pow_hh.o pow_ii.o pow_ri.o pow_zi.o pow_zz.o
+CX = c_abs.o c_cos.o c_div.o c_exp.o c_log.o c_sin.o c_sqrt.o
+DCX = z_abs.o z_cos.o z_div.o z_exp.o z_log.o z_sin.o z_sqrt.o
+REAL = r_abs.o r_acos.o r_asin.o r_atan.o r_atn2.o r_cnjg.o r_cos.o\
+ r_cosh.o r_dim.o r_exp.o r_imag.o r_int.o\
+ r_lg10.o r_log.o r_mod.o r_nint.o r_sign.o\
+ r_sin.o r_sinh.o r_sqrt.o r_tan.o r_tanh.o
+DBL = d_abs.o d_acos.o d_asin.o d_atan.o d_atn2.o\
+ d_cnjg.o d_cos.o d_cosh.o d_dim.o d_exp.o\
+ d_imag.o d_int.o d_lg10.o d_log.o d_mod.o\
+ d_nint.o d_prod.o d_sign.o d_sin.o d_sinh.o\
+ d_sqrt.o d_tan.o d_tanh.o
+INT = i_abs.o i_dim.o i_dnnt.o i_indx.o i_len.o i_mod.o i_nint.o i_sign.o
+HALF = h_abs.o h_dim.o h_dnnt.o h_indx.o h_len.o h_mod.o h_nint.o h_sign.o
+CMP = l_ge.o l_gt.o l_le.o l_lt.o hl_ge.o hl_gt.o hl_le.o hl_lt.o
+EFL = ef1asc_.o ef1cmc_.o
+CHAR = F77_aloc.o s_cat.o s_cmp.o s_copy.o
+F90BIT = lbitbits.o lbitshft.o
+QINT = pow_qq.o qbitbits.o qbitshft.o
+TIME = dtime_.o etime_.o
+
+all: signal1.h libF77.a
+
+# You may need to adjust signal1.h suitably for your system...
+signal1.h: signal1.h0
+ cp signal1.h0 signal1.h
+
+# If you get an error compiling dtime_.c or etime_.c, try adding
+# -DUSE_CLOCK to the CFLAGS assignment above; if that does not work,
+# omit $(TIME) from the dependency list for libF77.a below.
+
+# For INTEGER*8 support (which requires system-dependent adjustments to
+# f2c.h), add $(QINT) to the libf2c.a dependency list below...
+
+libF77.a : $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) \
+ $(HALF) $(CMP) $(EFL) $(CHAR) $(F90BIT) $(TIME)
+ ar r libF77.a $?
+ -ranlib libF77.a
+
+### If your system lacks ranlib, you don't need it; see README.
+
+Version.o: Version.c
+ $(CC) -c Version.c
+
+# To compile with C++, first "make f2c.h"
+f2c.h: f2ch.add
+ cat /usr/include/f2c.h f2ch.add >f2c.h
+
+install: libF77.a
+ mv libF77.a /usr/lib
+ ranlib /usr/lib/libF77.a
+
+clean:
+ rm -f libF77.a *.o
+
+check:
+ xsum F77_aloc.c Notice README Version.c abort_.c c_abs.c c_cos.c \
+ c_div.c c_exp.c c_log.c c_sin.c c_sqrt.c cabs.c d_abs.c d_acos.c \
+ d_asin.c d_atan.c d_atn2.c d_cnjg.c d_cos.c d_cosh.c d_dim.c \
+ d_exp.c d_imag.c d_int.c d_lg10.c d_log.c d_mod.c d_nint.c \
+ d_prod.c d_sign.c d_sin.c d_sinh.c d_sqrt.c d_tan.c d_tanh.c \
+ derf_.c derfc_.c dtime_.c \
+ ef1asc_.c ef1cmc_.c erf_.c erfc_.c etime_.c exit_.c f2ch.add \
+ getarg_.c getenv_.c h_abs.c h_dim.c h_dnnt.c h_indx.c h_len.c \
+ h_mod.c h_nint.c h_sign.c hl_ge.c hl_gt.c hl_le.c hl_lt.c \
+ i_abs.c i_dim.c i_dnnt.c i_indx.c i_len.c i_mod.c i_nint.c \
+ i_sign.c iargc_.c l_ge.c l_gt.c l_le.c l_lt.c lbitbits.c lbitshft.c \
+ main.c makefile pow_ci.c pow_dd.c pow_di.c pow_hh.c pow_ii.c \
+ pow_qq.c pow_ri.c pow_zi.c pow_zz.c qbitbits.c qbitshft.c \
+ r_abs.c r_acos.c r_asin.c r_atan.c r_atn2.c \
+ r_cnjg.c r_cos.c r_cosh.c r_dim.c r_exp.c r_imag.c r_int.c r_lg10.c \
+ r_log.c r_mod.c r_nint.c r_sign.c r_sin.c r_sinh.c r_sqrt.c \
+ r_tan.c r_tanh.c s_cat.c s_cmp.c s_copy.c \
+ s_paus.c s_rnge.c s_stop.c sig_die.c signal1.h0 signal_.c system_.c \
+ z_abs.c z_cos.c z_div.c z_exp.c z_log.c z_sin.c z_sqrt.c >zap
+ cmp zap libF77.xsum && rm zap || diff libF77.xsum zap
diff --git a/contrib/libf2c/libF77/pow_ci.c b/contrib/libf2c/libF77/pow_ci.c
new file mode 100644
index 0000000..37e2ce0
--- /dev/null
+++ b/contrib/libf2c/libF77/pow_ci.c
@@ -0,0 +1,20 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+VOID pow_ci(p, a, b) /* p = a**b */
+ complex *p, *a; integer *b;
+#else
+extern void pow_zi(doublecomplex*, doublecomplex*, integer*);
+void pow_ci(complex *p, complex *a, integer *b) /* p = a**b */
+#endif
+{
+doublecomplex p1, a1;
+
+a1.r = a->r;
+a1.i = a->i;
+
+pow_zi(&p1, &a1, b);
+
+p->r = p1.r;
+p->i = p1.i;
+}
diff --git a/contrib/libf2c/libF77/pow_dd.c b/contrib/libf2c/libF77/pow_dd.c
new file mode 100644
index 0000000..d0dd0ff
--- /dev/null
+++ b/contrib/libf2c/libF77/pow_dd.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double pow();
+double pow_dd(ap, bp) doublereal *ap, *bp;
+#else
+#undef abs
+#include <math.h>
+double pow_dd(doublereal *ap, doublereal *bp)
+#endif
+{
+return(pow(*ap, *bp) );
+}
diff --git a/contrib/libf2c/libF77/pow_di.c b/contrib/libf2c/libF77/pow_di.c
new file mode 100644
index 0000000..affed62
--- /dev/null
+++ b/contrib/libf2c/libF77/pow_di.c
@@ -0,0 +1,35 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double pow_di(ap, bp) doublereal *ap; integer *bp;
+#else
+double pow_di(doublereal *ap, integer *bp)
+#endif
+{
+double pow, x;
+integer n;
+unsigned long u;
+
+pow = 1;
+x = *ap;
+n = *bp;
+
+if(n != 0)
+ {
+ if(n < 0)
+ {
+ n = -n;
+ x = 1/x;
+ }
+ for(u = n; ; )
+ {
+ if(u & 01)
+ pow *= x;
+ if(u >>= 1)
+ x *= x;
+ else
+ break;
+ }
+ }
+return(pow);
+}
diff --git a/contrib/libf2c/libF77/pow_hh.c b/contrib/libf2c/libF77/pow_hh.c
new file mode 100644
index 0000000..24a0197
--- /dev/null
+++ b/contrib/libf2c/libF77/pow_hh.c
@@ -0,0 +1,33 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+shortint pow_hh(ap, bp) shortint *ap, *bp;
+#else
+shortint pow_hh(shortint *ap, shortint *bp)
+#endif
+{
+ shortint pow, x, n;
+ unsigned u;
+
+ x = *ap;
+ n = *bp;
+
+ if (n <= 0) {
+ if (n == 0 || x == 1)
+ return 1;
+ if (x != -1)
+ return x == 0 ? 1/x : 0;
+ n = -n;
+ }
+ u = n;
+ for(pow = 1; ; )
+ {
+ if(u & 01)
+ pow *= x;
+ if(u >>= 1)
+ x *= x;
+ else
+ break;
+ }
+ return(pow);
+ }
diff --git a/contrib/libf2c/libF77/pow_ii.c b/contrib/libf2c/libF77/pow_ii.c
new file mode 100644
index 0000000..84d1c7e
--- /dev/null
+++ b/contrib/libf2c/libF77/pow_ii.c
@@ -0,0 +1,33 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+integer pow_ii(ap, bp) integer *ap, *bp;
+#else
+integer pow_ii(integer *ap, integer *bp)
+#endif
+{
+ integer pow, x, n;
+ unsigned long u;
+
+ x = *ap;
+ n = *bp;
+
+ if (n <= 0) {
+ if (n == 0 || x == 1)
+ return 1;
+ if (x != -1)
+ return x == 0 ? 1/x : 0;
+ n = -n;
+ }
+ u = n;
+ for(pow = 1; ; )
+ {
+ if(u & 01)
+ pow *= x;
+ if(u >>= 1)
+ x *= x;
+ else
+ break;
+ }
+ return(pow);
+ }
diff --git a/contrib/libf2c/libF77/pow_qq.c b/contrib/libf2c/libF77/pow_qq.c
new file mode 100644
index 0000000..3bc80e0
--- /dev/null
+++ b/contrib/libf2c/libF77/pow_qq.c
@@ -0,0 +1,33 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+longint pow_qq(ap, bp) longint *ap, *bp;
+#else
+longint pow_qq(longint *ap, longint *bp)
+#endif
+{
+ longint pow, x, n;
+ unsigned long long u; /* system-dependent */
+
+ x = *ap;
+ n = *bp;
+
+ if (n <= 0) {
+ if (n == 0 || x == 1)
+ return 1;
+ if (x != -1)
+ return x == 0 ? 1/x : 0;
+ n = -n;
+ }
+ u = n;
+ for(pow = 1; ; )
+ {
+ if(u & 01)
+ pow *= x;
+ if(u >>= 1)
+ x *= x;
+ else
+ break;
+ }
+ return(pow);
+ }
diff --git a/contrib/libf2c/libF77/pow_ri.c b/contrib/libf2c/libF77/pow_ri.c
new file mode 100644
index 0000000..6e5816b
--- /dev/null
+++ b/contrib/libf2c/libF77/pow_ri.c
@@ -0,0 +1,35 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double pow_ri(ap, bp) real *ap; integer *bp;
+#else
+double pow_ri(real *ap, integer *bp)
+#endif
+{
+double pow, x;
+integer n;
+unsigned long u;
+
+pow = 1;
+x = *ap;
+n = *bp;
+
+if(n != 0)
+ {
+ if(n < 0)
+ {
+ n = -n;
+ x = 1/x;
+ }
+ for(u = n; ; )
+ {
+ if(u & 01)
+ pow *= x;
+ if(u >>= 1)
+ x *= x;
+ else
+ break;
+ }
+ }
+return(pow);
+}
diff --git a/contrib/libf2c/libF77/pow_zi.c b/contrib/libf2c/libF77/pow_zi.c
new file mode 100644
index 0000000..898ea6b
--- /dev/null
+++ b/contrib/libf2c/libF77/pow_zi.c
@@ -0,0 +1,61 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+VOID pow_zi(resx, a, b) /* p = a**b */
+ doublecomplex *resx, *a; integer *b;
+#else
+extern void z_div(doublecomplex*, doublecomplex*, doublecomplex*);
+void pow_zi(doublecomplex *resx, doublecomplex *a, integer *b) /* p = a**b */
+#endif
+{
+integer n;
+unsigned long u;
+double t;
+doublecomplex x;
+doublecomplex res;
+static doublecomplex one = {1.0, 0.0};
+
+n = *b;
+
+if(n == 0)
+ {
+ resx->r = 1;
+ resx->i = 0;
+ return;
+ }
+
+res.r = 1;
+res.i = 0;
+
+if(n < 0)
+ {
+ n = -n;
+ z_div(&x, &one, a);
+ }
+else
+ {
+ x.r = a->r;
+ x.i = a->i;
+ }
+
+for(u = n; ; )
+ {
+ if(u & 01)
+ {
+ t = res.r * x.r - res.i * x.i;
+ res.i = res.r * x.i + res.i * x.r;
+ res.r = t;
+ }
+ if(u >>= 1)
+ {
+ t = x.r * x.r - x.i * x.i;
+ x.i = 2 * x.r * x.i;
+ x.r = t;
+ }
+ else
+ break;
+ }
+
+resx->r = res.r;
+resx->i = res.i;
+}
diff --git a/contrib/libf2c/libF77/pow_zz.c b/contrib/libf2c/libF77/pow_zz.c
new file mode 100644
index 0000000..20faf29
--- /dev/null
+++ b/contrib/libf2c/libF77/pow_zz.c
@@ -0,0 +1,23 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double log(), exp(), cos(), sin(), atan2(), f__cabs();
+VOID pow_zz(r,a,b) doublecomplex *r, *a, *b;
+#else
+#undef abs
+#include <math.h>
+extern double f__cabs(double,double);
+void pow_zz(doublecomplex *r, doublecomplex *a, doublecomplex *b)
+#endif
+{
+double logr, logi, x, y;
+
+logr = log( f__cabs(a->r, a->i) );
+logi = atan2(a->i, a->r);
+
+x = exp( logr * b->r - logi * b->i );
+y = logr * b->i + logi * b->r;
+
+r->r = x * cos(y);
+r->i = x * sin(y);
+}
diff --git a/contrib/libf2c/libF77/qbitbits.c b/contrib/libf2c/libF77/qbitbits.c
new file mode 100644
index 0000000..ad4ac96
--- /dev/null
+++ b/contrib/libf2c/libF77/qbitbits.c
@@ -0,0 +1,66 @@
+#include "f2c.h"
+
+#ifndef LONGBITS
+#define LONGBITS 32
+#endif
+
+#ifndef LONG8BITS
+#define LONG8BITS (2*LONGBITS)
+#endif
+
+ integer
+#ifdef KR_headers
+qbit_bits(a, b, len) longint a; integer b, len;
+#else
+qbit_bits(longint a, integer b, integer len)
+#endif
+{
+ /* Assume 2's complement arithmetic */
+
+ ulongint x, y;
+
+ x = (ulongint) a;
+ y = (ulongint)-1L;
+ x >>= b;
+ y <<= len;
+ return (longint)(x & y);
+ }
+
+ longint
+#ifdef KR_headers
+qbit_cshift(a, b, len) longint a; integer b, len;
+#else
+qbit_cshift(longint a, integer b, integer len)
+#endif
+{
+ ulongint x, y, z;
+
+ x = (ulongint)a;
+ if (len <= 0) {
+ if (len == 0)
+ return 0;
+ goto full_len;
+ }
+ if (len >= LONG8BITS) {
+ full_len:
+ if (b >= 0) {
+ b %= LONG8BITS;
+ return (longint)(x << b | x >> LONG8BITS - b );
+ }
+ b = -b;
+ b %= LONG8BITS;
+ return (longint)(x << LONG8BITS - b | x >> b);
+ }
+ y = z = (unsigned long)-1;
+ y <<= len;
+ z &= ~y;
+ y &= x;
+ x &= z;
+ if (b >= 0) {
+ b %= len;
+ return (longint)(y | z & (x << b | x >> len - b));
+ }
+ b = -b;
+ b %= len;
+ return (longint)(y | z & (x >> b | x << len - b));
+ }
diff --git a/contrib/libf2c/libF77/qbitshft.c b/contrib/libf2c/libF77/qbitshft.c
new file mode 100644
index 0000000..87fffb9
--- /dev/null
+++ b/contrib/libf2c/libF77/qbitshft.c
@@ -0,0 +1,11 @@
+#include "f2c.h"
+
+ longint
+#ifdef KR_headers
+qbit_shift(a, b) longint a; integer b;
+#else
+qbit_shift(longint a, integer b)
+#endif
+{
+ return b >= 0 ? a << b : (longint)((ulongint)a >> -b);
+ }
diff --git a/contrib/libf2c/libF77/r_abs.c b/contrib/libf2c/libF77/r_abs.c
new file mode 100644
index 0000000..7b22296
--- /dev/null
+++ b/contrib/libf2c/libF77/r_abs.c
@@ -0,0 +1,12 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double r_abs(x) real *x;
+#else
+double r_abs(real *x)
+#endif
+{
+if(*x >= 0)
+ return(*x);
+return(- *x);
+}
diff --git a/contrib/libf2c/libF77/r_acos.c b/contrib/libf2c/libF77/r_acos.c
new file mode 100644
index 0000000..330f88a
--- /dev/null
+++ b/contrib/libf2c/libF77/r_acos.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double acos();
+double r_acos(x) real *x;
+#else
+#undef abs
+#include <math.h>
+double r_acos(real *x)
+#endif
+{
+return( acos(*x) );
+}
diff --git a/contrib/libf2c/libF77/r_asin.c b/contrib/libf2c/libF77/r_asin.c
new file mode 100644
index 0000000..45ece4b
--- /dev/null
+++ b/contrib/libf2c/libF77/r_asin.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double asin();
+double r_asin(x) real *x;
+#else
+#undef abs
+#include <math.h>
+double r_asin(real *x)
+#endif
+{
+return( asin(*x) );
+}
diff --git a/contrib/libf2c/libF77/r_atan.c b/contrib/libf2c/libF77/r_atan.c
new file mode 100644
index 0000000..36479c9
--- /dev/null
+++ b/contrib/libf2c/libF77/r_atan.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double atan();
+double r_atan(x) real *x;
+#else
+#undef abs
+#include <math.h>
+double r_atan(real *x)
+#endif
+{
+return( atan(*x) );
+}
diff --git a/contrib/libf2c/libF77/r_atn2.c b/contrib/libf2c/libF77/r_atn2.c
new file mode 100644
index 0000000..9347e1f
--- /dev/null
+++ b/contrib/libf2c/libF77/r_atn2.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double atan2();
+double r_atn2(x,y) real *x, *y;
+#else
+#undef abs
+#include <math.h>
+double r_atn2(real *x, real *y)
+#endif
+{
+return( atan2(*x,*y) );
+}
diff --git a/contrib/libf2c/libF77/r_cnjg.c b/contrib/libf2c/libF77/r_cnjg.c
new file mode 100644
index 0000000..b6175ee
--- /dev/null
+++ b/contrib/libf2c/libF77/r_cnjg.c
@@ -0,0 +1,16 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+VOID r_cnjg(resx, z) complex *resx, *z;
+#else
+VOID r_cnjg(complex *resx, complex *z)
+#endif
+{
+complex res;
+
+res.r = z->r;
+res.i = - z->i;
+
+resx->r = res.r;
+resx->i = res.i;
+}
diff --git a/contrib/libf2c/libF77/r_cos.c b/contrib/libf2c/libF77/r_cos.c
new file mode 100644
index 0000000..5bda158
--- /dev/null
+++ b/contrib/libf2c/libF77/r_cos.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double cos();
+double r_cos(x) real *x;
+#else
+#undef abs
+#include <math.h>
+double r_cos(real *x)
+#endif
+{
+return( cos(*x) );
+}
diff --git a/contrib/libf2c/libF77/r_cosh.c b/contrib/libf2c/libF77/r_cosh.c
new file mode 100644
index 0000000..7ae72cc
--- /dev/null
+++ b/contrib/libf2c/libF77/r_cosh.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double cosh();
+double r_cosh(x) real *x;
+#else
+#undef abs
+#include <math.h>
+double r_cosh(real *x)
+#endif
+{
+return( cosh(*x) );
+}
diff --git a/contrib/libf2c/libF77/r_dim.c b/contrib/libf2c/libF77/r_dim.c
new file mode 100644
index 0000000..baca95c
--- /dev/null
+++ b/contrib/libf2c/libF77/r_dim.c
@@ -0,0 +1,10 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double r_dim(a,b) real *a, *b;
+#else
+double r_dim(real *a, real *b)
+#endif
+{
+return( *a > *b ? *a - *b : 0);
+}
diff --git a/contrib/libf2c/libF77/r_exp.c b/contrib/libf2c/libF77/r_exp.c
new file mode 100644
index 0000000..d1dea75
--- /dev/null
+++ b/contrib/libf2c/libF77/r_exp.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double exp();
+double r_exp(x) real *x;
+#else
+#undef abs
+#include <math.h>
+double r_exp(real *x)
+#endif
+{
+return( exp(*x) );
+}
diff --git a/contrib/libf2c/libF77/r_imag.c b/contrib/libf2c/libF77/r_imag.c
new file mode 100644
index 0000000..d51252b
--- /dev/null
+++ b/contrib/libf2c/libF77/r_imag.c
@@ -0,0 +1,10 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double r_imag(z) complex *z;
+#else
+double r_imag(complex *z)
+#endif
+{
+return(z->i);
+}
diff --git a/contrib/libf2c/libF77/r_int.c b/contrib/libf2c/libF77/r_int.c
new file mode 100644
index 0000000..8378e77
--- /dev/null
+++ b/contrib/libf2c/libF77/r_int.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double floor();
+double r_int(x) real *x;
+#else
+#undef abs
+#include <math.h>
+double r_int(real *x)
+#endif
+{
+return( (*x>0) ? floor(*x) : -floor(- *x) );
+}
diff --git a/contrib/libf2c/libF77/r_lg10.c b/contrib/libf2c/libF77/r_lg10.c
new file mode 100644
index 0000000..51f84201
--- /dev/null
+++ b/contrib/libf2c/libF77/r_lg10.c
@@ -0,0 +1,15 @@
+#include "f2c.h"
+
+#define log10e 0.43429448190325182765
+
+#ifdef KR_headers
+double log();
+double r_lg10(x) real *x;
+#else
+#undef abs
+#include <math.h>
+double r_lg10(real *x)
+#endif
+{
+return( log10e * log(*x) );
+}
diff --git a/contrib/libf2c/libF77/r_log.c b/contrib/libf2c/libF77/r_log.c
new file mode 100644
index 0000000..4873fb4
--- /dev/null
+++ b/contrib/libf2c/libF77/r_log.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double log();
+double r_log(x) real *x;
+#else
+#undef abs
+#include <math.h>
+double r_log(real *x)
+#endif
+{
+return( log(*x) );
+}
diff --git a/contrib/libf2c/libF77/r_mod.c b/contrib/libf2c/libF77/r_mod.c
new file mode 100644
index 0000000..faea344
--- /dev/null
+++ b/contrib/libf2c/libF77/r_mod.c
@@ -0,0 +1,40 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+#ifdef IEEE_drem
+double drem();
+#else
+double floor();
+#endif
+double r_mod(x,y) real *x, *y;
+#else
+#ifdef IEEE_drem
+double drem(double, double);
+#else
+#undef abs
+#include <math.h>
+#endif
+double r_mod(real *x, real *y)
+#endif
+{
+#ifdef IEEE_drem
+ double xa, ya, z;
+ if ((ya = *y) < 0.)
+ ya = -ya;
+ z = drem(xa = *x, ya);
+ if (xa > 0) {
+ if (z < 0)
+ z += ya;
+ }
+ else if (z > 0)
+ z -= ya;
+ return z;
+#else
+ double quotient;
+ if( (quotient = (double)*x / *y) >= 0)
+ quotient = floor(quotient);
+ else
+ quotient = -floor(-quotient);
+ return(*x - (*y) * quotient );
+#endif
+}
diff --git a/contrib/libf2c/libF77/r_nint.c b/contrib/libf2c/libF77/r_nint.c
new file mode 100644
index 0000000..f5382af
--- /dev/null
+++ b/contrib/libf2c/libF77/r_nint.c
@@ -0,0 +1,14 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double floor();
+double r_nint(x) real *x;
+#else
+#undef abs
+#include <math.h>
+double r_nint(real *x)
+#endif
+{
+return( (*x)>=0 ?
+ floor(*x + .5) : -floor(.5 - *x) );
+}
diff --git a/contrib/libf2c/libF77/r_sign.c b/contrib/libf2c/libF77/r_sign.c
new file mode 100644
index 0000000..df6d02a
--- /dev/null
+++ b/contrib/libf2c/libF77/r_sign.c
@@ -0,0 +1,12 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double r_sign(a,b) real *a, *b;
+#else
+double r_sign(real *a, real *b)
+#endif
+{
+double x;
+x = (*a >= 0 ? *a : - *a);
+return( *b >= 0 ? x : -x);
+}
diff --git a/contrib/libf2c/libF77/r_sin.c b/contrib/libf2c/libF77/r_sin.c
new file mode 100644
index 0000000..095b951
--- /dev/null
+++ b/contrib/libf2c/libF77/r_sin.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double sin();
+double r_sin(x) real *x;
+#else
+#undef abs
+#include <math.h>
+double r_sin(real *x)
+#endif
+{
+return( sin(*x) );
+}
diff --git a/contrib/libf2c/libF77/r_sinh.c b/contrib/libf2c/libF77/r_sinh.c
new file mode 100644
index 0000000..3bf4bb1
--- /dev/null
+++ b/contrib/libf2c/libF77/r_sinh.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double sinh();
+double r_sinh(x) real *x;
+#else
+#undef abs
+#include <math.h>
+double r_sinh(real *x)
+#endif
+{
+return( sinh(*x) );
+}
diff --git a/contrib/libf2c/libF77/r_sqrt.c b/contrib/libf2c/libF77/r_sqrt.c
new file mode 100644
index 0000000..d0203d3
--- /dev/null
+++ b/contrib/libf2c/libF77/r_sqrt.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double sqrt();
+double r_sqrt(x) real *x;
+#else
+#undef abs
+#include <math.h>
+double r_sqrt(real *x)
+#endif
+{
+return( sqrt(*x) );
+}
diff --git a/contrib/libf2c/libF77/r_tan.c b/contrib/libf2c/libF77/r_tan.c
new file mode 100644
index 0000000..fc0009e
--- /dev/null
+++ b/contrib/libf2c/libF77/r_tan.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double tan();
+double r_tan(x) real *x;
+#else
+#undef abs
+#include <math.h>
+double r_tan(real *x)
+#endif
+{
+return( tan(*x) );
+}
diff --git a/contrib/libf2c/libF77/r_tanh.c b/contrib/libf2c/libF77/r_tanh.c
new file mode 100644
index 0000000..818c6a8
--- /dev/null
+++ b/contrib/libf2c/libF77/r_tanh.c
@@ -0,0 +1,13 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double tanh();
+double r_tanh(x) real *x;
+#else
+#undef abs
+#include <math.h>
+double r_tanh(real *x)
+#endif
+{
+return( tanh(*x) );
+}
diff --git a/contrib/libf2c/libF77/s_cat.c b/contrib/libf2c/libF77/s_cat.c
new file mode 100644
index 0000000..f462fd2
--- /dev/null
+++ b/contrib/libf2c/libF77/s_cat.c
@@ -0,0 +1,75 @@
+/* Unless compiled with -DNO_OVERWRITE, this variant of s_cat allows the
+ * target of a concatenation to appear on its right-hand side (contrary
+ * to the Fortran 77 Standard, but in accordance with Fortran 90).
+ */
+
+#include "f2c.h"
+#ifndef NO_OVERWRITE
+#include <stdio.h>
+#undef abs
+#ifdef KR_headers
+ extern char *F77_aloc();
+ extern void free();
+ extern void G77_exit_0 ();
+#else
+#undef min
+#undef max
+#include <stdlib.h>
+ extern char *F77_aloc(ftnlen, char*);
+#endif
+#include <string.h>
+#endif /* NO_OVERWRITE */
+
+ VOID
+#ifdef KR_headers
+s_cat(lp, rpp, rnp, np, ll) char *lp, *rpp[]; ftnlen rnp[], *np, ll;
+#else
+s_cat(char *lp, char *rpp[], ftnlen rnp[], ftnlen *np, ftnlen ll)
+#endif
+{
+ ftnlen i, nc;
+ char *rp;
+ ftnlen n = *np;
+#ifndef NO_OVERWRITE
+ ftnlen L, m;
+ char *lp0, *lp1;
+
+ lp0 = 0;
+ lp1 = lp;
+ L = ll;
+ i = 0;
+ while(i < n) {
+ rp = rpp[i];
+ m = rnp[i++];
+ if (rp >= lp1 || rp + m <= lp) {
+ if ((L -= m) <= 0) {
+ n = i;
+ break;
+ }
+ lp1 += m;
+ continue;
+ }
+ lp0 = lp;
+ lp = lp1 = F77_aloc(L = ll, "s_cat");
+ break;
+ }
+ lp1 = lp;
+#endif /* NO_OVERWRITE */
+ for(i = 0 ; i < n ; ++i) {
+ nc = ll;
+ if(rnp[i] < nc)
+ nc = rnp[i];
+ ll -= nc;
+ rp = rpp[i];
+ while(--nc >= 0)
+ *lp++ = *rp++;
+ }
+ while(--ll >= 0)
+ *lp++ = ' ';
+#ifndef NO_OVERWRITE
+ if (lp0) {
+ memcpy(lp0, lp1, L);
+ free(lp1);
+ }
+#endif
+ }
diff --git a/contrib/libf2c/libF77/s_cmp.c b/contrib/libf2c/libF77/s_cmp.c
new file mode 100644
index 0000000..1e052f2
--- /dev/null
+++ b/contrib/libf2c/libF77/s_cmp.c
@@ -0,0 +1,44 @@
+#include "f2c.h"
+
+/* compare two strings */
+
+#ifdef KR_headers
+integer s_cmp(a0, b0, la, lb) char *a0, *b0; ftnlen la, lb;
+#else
+integer s_cmp(char *a0, char *b0, ftnlen la, ftnlen lb)
+#endif
+{
+register unsigned char *a, *aend, *b, *bend;
+a = (unsigned char *)a0;
+b = (unsigned char *)b0;
+aend = a + la;
+bend = b + lb;
+
+if(la <= lb)
+ {
+ while(a < aend)
+ if(*a != *b)
+ return( *a - *b );
+ else
+ { ++a; ++b; }
+
+ while(b < bend)
+ if(*b != ' ')
+ return( ' ' - *b );
+ else ++b;
+ }
+
+else
+ {
+ while(b < bend)
+ if(*a == *b)
+ { ++a; ++b; }
+ else
+ return( *a - *b );
+ while(a < aend)
+ if(*a != ' ')
+ return(*a - ' ');
+ else ++a;
+ }
+return(0);
+}
diff --git a/contrib/libf2c/libF77/s_copy.c b/contrib/libf2c/libF77/s_copy.c
new file mode 100644
index 0000000..d167351
--- /dev/null
+++ b/contrib/libf2c/libF77/s_copy.c
@@ -0,0 +1,51 @@
+/* Unless compiled with -DNO_OVERWRITE, this variant of s_copy allows the
+ * target of an assignment to appear on its right-hand side (contrary
+ * to the Fortran 77 Standard, but in accordance with Fortran 90),
+ * as in a(2:5) = a(4:7) .
+ */
+
+#include "f2c.h"
+
+/* assign strings: a = b */
+
+#ifdef KR_headers
+VOID s_copy(a, b, la, lb) register char *a, *b; ftnlen la, lb;
+#else
+void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb)
+#endif
+{
+ register char *aend, *bend;
+
+ aend = a + la;
+
+ if(la <= lb)
+#ifndef NO_OVERWRITE
+ if (a <= b || a >= b + la)
+#endif
+ while(a < aend)
+ *a++ = *b++;
+#ifndef NO_OVERWRITE
+ else
+ for(b += la; a < aend; )
+ *--aend = *--b;
+#endif
+
+ else {
+ bend = b + lb;
+#ifndef NO_OVERWRITE
+ if (a <= b || a >= bend)
+#endif
+ while(b < bend)
+ *a++ = *b++;
+#ifndef NO_OVERWRITE
+ else {
+ a += lb;
+ while(b < bend)
+ *--a = *--bend;
+ a += lb;
+ }
+#endif
+ while(a < aend)
+ *a++ = ' ';
+ }
+ }
diff --git a/contrib/libf2c/libF77/s_paus.c b/contrib/libf2c/libF77/s_paus.c
new file mode 100644
index 0000000..a7733a5
--- /dev/null
+++ b/contrib/libf2c/libF77/s_paus.c
@@ -0,0 +1,88 @@
+#include <stdio.h>
+#include "f2c.h"
+#define PAUSESIG 15
+
+#include "signal1.h"
+#ifdef KR_headers
+#define Void /* void */
+#define Int /* int */
+#else
+#define Void void
+#define Int int
+#undef abs
+#undef min
+#undef max
+#include <stdlib.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern int getpid(void), isatty(int), pause(void);
+#endif
+
+extern VOID f_exit(Void);
+
+ static VOID
+waitpause(Sigarg)
+{ Use_Sigarg;
+ return;
+ }
+
+ static VOID
+#ifdef KR_headers
+s_1paus(fin) FILE *fin;
+#else
+s_1paus(FILE *fin)
+#endif
+{
+ fprintf(stderr,
+ "To resume execution, type go. Other input will terminate the job.\n");
+ fflush(stderr);
+ if( getc(fin)!='g' || getc(fin)!='o' || getc(fin)!='\n' ) {
+ fprintf(stderr, "STOP\n");
+#ifdef NO_ONEXIT
+ f_exit();
+#endif
+ exit(0);
+ }
+ }
+
+ int
+#ifdef KR_headers
+s_paus(s, n) char *s; ftnlen n;
+#else
+s_paus(char *s, ftnlen n)
+#endif
+{
+ fprintf(stderr, "PAUSE ");
+ if(n > 0)
+ fprintf(stderr, " %.*s", (int)n, s);
+ fprintf(stderr, " statement executed\n");
+ if( isatty(fileno(stdin)) )
+ s_1paus(stdin);
+ else {
+#if (defined (MSDOS) && !defined (GO32)) || defined (_WIN32)
+ FILE *fin;
+ fin = fopen("con", "r");
+ if (!fin) {
+ fprintf(stderr, "s_paus: can't open con!\n");
+ fflush(stderr);
+ exit(1);
+ }
+ s_1paus(fin);
+ fclose(fin);
+#else
+ fprintf(stderr,
+ "To resume execution, execute a kill -%d %d command\n",
+ PAUSESIG, getpid() );
+ signal1(PAUSESIG, waitpause);
+ fflush(stderr);
+ pause();
+#endif
+ }
+ fprintf(stderr, "Execution resumes after PAUSE.\n");
+ fflush(stderr);
+ return 0; /* NOT REACHED */
+#ifdef __cplusplus
+ }
+#endif
+}
diff --git a/contrib/libf2c/libF77/s_rnge.c b/contrib/libf2c/libF77/s_rnge.c
new file mode 100644
index 0000000..189b524
--- /dev/null
+++ b/contrib/libf2c/libF77/s_rnge.c
@@ -0,0 +1,26 @@
+#include <stdio.h>
+#include "f2c.h"
+
+/* called when a subscript is out of range */
+
+#ifdef KR_headers
+extern VOID sig_die();
+integer s_rnge(varn, offset, procn, line) char *varn, *procn; ftnint offset, line;
+#else
+extern VOID sig_die(char*,int);
+integer s_rnge(char *varn, ftnint offset, char *procn, ftnint line)
+#endif
+{
+register int i;
+
+fprintf(stderr, "Subscript out of range on file line %ld, procedure ", line);
+while((i = *procn) && i != '_' && i != ' ')
+ putc(*procn++, stderr);
+fprintf(stderr, ".\nAttempt to access the %ld-th element of variable ", offset+1);
+while((i = *varn) && i != ' ')
+ putc(*varn++, stderr);
+sig_die(".", 1);
+#ifdef __cplusplus
+return 0;
+#endif
+}
diff --git a/contrib/libf2c/libF77/s_stop.c b/contrib/libf2c/libF77/s_stop.c
new file mode 100644
index 0000000..2e3f103
--- /dev/null
+++ b/contrib/libf2c/libF77/s_stop.c
@@ -0,0 +1,37 @@
+#include <stdio.h>
+#include "f2c.h"
+
+#ifdef KR_headers
+extern void f_exit();
+VOID s_stop(s, n) char *s; ftnlen n;
+#else
+#undef abs
+#undef min
+#undef max
+#include <stdlib.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+void f_exit(void);
+
+int s_stop(char *s, ftnlen n)
+#endif
+{
+int i;
+
+if(n > 0)
+ {
+ fprintf(stderr, "STOP ");
+ for(i = 0; i<n ; ++i)
+ putc(*s++, stderr);
+ fprintf(stderr, " statement executed\n");
+ }
+#ifdef NO_ONEXIT
+f_exit();
+#endif
+exit(0);
+#ifdef __cplusplus
+return 0; /* NOT REACHED */
+}
+#endif
+}
diff --git a/contrib/libf2c/libF77/setarg.c b/contrib/libf2c/libF77/setarg.c
new file mode 100644
index 0000000..929860a
--- /dev/null
+++ b/contrib/libf2c/libF77/setarg.c
@@ -0,0 +1,29 @@
+/* Set up the global argc/argv info for use by getarg_, iargc_, and
+ g77's inlined intrinsic equivalents. */
+
+#ifndef KR_headers
+#undef VOID
+#include <stdlib.h>
+#endif
+
+#ifndef VOID
+#define VOID void
+#endif
+
+int f__xargc;
+char **f__xargv;
+
+#ifdef __cplusplus
+ }
+#endif
+
+ void
+#ifdef KR_headers
+f_setarg(argc, argv) int argc; char **argv;
+#else
+f_setarg(int argc, char **argv)
+#endif
+{
+f__xargc = argc;
+f__xargv = argv;
+}
diff --git a/contrib/libf2c/libF77/setsig.c b/contrib/libf2c/libF77/setsig.c
new file mode 100644
index 0000000..8fde2fa
--- /dev/null
+++ b/contrib/libf2c/libF77/setsig.c
@@ -0,0 +1,101 @@
+/* Set up the signal behavior. */
+
+#include <stdio.h>
+#include "signal1.h"
+
+#ifndef SIGIOT
+#ifdef SIGABRT
+#define SIGIOT SIGABRT
+#endif
+#endif
+
+#ifndef KR_headers
+#undef VOID
+#include <stdlib.h>
+#endif
+
+#ifndef VOID
+#define VOID void
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef KR_headers
+extern VOID sig_die();
+#define Int /* int */
+#else
+extern void sig_die(char*, int);
+#define Int int
+#endif
+
+static VOID sigfdie(Sigarg)
+{
+Use_Sigarg;
+sig_die("Floating Exception", 1);
+}
+
+
+static VOID sigidie(Sigarg)
+{
+Use_Sigarg;
+sig_die("IOT Trap", 1);
+}
+
+#ifdef SIGQUIT
+static VOID sigqdie(Sigarg)
+{
+Use_Sigarg;
+sig_die("Quit signal", 1);
+}
+#endif
+
+
+static VOID sigindie(Sigarg)
+{
+Use_Sigarg;
+sig_die("Interrupt", 0);
+}
+
+static VOID sigtdie(Sigarg)
+{
+Use_Sigarg;
+sig_die("Killed", 0);
+}
+
+#ifdef SIGTRAP
+static VOID sigtrdie(Sigarg)
+{
+Use_Sigarg;
+sig_die("Trace trap", 1);
+}
+#endif
+
+
+#ifdef __cplusplus
+ }
+#endif
+
+ void
+f_setsig()
+{
+signal1(SIGFPE, sigfdie); /* ignore underflow, enable overflow */
+#ifdef SIGIOT
+signal1(SIGIOT, sigidie);
+#endif
+#ifdef SIGTRAP
+signal1(SIGTRAP, sigtrdie);
+#endif
+#ifdef SIGQUIT
+if(signal1(SIGQUIT,sigqdie) == SIG_IGN)
+ signal1(SIGQUIT, SIG_IGN);
+#endif
+if(signal1(SIGINT, sigindie) == SIG_IGN)
+ signal1(SIGINT, SIG_IGN);
+signal1(SIGTERM,sigtdie);
+
+#ifdef pdp11
+ ldfps(01200); /* detect overflow as an exception */
+#endif
+}
diff --git a/contrib/libf2c/libF77/sig_die.c b/contrib/libf2c/libF77/sig_die.c
new file mode 100644
index 0000000..bebb1e7
--- /dev/null
+++ b/contrib/libf2c/libF77/sig_die.c
@@ -0,0 +1,45 @@
+#include <stdio.h>
+#include <signal.h>
+
+#ifndef SIGIOT
+#ifdef SIGABRT
+#define SIGIOT SIGABRT
+#endif
+#endif
+
+#ifdef KR_headers
+void sig_die(s, kill) register char *s; int kill;
+#else
+#include <stdlib.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+ extern void f_exit(void);
+
+void sig_die(register char *s, int kill)
+#endif
+{
+ /* print error message, then clear buffers */
+ fprintf(stderr, "%s\n", s);
+
+ if(kill)
+ {
+ fflush(stderr);
+ f_exit();
+ fflush(stderr);
+ /* now get a core */
+#ifdef SIGIOT
+ signal(SIGIOT, SIG_DFL);
+#endif
+ abort();
+ }
+ else {
+#ifdef NO_ONEXIT
+ f_exit();
+#endif
+ exit(1);
+ }
+ }
+#ifdef __cplusplus
+}
+#endif
diff --git a/contrib/libf2c/libF77/signal1.h b/contrib/libf2c/libF77/signal1.h
new file mode 100644
index 0000000..b559211
--- /dev/null
+++ b/contrib/libf2c/libF77/signal1.h
@@ -0,0 +1,5 @@
+/* The g77 implementation of libf2c directly includes signal1.h0,
+ instead of copying it to signal1.h, since that seems easier to
+ cope with at this point. */
+
+#include "signal1.h0"
diff --git a/contrib/libf2c/libF77/signal1.h0 b/contrib/libf2c/libF77/signal1.h0
new file mode 100644
index 0000000..662cae4
--- /dev/null
+++ b/contrib/libf2c/libF77/signal1.h0
@@ -0,0 +1,37 @@
+/* You may need to adjust the definition of signal1 to supply a */
+/* cast to the correct argument type. This detail is system- and */
+/* compiler-dependent. The #define below assumes signal.h declares */
+/* type SIG_PF for the signal function's second argument. */
+
+#include <signal.h>
+
+#ifndef Sigret_t
+#define Sigret_t void
+#endif
+#ifndef Sigarg_t
+#ifdef KR_headers
+#define Sigarg_t
+#else
+#ifdef __cplusplus
+#define Sigarg_t ...
+#else
+#define Sigarg_t int
+#endif
+#endif
+#endif /*Sigarg_t*/
+
+#ifdef USE_SIG_PF /* compile with -DUSE_SIG_PF under IRIX */
+#define sig_pf SIG_PF
+#else
+typedef Sigret_t (*sig_pf)(Sigarg_t);
+#endif
+
+#define signal1(a,b) signal(a,(sig_pf)b)
+
+#ifdef __cplusplus
+#define Sigarg ...
+#define Use_Sigarg
+#else
+#define Sigarg Int n
+#define Use_Sigarg n = n /* shut up compiler warning */
+#endif
diff --git a/contrib/libf2c/libF77/signal_.c b/contrib/libf2c/libF77/signal_.c
new file mode 100644
index 0000000..b0d7ce6
--- /dev/null
+++ b/contrib/libf2c/libF77/signal_.c
@@ -0,0 +1,16 @@
+#include "f2c.h"
+#include "signal1.h"
+
+#ifdef KR_headers
+void *
+G77_signal_0 (sigp, proc) integer *sigp; sig_pf proc;
+#else
+void *
+G77_signal_0 (integer *sigp, sig_pf proc)
+#endif
+{
+ int sig;
+ sig = (int)*sigp;
+
+ return (void *) signal(sig, proc);
+ }
diff --git a/contrib/libf2c/libF77/system_.c b/contrib/libf2c/libF77/system_.c
new file mode 100644
index 0000000..ed024a1
--- /dev/null
+++ b/contrib/libf2c/libF77/system_.c
@@ -0,0 +1,36 @@
+/* f77 interface to system routine */
+
+#include "f2c.h"
+
+#ifdef KR_headers
+extern char *F77_aloc();
+
+ integer
+G77_system_0 (s, n) register char *s; ftnlen n;
+#else
+#undef abs
+#undef min
+#undef max
+#include <stdlib.h>
+extern char *F77_aloc(ftnlen, char*);
+
+ integer
+G77_system_0 (register char *s, ftnlen n)
+#endif
+{
+ char buff0[256], *buff;
+ register char *bp, *blast;
+ integer rv;
+
+ buff = bp = n < sizeof(buff0)
+ ? buff0 : F77_aloc(n+1, "system_");
+ blast = bp + n;
+
+ while(bp < blast && *s)
+ *bp++ = *s++;
+ *bp = 0;
+ rv = system(buff);
+ if (buff != buff0)
+ free(buff);
+ return rv;
+ }
diff --git a/contrib/libf2c/libF77/z_abs.c b/contrib/libf2c/libF77/z_abs.c
new file mode 100644
index 0000000..7e67ad2
--- /dev/null
+++ b/contrib/libf2c/libF77/z_abs.c
@@ -0,0 +1,12 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double f__cabs();
+double z_abs(z) doublecomplex *z;
+#else
+double f__cabs(double, double);
+double z_abs(doublecomplex *z)
+#endif
+{
+return( f__cabs( z->r, z->i ) );
+}
diff --git a/contrib/libf2c/libF77/z_cos.c b/contrib/libf2c/libF77/z_cos.c
new file mode 100644
index 0000000..a811bbe
--- /dev/null
+++ b/contrib/libf2c/libF77/z_cos.c
@@ -0,0 +1,19 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double sin(), cos(), sinh(), cosh();
+VOID z_cos(resx, z) doublecomplex *resx, *z;
+#else
+#undef abs
+#include <math.h>
+void z_cos(doublecomplex *resx, doublecomplex *z)
+#endif
+{
+doublecomplex res;
+
+res.r = cos(z->r) * cosh(z->i);
+res.i = - sin(z->r) * sinh(z->i);
+
+resx->r = res.r;
+resx->i = res.i;
+}
diff --git a/contrib/libf2c/libF77/z_div.c b/contrib/libf2c/libF77/z_div.c
new file mode 100644
index 0000000..4a987ab2
--- /dev/null
+++ b/contrib/libf2c/libF77/z_div.c
@@ -0,0 +1,39 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+extern VOID sig_die();
+VOID z_div(resx, a, b) doublecomplex *a, *b, *resx;
+#else
+extern void sig_die(char*, int);
+void z_div(doublecomplex *resx, doublecomplex *a, doublecomplex *b)
+#endif
+{
+double ratio, den;
+double abr, abi;
+doublecomplex res;
+
+if( (abr = b->r) < 0.)
+ abr = - abr;
+if( (abi = b->i) < 0.)
+ abi = - abi;
+if( abr <= abi )
+ {
+ if(abi == 0)
+ sig_die("complex division by zero", 1);
+ ratio = b->r / b->i ;
+ den = b->i * (1 + ratio*ratio);
+ res.r = (a->r*ratio + a->i) / den;
+ res.i = (a->i*ratio - a->r) / den;
+ }
+
+else
+ {
+ ratio = b->i / b->r ;
+ den = b->r * (1 + ratio*ratio);
+ res.r = (a->r + a->i*ratio) / den;
+ res.i = (a->i - a->r*ratio) / den;
+ }
+
+resx->r = res.r;
+resx->i = res.i;
+}
diff --git a/contrib/libf2c/libF77/z_exp.c b/contrib/libf2c/libF77/z_exp.c
new file mode 100644
index 0000000..85fb63e
--- /dev/null
+++ b/contrib/libf2c/libF77/z_exp.c
@@ -0,0 +1,21 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double exp(), cos(), sin();
+VOID z_exp(resx, z) doublecomplex *resx, *z;
+#else
+#undef abs
+#include <math.h>
+void z_exp(doublecomplex *resx, doublecomplex *z)
+#endif
+{
+double expx;
+doublecomplex res;
+
+expx = exp(z->r);
+res.r = expx * cos(z->i);
+res.i = expx * sin(z->i);
+
+resx->r = res.r;
+resx->i = res.i;
+}
diff --git a/contrib/libf2c/libF77/z_log.c b/contrib/libf2c/libF77/z_log.c
new file mode 100644
index 0000000..48afca6
--- /dev/null
+++ b/contrib/libf2c/libF77/z_log.c
@@ -0,0 +1,20 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double log(), f__cabs(), atan2();
+VOID z_log(resx, z) doublecomplex *resx, *z;
+#else
+#undef abs
+#include <math.h>
+extern double f__cabs(double, double);
+void z_log(doublecomplex *resx, doublecomplex *z)
+#endif
+{
+doublecomplex res;
+
+res.i = atan2(z->i, z->r);
+res.r = log( f__cabs( z->r, z->i ) );
+
+resx->r = res.r;
+resx->i = res.i;
+}
diff --git a/contrib/libf2c/libF77/z_sin.c b/contrib/libf2c/libF77/z_sin.c
new file mode 100644
index 0000000..94456c9
--- /dev/null
+++ b/contrib/libf2c/libF77/z_sin.c
@@ -0,0 +1,19 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double sin(), cos(), sinh(), cosh();
+VOID z_sin(resx, z) doublecomplex *resx, *z;
+#else
+#undef abs
+#include <math.h>
+void z_sin(doublecomplex *resx, doublecomplex *z)
+#endif
+{
+doublecomplex res;
+
+res.r = sin(z->r) * cosh(z->i);
+res.i = cos(z->r) * sinh(z->i);
+
+resx->r = res.r;
+resx->i = res.i;
+}
diff --git a/contrib/libf2c/libF77/z_sqrt.c b/contrib/libf2c/libF77/z_sqrt.c
new file mode 100644
index 0000000..f5db565
--- /dev/null
+++ b/contrib/libf2c/libF77/z_sqrt.c
@@ -0,0 +1,33 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+double sqrt(), f__cabs();
+VOID z_sqrt(resx, z) doublecomplex *resx, *z;
+#else
+#undef abs
+#include <math.h>
+extern double f__cabs(double, double);
+void z_sqrt(doublecomplex *resx, doublecomplex *z)
+#endif
+{
+double mag;
+doublecomplex res;
+
+if( (mag = f__cabs(z->r, z->i)) == 0.)
+ res.r = res.i = 0.;
+else if(z->r > 0)
+ {
+ res.r = sqrt(0.5 * (mag + z->r) );
+ res.i = z->i / res.r / 2;
+ }
+else
+ {
+ res.i = sqrt(0.5 * (mag - z->r) );
+ if(z->i < 0)
+ res.i = - res.i;
+ res.r = z->i / res.i / 2;
+ }
+
+resx->r = res.r;
+resx->i = res.i;
+}
OpenPOWER on IntegriCloud