--- f2c-20020621.orig/f2c.1 +++ f2c-20020621/f2c.1 @@ -1,222 +1,330 @@ - F2C(1) UNIX System V F2C(1) - NAME - f2c - Convert Fortran 77 to C or C++ - SYNOPSIS - f2c [ option ... ] file ... +F2C(1) F2C(1) - DESCRIPTION - F2c converts Fortran 77 source code in files with names end- - ing in `.f' or `.F' to C (or C++) source files in the cur- - rent directory, with `.c' substituted for the final `.f' or - `.F'. If no Fortran files are named, f2c reads Fortran from - standard input and writes C on standard output. File names - that end with `.p' or `.P' are taken to be prototype files, - as produced by option `-P', and are read first. - The following options have the same meaning as in f77(1). +NNAAMMEE + f2c - Convert Fortran 77 to C or C++ - -C Compile code to check that subscripts are within - declared array bounds. +SSYYNNOOPPSSIISS + ff22cc [ _o_p_t_i_o_n _._._. ] _f_i_l_e _._._. - -I2 Render INTEGER and LOGICAL as short, INTEGER*4 as long - int. Assume the default libF77 and libI77: allow only - INTEGER*4 (and no LOGICAL) variables in INQUIREs. - Option `-I4' confirms the default rendering of INTEGER - as long int. +DDEESSCCRRIIPPTTIIOONN + _F_2_c converts Fortran 77 source code in _f_i_l_e_s with names + ending in `.f' or `.F' to C (or C++) source files in the + current directory, with `.c' substituted for the final + `.f' or `.F'. If no Fortran files are named, _f_2_c reads + Fortran from standard input and writes C on standard out- + put. _F_i_l_e names that end with `.p' or `.P' are taken to + be prototype files, as produced by option `-P', and are + read first. - -Idir - Look for a non-absolute include file first in the - directory of the current input file, then in directo- - ries specified by -I options (one directory per - option). Options -I2 and -I4 have precedence, so, - e.g., a directory named 2 should be specified by -I./2 - . + The following options have the same meaning as in _f_7_7(1). - -onetrip - Compile DO loops that are performed at least once if - reached. (Fortran 77 DO loops are not performed at all - if the upper limit is smaller than the lower limit.) + --CC Compile code to check that subscripts are within + declared array bounds. - -U Honor the case of variable and external names. Fortran - keywords must be in lower case. + --II22 Render INTEGER and LOGICAL as short, INTEGER*4 as + long int. Assumes the default _l_i_b_f_2_c: allow only + INTEGER*4 (and no LOGICAL) variables in INQUIREs. + Option `-I4' confirms the default rendering of + INTEGER as long int. - -u Make the default type of a variable `undefined' rather - than using the default Fortran rules. + --II_d_i_r Look for a non-absolute include file first in the + directory of the current input file, then in direc- + tories specified by -I options (one directory per + option). Options -I2 and -I4 have precedence, so, + e.g., a directory named 2 should be specified by + -I./2 . - -w Suppress all warning messages, or, if the option is - `-w66', just Fortran 66 compatibility warnings. + --oonneettrriipp + Compile DO loops that are performed at least once + if reached. (Fortran 77 DO loops are not performed + at all if the upper limit is smaller than the lower + limit.) - The following options are peculiar to f2c. + --UU Honor the case of variable and external names. + Fortran keywords must be in _l_o_w_e_r case. - -A Produce ANSI C (default, starting 20020621). For old- - style C, use option -K. + --uu Make the default type of a variable `undefined' + rather than using the default Fortran rules. - Page 1 (printed 6/21/02) + --ww Suppress all warning messages, or, if the option is + `-w66', just Fortran 66 compatibility warnings. - F2C(1) UNIX System V F2C(1) + The following options are peculiar to _f_2_c. - -a Make local variables automatic rather than static - unless they appear in a DATA, EQUIVALENCE, NAMELIST, or - SAVE statement. + --AA Produce ANSI C (default, starting 20020621). For + old-style C, use option -K. - -C++ Output C++ code. - -c Include original Fortran source as comments. - -cd Do not recognize cdabs, cdcos, cdexp, cdlog, cdsin, and - cdsqrt as synonyms for the double complex intrinsics - zabs, zcos, zexp, zlog, zsin, and zsqrt, respectively, - nor dreal as a synonym for dble. - -ddir - Write `.c' files in directory dir instead of the cur- - rent directory. + 1 - -E Declare uninitialized COMMON to be Extern (overridably - defined in f2c.h as extern). - -ec Place uninitialized COMMON blocks in separate files: - COMMON /ABC/ appears in file abc_com.c. Option `-e1c' - bundles the separate files into the output file, with - comments that give an unbundling sed(1) script. - -ext Complain about f77(1) extensions. - -f Assume free-format input: accept text after column 72 - and do not pad fixed-format lines shorter than 72 char- - acters with blanks. - -72 Treat text appearing after column 72 as an error. +F2C(1) F2C(1) - -g Include original Fortran line numbers in #line lines. - -h Emulate Fortran 66's treatment of Hollerith: try to - align character strings on word (or, if the option is - `-hd', on double-word) boundaries. + --aa Make local variables automatic rather than static + unless they appear in a DATA, EQUIVALENCE, + NAMELIST, or SAVE statement. - -i2 Similar to -I2, but assume a modified libF77 and libI77 - (compiled with -Df2c_i2), so INTEGER and LOGICAL vari- - ables may be assigned by INQUIRE and array lengths are - stored in short ints. + --CC++++ Output C++ code. - -i90 Do not recognize the Fortran 90 bit-manipulation - intrinsics btest, iand, ibclr, ibits, ibset, ieor, ior, - ishft, and ishftc. + --cc Include original Fortran source as comments. - -kr Use temporary values to enforce Fortran expression - evaluation where K&R (first edition) parenthesization - rules allow rearrangement. If the option is `-krd', - use double precision temporaries even for single- + --ccdd Do not recognize cdabs, cdcos, cdexp, cdlog, cdsin, + and cdsqrt as synonyms for the double complex + intrinsics zabs, zcos, zexp, zlog, zsin, and zsqrt, + respectively, nor dreal as a synonym for dble. - Page 2 (printed 6/21/02) + --dd_d_i_r Write `.c' files in directory _d_i_r instead of the + current directory. - F2C(1) UNIX System V F2C(1) + --EE Declare uninitialized COMMON to be EExxtteerrnn (overrid- + ably defined in f2c.h as eexxtteerrnn)).. - precision operands. + --eecc Place uninitialized COMMON blocks in separate + files: CCOOMMMMOONN //AABBCC// appears in file aabbcc__ccoomm..cc. + Option `-e1c' bundles the separate files into the + output file, with comments that give an unbundling + _s_e_d(1) script. - -P Write a file.P of ANSI (or C++) prototypes for defini- - tions in each input file.f or file.F. When reading - Fortran from standard input, write prototypes at the - beginning of standard output. Option -Ps implies -P - and gives exit status 4 if rerunning f2c may change - prototypes or declarations. + --eexxtt Complain about _f_7_7(1) extensions. - -p Supply preprocessor definitions to make common-block - members look like local variables. + --ff Assume free-format input: accept text after column + 72 and do not pad fixed-format lines shorter than + 72 characters with blanks. - -R Do not promote REAL functions and operations to DOUBLE - PRECISION. Option `-!R' confirms the default, which - imitates f77. + --7722 Treat text appearing after column 72 as an error. - -r Cast REAL arguments of intrinsic functions and values - of REAL functions (including intrinsics) to REAL. + --gg Include original Fortran line numbers in #line + lines. - -r8 Promote REAL to DOUBLE PRECISION, COMPLEX to DOUBLE - COMPLEX. + --hh Emulate Fortran 66's treatment of Hollerith: try to + align character strings on word (or, if the option + is `-hd', on double-word) boundaries. - -s Preserve multidimensional subscripts. Suppressed by - option `-C' . + --ii22 Similar to --II22, but assume using a modified + _l_i_b_f_2_c___i_2 (which was compiled with --DDff22cc__ii22), so + INTEGER and LOGICAL variables may be assigned by + INQUIRE and array lengths are stored in short ints. - -Tdir - Put temporary files in directory dir. + --ii9900 Do not recognize the Fortran 90 bit-manipulation + intrinsics btest, iand, ibclr, ibits, ibset, ieor, + ior, ishft, and ishftc. - -trapuv - Dynamically initialize local variables, except those - appearing in SAVE or DATA statements, with values that - may help find references to uninitialized variables. - For example, with IEEE arithmetic, initialize local - floating-point variables to signaling NaNs. + --kkrr Use temporary values to enforce Fortran expression + evaluation where K&R (first edition) parenthesiza- + tion rules allow rearrangement. If the option is + `-krd', use double precision temporaries even for + single-precision operands. - -w8 Suppress warnings when COMMON or EQUIVALENCE forces - odd-word alignment of doubles. - -Wn Assume n characters/word (default 4) when initializing - numeric variables with character data. - -z Do not implicitly recognize DOUBLE COMPLEX. + 2 - -!bs Do not recognize backslash escapes (\", \', \0, \\, \b, - \f, \n, \r, \t, \v) in character strings. - -!c Inhibit C output, but produce -P output. - -!I Reject include statements. - -!i8 Disallow INTEGER*8 , or, if the option is `-!i8const', - permit INTEGER*8 but do not promote integer constants - Page 3 (printed 6/21/02) +F2C(1) F2C(1) - F2C(1) UNIX System V F2C(1) - to INTEGER*8 when they involve more than 32 bits. + --PP Write a _f_i_l_e..PP of ANSI (or C++) prototypes for def- + initions in each input _f_i_l_e..ff or _f_i_l_e..FF_. When + reading Fortran from standard input, write proto- + types at the beginning of standard output. Option + --PPss implies --PP and gives exit status 4 if rerunning + _f_2_c may change prototypes or declarations. - -!it Don't infer types of untyped EXTERNAL procedures from - use as parameters to previously defined or prototyped - procedures. + --pp Supply preprocessor definitions to make common- + block members look like local variables. - -!P Do not attempt to infer ANSI or C++ prototypes from - usage. + --RR Do not promote REAL functions and operations to + DOUBLE PRECISION. Option `-!R' confirms the + default, which imitates _f_7_7. - The resulting C invokes the support routines of f77; object - code should be loaded by f77 or with ld(1) or cc(1) options - -lF77 -lI77 -lm. Calling conventions are those of f77: see - the reference below. + --rr Cast REAL arguments of intrinsic functions and val- + ues of REAL functions (including intrinsics) to + REAL. - FILES - file.[fF] input file + --rr88 Promote REAL to DOUBLE PRECISION, COMPLEX to DOUBLE + COMPLEX. - *.c output file + --ss Preserve multidimensional subscripts. Suppressed + by option `-C' . - /usr/include/f2c.h - header file + --TT_d_i_r Put temporary files in directory _d_i_r_. - /usr/lib/libF77.aintrinsic function library + --ttrraappuuvv + Dynamically initialize local variables, except + those appearing in SAVE or DATA statements, with + values that may help find references to uninitial- + ized variables. For example, with IEEE arithmetic, + initialize local floating-point variables to sig- + naling NaNs. - /usr/lib/libI77.aFortran I/O library + --ww88 Suppress warnings when COMMON or EQUIVALENCE forces + odd-word alignment of doubles. - /lib/libc.a C library, see section 3 + --WW_n Assume _n characters/word (default 4) when initial- + izing numeric variables with character data. - SEE ALSO - S. I. Feldman and P. J. Weinberger, `A Portable Fortran 77 - Compiler', UNIX Time Sharing System Programmer's Manual, - Tenth Edition, Volume 2, AT&T Bell Laboratories, 1990. + --zz Do not implicitly recognize DOUBLE COMPLEX. - DIAGNOSTICS - The diagnostics produced by f2c are intended to be self- - explanatory. + --!!bbss Do not recognize _back_slash escapes (\", \', \0, \\, + \b, \f, \n, \r, \t, \v) in character strings. - BUGS - Floating-point constant expressions are simplified in the - floating-point arithmetic of the machine running f2c, so - they are typically accurate to at most 16 or 17 decimal - places. - Untypable EXTERNAL functions are declared int. - There is no notation for INTEGER*8 constants. - Some intrinsic functions do not yet work with INTEGER*8 . + --!!cc Inhibit C output, but produce --PP output. + + --!!II Reject iinncclluuddee statements. + + --!!ii88 Disallow INTEGER*8 , or, if the option is + `-!i8const', permit INTEGER*8 but do not promote + integer constants to INTEGER*8 when they involve + more than 32 bits. + + + + + 3 + + + + + +F2C(1) F2C(1) + + + --!!iitt Don't infer types of untyped EXTERNAL procedures + from use as parameters to previously defined or + prototyped procedures. + + --!!PP Do not attempt to infer ANSI or C++ prototypes from + usage. + + The resulting C invokes the support routines of _f_7_7; + object code should be loaded by _f_7_7 or with _l_d(1) or _c_c(1) + options --llFF7777 --llII7777 --llmm. Calling conventions are those of + _f_7_7: see the reference below. + +FFIILLEESS + _f_i_l_e..[[ffFF]] + input file + + **..cc output file + + /usr/include/f2c.h + header file + + /usr/lib/libf2c.a + Default Fortran I/O and intrinsic function static + library + + /usr/lib/libf2c_i2.a + Fortran I/O and intrinsic function static library + (compiled so that short INTEGERs and LOGICALs may + be assigned by INQUIRE). To be used with the --ii22 + option. + + /usr/lib/libf2c.so.2 + Fortran I/O and intrinsic function shared library + + /usr/lib/libf2c_i2.so.2 + Fortran I/O and intrinsic function shared library + (for use with --ii22 option) see the information about + the static version above). + +SSEEEE AALLSSOO + S. I. Feldman and P. J. Weinberger, `A Portable Fortran 77 + Compiler', _U_N_I_X _T_i_m_e _S_h_a_r_i_n_g _S_y_s_t_e_m _P_r_o_g_r_a_m_m_e_r_'_s _M_a_n_u_a_l, + Tenth Edition, Volume 2, AT&T Bell Laboratories, 1990. + +DDIIAAGGNNOOSSTTIICCSS + The diagnostics produced by _f_2_c are intended to be self- + explanatory. + +BBUUGGSS + Floating-point constant expressions are simplified in the + floating-point arithmetic of the machine running _f_2_c, so + they are typically accurate to at most 16 or 17 decimal + places. + Untypable EXTERNAL functions are declared iinntt. + + + + 4 + + + + + +F2C(1) F2C(1) + + + There is no notation for INTEGER*8 constants. + Some intrinsic functions do not yet work with INTEGER*8 . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 - Page 4 (printed 6/21/02) --- f2c-20020621.orig/f2c.1t +++ f2c-20020621/f2c.1t @@ -69,8 +69,8 @@ .TP .B -I2 Render INTEGER and LOGICAL as short, -INTEGER\(**4 as long int. Assume the default \fIlibF77\fR -and \fIlibI77\fR: allow only INTEGER\(**4 (and no LOGICAL) +INTEGER\(**4 as long int. Assumes the default \fIlibf2c\fR: +allow only INTEGER\(**4 (and no LOGICAL) variables in INQUIREs. Option .L -I4 confirms the default rendering of INTEGER as long int. @@ -185,11 +185,9 @@ .B -i2 Similar to .BR -I2 , -but assume a modified -.I libF77 -and -.I libI77 -(compiled with +but assume using a modified +.I libf2c_i2 +(which was compiled with .BR -Df\^2c_i2 ), so .SM INTEGER @@ -335,7 +333,7 @@ or .IR cc (1) options -.BR "-lF77 -lI77 -lm" . +.BR "-lf2c -lm" . Calling conventions are those of .IR f\&77 : @@ -353,14 +351,23 @@ .F /usr/include/f2c.h header file .TP -.F /usr/lib/libF77.a -intrinsic function library +.F /usr/lib/libf2c.a +Default Fortran I/O and intrinsic function static library +.TP +.F /usr/lib/libf2c_i2.a +Fortran I/O and intrinsic function static library (compiled so that +short INTEGERs and LOGICALs may be assigned by INQUIRE). To be +used with the +.B -i2 +option. .TP -.F /usr/lib/libI77.a -Fortran I/O library +.F /usr/lib/libf2c.so.2 +Fortran I/O and intrinsic function shared library .TP -.F /lib/libc.a -C library, see section 3 +.F /usr/lib/libf2c_i2.so.2 +Fortran I/O and intrinsic function shared library (for use with +.B -i2 +option) see the information about the static version above). .SH "SEE ALSO" S. I. Feldman and P. J. Weinberger, --- f2c-20020621.orig/fc +++ f2c-20020621/fc @@ -11,7 +11,7 @@ # may be useful as way to pass system-specific stuff to the C compiler. # The script below simply appends to the initial CFLAGS value. -PATH=/usr/local/bin:/bin:/usr/bin +PATH=/usr/bin:/bin:/usr/bin # f77-style shell script to compile and load fortran, C, and assembly codes --- f2c-20020621.orig/src/f2c.master.h +++ f2c-20020621/src/f2c.master.h @@ -0,0 +1,223 @@ +/* f2c.h -- Standard Fortran to C header file */ + +/** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed." + + - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */ + +#ifndef F2C_INCLUDE +#define F2C_INCLUDE + +typedef long int integer; +typedef unsigned long int uinteger; +typedef char *address; +typedef short int shortint; +typedef float real; +typedef double doublereal; +typedef struct { real r, i; } complex; +typedef struct { doublereal r, i; } doublecomplex; +typedef long int logical; +typedef short int shortlogical; +typedef char logical1; +typedef char integer1; +#ifdef INTEGER_STAR_8 /* Adjust for integer*8. */ +typedef long long longint; /* system-dependent */ +typedef unsigned long long ulongint; /* system-dependent */ +#define qbit_clear(a,b) ((a) & ~((ulongint)1 << (b))) +#define qbit_set(a,b) ((a) | ((ulongint)1 << (b))) +#endif + +#define TRUE_ (1) +#define FALSE_ (0) + +/* Extern is for use with -E */ +#ifndef Extern +#define Extern extern +#endif + +/* I/O stuff */ + +#ifdef f2c_i2 +/* for -i2 */ +typedef short flag; +typedef short ftnlen; +typedef short ftnint; +#else +typedef long int flag; +typedef long int ftnlen; +typedef long int ftnint; +#endif + +/*external read, write*/ +typedef struct +{ flag cierr; + ftnint ciunit; + flag ciend; + char *cifmt; + ftnint cirec; +} cilist; + +/*internal read, write*/ +typedef struct +{ flag icierr; + char *iciunit; + flag iciend; + char *icifmt; + ftnint icirlen; + ftnint icirnum; +} icilist; + +/*open*/ +typedef struct +{ flag oerr; + ftnint ounit; + char *ofnm; + ftnlen ofnmlen; + char *osta; + char *oacc; + char *ofm; + ftnint orl; + char *oblnk; +} olist; + +/*close*/ +typedef struct +{ flag cerr; + ftnint cunit; + char *csta; +} cllist; + +/*rewind, backspace, endfile*/ +typedef struct +{ flag aerr; + ftnint aunit; +} alist; + +/* inquire */ +typedef struct +{ flag inerr; + ftnint inunit; + char *infile; + ftnlen infilen; + ftnint *inex; /*parameters in standard's order*/ + ftnint *inopen; + ftnint *innum; + ftnint *innamed; + char *inname; + ftnlen innamlen; + char *inacc; + ftnlen inacclen; + char *inseq; + ftnlen inseqlen; + char *indir; + ftnlen indirlen; + char *infmt; + ftnlen infmtlen; + char *inform; + ftnint informlen; + char *inunf; + ftnlen inunflen; + ftnint *inrecl; + ftnint *innrec; + char *inblank; + ftnlen inblanklen; +} inlist; + +#define VOID void + +union Multitype { /* for multiple entry points */ + integer1 g; + shortint h; + integer i; + /* longint j; */ + real r; + doublereal d; + complex c; + doublecomplex z; + }; + +typedef union Multitype Multitype; + +/*typedef long int Long;*/ /* No longer used; formerly in Namelist */ + +struct Vardesc { /* for Namelist */ + char *name; + char *addr; + ftnlen *dims; + int type; + }; +typedef struct Vardesc Vardesc; + +struct Namelist { + char *name; + Vardesc **vars; + int nvars; + }; +typedef struct Namelist Namelist; + +#define abs(x) ((x) >= 0 ? (x) : -(x)) +#define dabs(x) (doublereal)abs(x) +#define min(a,b) ((a) <= (b) ? (a) : (b)) +#define max(a,b) ((a) >= (b) ? (a) : (b)) +#define dmin(a,b) (doublereal)min(a,b) +#define dmax(a,b) (doublereal)max(a,b) +#define bit_test(a,b) ((a) >> (b) & 1) +#define bit_clear(a,b) ((a) & ~((uinteger)1 << (b))) +#define bit_set(a,b) ((a) | ((uinteger)1 << (b))) + +/* procedure parameter types for -A and -C++ */ + +#define F2C_proc_par_types 1 +#ifdef __cplusplus +typedef int /* Unknown procedure type */ (*U_fp)(...); +typedef shortint (*J_fp)(...); +typedef integer (*I_fp)(...); +typedef real (*R_fp)(...); +typedef doublereal (*D_fp)(...), (*E_fp)(...); +typedef /* Complex */ VOID (*C_fp)(...); +typedef /* Double Complex */ VOID (*Z_fp)(...); +typedef logical (*L_fp)(...); +typedef shortlogical (*K_fp)(...); +typedef /* Character */ VOID (*H_fp)(...); +typedef /* Subroutine */ int (*S_fp)(...); +#else +typedef int /* Unknown procedure type */ (*U_fp)(); +typedef shortint (*J_fp)(); +typedef integer (*I_fp)(); +typedef real (*R_fp)(); +typedef doublereal (*D_fp)(), (*E_fp)(); +typedef /* Complex */ VOID (*C_fp)(); +typedef /* Double Complex */ VOID (*Z_fp)(); +typedef logical (*L_fp)(); +typedef shortlogical (*K_fp)(); +typedef /* Character */ VOID (*H_fp)(); +typedef /* Subroutine */ int (*S_fp)(); +#endif +/* E_fp is for real functions when -R is not specified */ +typedef VOID C_f; /* complex function */ +typedef VOID H_f; /* character function */ +typedef VOID Z_f; /* double complex function */ +typedef doublereal E_f; /* real function with -R not specified */ + +/* undef any lower-case symbols that your C compiler predefines, e.g.: */ + +#ifndef Skip_f2c_Undefs +#undef cray +#undef gcos +#undef mc68010 +#undef mc68020 +#undef mips +#undef pdp11 +#undef sgi +#undef sparc +#undef sun +#undef sun2 +#undef sun3 +#undef sun4 +#undef u370 +#undef u3b +#undef u3b2 +#undef u3b5 +#undef unix +#undef vax +#endif +#endif --- f2c-20020621.orig/debian/README.debian +++ f2c-20020621/debian/README.debian @@ -0,0 +1,19 @@ +f2c for debian +-------------- + +Original source downloaded from ftp://netlib.bell-labs.com/netlib/f2c. + +This version of f2c automatically converts the header file +f2c.h to not use long ints when compiled on alpha architecture, +as this generates incorrect code for EQUIVALENCEs (64 bit longs +are used on the alpha), and is not compatible with g77. On +other platforms the file is used as is. Similar changes +may turn out to be needed on other 64 bit architectures. + +The libF77 has been MODIFIED to work on MC68k machines. Thus the +libf77 file now differs from that in the original version. I hope +this will be temporary until the M68K is fully supported by f2c. This +only affects the new -trapuv (trap unitialised values) flag which +requires the co-processor exception control mask to be set up. + + Alan Bain Wed, 4 Jul 2001 --- f2c-20020621.orig/debian/changelog +++ f2c-20020621/debian/changelog @@ -0,0 +1,149 @@ +f2c (20020621-2) unstable; urgency=low + * fixed longstanding errors in manpage with reference to the f2c + libraries, closing bug #167660 + -- Alan Bain Tue, 5 November 2002 21:30:00 +0000 +f2c (20020621-1) unstable; urgency=low + * new upstream release fixes a few minor bugs + -- Alan Bain Sun, 22 September 2002 16:15:36 +0100 +f2c (20010821-3) unstable; urgency=low + * Fixed the uninit.c file to take advantage of new GLIBC 2.2 and later + features for setting FPU exception mask + * Incorporated suggestions of Peter Maydell closing #120902 & #121812 + -- Alan Bain Tue, 19 February 2002 16:00:00 +0000 +f2c (20010821-2) unstable; urgency=low + * Corrected capitalization of fortran to FORTRAN closing #124608 + -- Alan Bain Thur, 24 January 2001 11:00:00 +0000 +f2c (20010821-1) unstable; urgency=low + * new upstream relase incorporates patch made in (20010618-3) + * -trapuv works correctly on PPC closing bug #117789 + * -trapuv code generates suitable error on IA64 closing ##110494 + and #104613 + -- Alan Bain Fri, 9 November 2001 17:00:00 -0800 +f2c (20010618-3) unstable; urgency=low + * corrected libF77/uninit.c to correctly set up the FPU registers on + M68K machines, closing bug #103287 + -- Alan Bain Wed, 4 July 2001 10:00:00 +0100 +f2c (20010618-2) unstable; urgency=low + * corrected upload to fix problem with original + -- Alan Bain Tue, 3 July 2001 15:00:00 +0100 +f2c (20010618-1) unstable; urgency=low + * New upstream release from netlib (www.netlib.org) + * min,max of three or more arguments now work in parameter statements + * Accept write , format (as per Fortran IV) + * more accurate algorithm used for double precision complex log function + * error "impossible conversion" now generated by attempts to assign + character expressions to integer values rather than an implicit + conversion being performed. + * new option -trapuv (trap uninitialized values) which dynamically + initializes uninitiliazed variables. + -- Alan Bain Mon, 2 July 2001 17:00:00 +0100 +f2c (19991025-1) unstable; urgency=low + * New upstream release from netlib included better support for + 64 bit machines in the fortran libraries. + * FHS file locations now used + -- Alan Bain Mon, 8 Nov 1999 15:30:00 +0000 +f2c (19990503-4) unstable; urgency=low + * Fixed fc script to remove an unsafe method of creating a + temporary file, and replaced by a call to tempfile. + -- Alan Bain Fri, 28 May 1999 10:00:00 +0100 +f2c (19990503-3) unstable; urgency=low + * for alpha now converts header file correctly not to use long ints + which is more compatible with g77. + -- Alan Bain Mon, 24 May 1999 19:35:00 +0100 +f2c (19990503-2) unstable; urgency=low + * Fixed libc6 problem + -- Alan Bain Sat, 22 May 1999 22:00:00 +0100 +f2c (19990503-1) unstable; urgency=low + * New upstream release from netlib includes some improved error + messages when translating (in particular it correctly attempts + to locate the line on which an error occured). + * manpage for fc is now compressed + * upstream changelog installed as changelog rather than changes + * postinst now calls ldconfig + -- Alan Bain Sat, 15 May 1999 10:00:00 +0100 +f2c (19990210-1) unstable; urgency=low + * Updated to new netlib source + * previous fixes to gram.c generation from yacc grammar + have now been incorporated in upstream source + * missing TAB in debian/rules added + -- Alan Bain Tue, 24 Feb 1999 23:30:00 +0000 +f2c (19971204-5) frozen; urgency=low + * Removed unwanted file debian/files which got left in + by mistake in the previous build. + * ammended clean target to remove these unwanted files. + -- Alan Bain Sat, 16 May 1998 23:30:00 +0100 +f2c (19971204-4) frozen; urgency=low + + * Check error code from tempfile in fc script now + (really closing bug #19790) + -- Alan Bain Mon, 11 May 1998 21:30:00 +0100 +f2c (19971204-3) unstable; urgency=low + + * Fixed fc script so as not to use /tmp in insecure fashion + closing bug #19790 -- use of /tmp/*$$ + * Added man page for fc (thanks to Peter Maydell) + closing bug reported by lintian + * Changed debian/rules order for gencontrol and shlibdeps + closing bug #17429 + * Made -mieee-fp an ix86 architecture only option + closing bugs #17430, #21247 + -- Alan Bain Thu, 7 May 1998 22:00:00 +0100 +f2c (19971204-2) unstable; urgency=low + + * Fixed shlibs problems by adding shlibs file and removing + references to ldconfig in scripts. + * Updated to latest standards + + -- Alan Bain Sat, 14 Mar 1998 21:00:00 +0000 +f2c (19971204-1) unstable; urgency=low + + * Latest netlib sources + + -- Alan Bain Fri, 16 Jan 1998 18:00:00 +0000 + +f2c (970219) unstable; urgency=low + + * Release based on netlib sources containing f2c as of 19/02/97. + * Extensive tests for a large f77 project. + + -- Alan Bain Sun, 16 Nov 1997 21:20:00 +0000 + +f2c (961209) unstable; urgency=low + + * Release based on netlib sources on 26/1/97, containing + f2c from 09/12/97. + * Fix bugs + * Change to new source packaging format + * Libraries are now stripped + + -- Alan Bain Fri, 28 Feb 1997 19:30:00 +0100 +Thu Jul 25 10:43:03 1996 Dirk Eddelbuettel + + * interim release coordinated with the new maintainer, Alan Bain, + based on the netlib sources as of July 25, 1996 which contain + the f2c release of July 17, 1996 + + * debian.rules: added arch=$(shell dpkg --print-architecture) + + * debian.rules: removed -m486 from GCCOPTS, changed to -O2 + + * debian.rules: now builts the libI77 and libF77 directories + in build target out of libi77 and libf77 source files; libI77 + and libF77 are removed by clean target + + * debian.rules: install debian.README as /usr/doc/copyright/$(package) + + * debian.rules: install documentation: f2c.ps, changes, readme + + * debian.rules: install fc script as /usr/bin/fc + + * debian.rules, debian.control: changed to new coding standard + + * source package contains exacr copy of ftp://netlib.att.com/f2c/ + (but the msdos and .cap directories) + +f2c 16 Oct 95 - adf +Changed package description to make it more concise. + +f2c 951007 Debian 1 - adf +Initial release. --- f2c-20020621.orig/debian/control +++ f2c-20020621/debian/control @@ -0,0 +1,21 @@ +Source: f2c +Section: devel +Priority: optional +Maintainer: Alan Bain +Standards-Version: 3.5.6.0 + +Package: f2c +Architecture: any +Depends: ${shlibs:Depends} +Recommends: gcc +Suggests: fort77 +Description: A FORTRAN 77 to C/C++ translator, plus static & shared libs. + f2c translates FORTRAN 77 (with some extensions) into C, so that it can + then be compiled and run on a system with no Fortran compiler. The C + files must then be linked against the appropriate libraries. + . + This is an actively maintained FORTRAN to C translator and with the + fort77 frontend provides an ideal way to compile FORTRAN routines + as black boxes (for example for invocation from C). Source level + debugging facilities are not available, and error messages are not as + well developed as in g77. --- f2c-20020621.orig/debian/copyright +++ f2c-20020621/debian/copyright @@ -0,0 +1,23 @@ +/**************************************************************** +Copyright 1990 - 1995 by AT&T Bell Laboratories 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 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 and Bellcore disclaim all warranties with regard to this +software, including all implied warranties of merchantability +and fitness. In no event shall AT&T 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. +****************************************************************/ + --- f2c-20020621.orig/debian/make_lib +++ f2c-20020621/debian/make_lib @@ -0,0 +1,18 @@ +#/usr/bin/make -f + +all: + cd .. + $(MAKE) -C libF77/ clean + $(MAKE) -C libI77/ clean + $(MAKE) -C libF77/ CFLAGS="$(GCCOPT) -fPIC \ + -I ../src -DNON_UNIX_STDIO -D$(INTSIZE)" + $(MAKE) -C libI77/ CFLAGS="$(GCCOPT) -fPIC \ + -I ../src -DNON_UNIX_STDIO -D$(INTSIZE)" + # + gcc -shared -Wl,-soname,lib$(INTSIZE).so.2\ + -o lib$(INTSIZE).so.2.1 lib?77/*.o -lc + # + ar r lib$(INTSIZE).a lib?77/*.o + ranlib lib$(INTSIZE).a + touch build_$(INTSIZE) + --- f2c-20020621.orig/debian/postinst +++ f2c-20020621/debian/postinst @@ -0,0 +1,8 @@ +#!/bin/sh +set -e +ldconfig +if [ "$1" = "configure" ]; then + if [ -d /usr/doc -a ! -e /usr/doc/f2c -a -d /usr/share/doc/f2c ]; then + ln -sf ../share/doc/f2c /usr/doc/f2c + fi +fi --- f2c-20020621.orig/debian/prerm +++ f2c-20020621/debian/prerm @@ -0,0 +1,7 @@ +#!/bin/sh +set -e + +# Remove usr-doc link +if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/f2c ]; then + rm -f /usr/doc/f2c +fi --- f2c-20020621.orig/debian/rules +++ f2c-20020621/debian/rules @@ -0,0 +1,140 @@ +#!/usr/bin/make -f +# -*- mode: makefile; -*- + +# debian.rules file - for f2c, libraries, header file, etc. + + +package=f2c + +arch=$(shell dpkg --print-architecture) +dir=$(package)-$(version) +file=$(package)_$(version)-$(debian) +flibmajorver=2 +flibver=2.1 + + +# Optimization options. +GCCOP2=-ansi -O2 -fomit-frame-pointer -mieee-fp -D_POSIX_SOURCE -DDEBIAN +GCCOP1=-ansi -O2 -fomit-frame-pointer -D_POSIX_SOURCE -DDEBIAN + +## Chose which options to use depending upon +## whether or not target is i386 + +ifeq ($(arch),i386) + GCCOPT=$(GCCOP2) +else + GCCOPT=$(GCCOP1) +endif + +build: + $(checkdir) + $(MAKE) -C "./src" CFLAGS="$(GCCOP1)" xsum.out + +## Avoid using -mieee-fp on anything other than the i386 platform +## as it is a gcc i386 specific option + + + if [ $(arch) == "i386" ] ;\ + then echo "Building for i386" ;\ + fi + + if [ $(arch) == "alpha" ] ;\ + then echo "Building for ALPHA" ;\ + sed 's/long //' ./src/f2c.master.h > ./src/f2c.h ;\ + else cp ./src/f2c.master.h ./src/f2c.h ;\ + fi + + $(MAKE) -C "./src" CFLAGS="$(GCCOPT)" ;\ + + sh libi77 + sh libf77 +## Temporary I hope + cp patches/uninit.c libF77/ +## These take gcc options from GCCOPT + $(MAKE) -f ./debian/make_lib INTSIZE=f2c + $(MAKE) -f ./debian/make_lib INTSIZE=f2c_i2 + strip libf2c.so.2.1 + strip libf2c_i2.so.2.1 + touch build + +clean: + $(checkdir) + $(MAKE) -C src clean + rm -rf libF77 libI77 + rm -f libf2c* *.tmp __* + cd src && rm -f xsum xsum1.out xsum.out; $(MAKE) -i clean + rm -f hello hello.o hello.c verify.out hello.P + rm -f build build_f2c build_f2c_i2 + rm -rf debian/tmp *~ + rm -rf debian/*~ debian/files* debian/substvars + cp ./src/f2c.master.h ./src/f2c.h + +binary-indep: checkroot build + ${checkdir} + + +binary-arch: checkroot + rm -rf debian/tmp + install -d debian/tmp debian/tmp/DEBIAN + install -d debian/tmp/usr/share/doc/${package} + cp debian/shlibs debian/tmp/DEBIAN/shlibs + install -c -m 0755 debian/postinst debian/tmp/DEBIAN + install -c -m 0755 debian/prerm debian/tmp/DEBIAN + install -d -m 0755 debian/tmp/usr/bin + install -s -m 0755 src/f2c debian/tmp/usr/bin/f2c + install -c -m 0755 fc debian/tmp/usr/bin/fc + install -d -m 0755 debian/tmp/usr/share/man/man1 + install -c -m 0644 fc.1 debian/tmp/usr/share/man/man1/fc.1 + install -c -m 0644 f2c.1t debian/tmp/usr/share/man/man1/f2c.1 + gzip -9v debian/tmp/usr/share/man/man1/f2c.1 + gzip -9v debian/tmp/usr/share/man/man1/fc.1 + install -d -m 0755 debian/tmp/usr/lib + install -c -m 0644 libf2c.a debian/tmp/usr/lib/libf2c.a + install -c -m 0644 libf2c_i2.a debian/tmp/usr/lib/libf2c_i2.a + install -d -m 0755 debian/tmp/usr/include + install -c -m 0644 src/f2c.h debian/tmp/usr/include/f2c.h + install -c -m 0644 libf2c.so.$(flibver) \ + debian/tmp/usr/lib/libf2c.so.$(flibver) + install -c -m 0644 libf2c_i2.so.$(flibver) \ + debian/tmp/usr/lib/libf2c_i2.so.$(flibver) + + (cd debian/tmp/usr/lib; ln -s libf2c.so.$(flibver) libf2c.so.$(flibmajorver); \ + ln -s libf2c_i2.so.$(flibver) libf2c_i2.so.$(flibmajorver) ) + + install -d -m 0755 debian/tmp/usr/share/doc/$(package) + install -c -m 0644 f2c.ps debian/tmp/usr/share/doc/$(package) + install -c -m 0644 changes debian/tmp/usr/share/doc/$(package)/changelog + install -c -m 0644 readme debian/tmp/usr/share/doc/$(package) + install -c -m 0644 debian/changelog \ + debian/tmp/usr/share/doc/f2c/changelog.Debian + install -c -m 0644 debian/README.debian \ + debian/tmp/usr/share/doc/f2c/README.debian + (cd debian/tmp/usr/share/doc/$(package); gzip -9v *) + install -c -m 0644 debian/copyright \ + debian/tmp/usr/share/doc/f2c/copyright + + dpkg-shlibdeps ./src/f2c + dpkg-gencontrol + chown -R root.root debian/tmp + chmod -R go-ws debian/tmp + dpkg --build debian/tmp .. + +## Below Here is Generic + +define checkdir + test -f ./src/$(package).1t +endef + +binary: binary-indep binary-arch + +source diff: + @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false + +dist: binary source diff changes + +checkroot: + $(checkdir) + test root = "`whoami`" + +.PHONY: binary source diff clean checkroot changes dist + --- f2c-20020621.orig/debian/shlibs +++ f2c-20020621/debian/shlibs @@ -0,0 +1,3 @@ +libf2c libf2c.so.2 f2c (>=19971204-1) +libf2c_i2 libf2c_i2.so.2 f2c (>=19971204-1) + --- f2c-20020621.orig/patches/uninit.c +++ f2c-20020621/patches/uninit.c @@ -0,0 +1,439 @@ +#include +#include +#include "arith.h" + +#define TYSHORT 2 +#define TYLONG 3 +#define TYREAL 4 +#define TYDREAL 5 +#define TYCOMPLEX 6 +#define TYDCOMPLEX 7 +#define TYINT1 11 +#define TYQUAD 14 +#ifndef Long +#define Long long +#endif + +#ifdef __mips +#define RNAN 0xffc00000 /* Quiet NaN */ +#define DNAN0 0xfff80000 /* Signaling DP NaN Big Endian */ +#define DNAN1 0 +#endif + +#ifdef _PA_RISC1_1 +#define RNAN 0xffc00000 /* Quiet NaN */ +#define DNAN0 0xfff80000 /* Signaling DP NaN Big Endian */ +#define DNAN1 0 +#endif + +/* Everything else .... */ + +#ifndef RNAN +#define RNAN 0xff800001 /* Signaling Real NaN */ + +#ifdef IEEE_MC68k /* Set also on PPC */ +#define DNAN0 0xfff00000 /* Quiet Big Endian MSB, LSB */ +#define DNAN1 1 +#else +#define DNAN0 1 /* LSB, MSB -- for little endian machines */ +#define DNAN1 0xfff00000 /* Quiet Double NaN */ +#endif +#endif /*RNAN*/ + +#ifdef KR_headers +#define Void /*void*/ +#define FA7UL (unsigned Long) 0xfa7a7a7aL +#else +#define Void void +#define FA7UL 0xfa7a7a7aUL +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +static void ieee0(Void); + +static unsigned Long rnan = RNAN, + dnan0 = DNAN0, + dnan1 = DNAN1; + +double _0 = 0.; + +void unsupported_error() +{ + fprintf(stderr,"Runtime Error: Your Architecture is not supported by the" + " -trapuv option of f2c\n"); + exit(-1); +} + +void +#ifdef KR_headers +_uninit_f2c(x,type,len) void *x; int type; long len; +#else +_uninit_f2c(void *x, int type, long len) +#endif +{ + static int first = 1; + + unsigned Long *lx, *lxe; + + if (first) { + first = 0; + ieee0(); + } + if (len == 1) + switch(type) { + case TYINT1: + *(char*)x = 'Z'; + return; + case TYSHORT: + *(short*)x = 0xfa7a; + break; + case TYLONG: + *(unsigned Long*)x = FA7UL; + return; + case TYQUAD: + case TYCOMPLEX: + case TYDCOMPLEX: + break; + case TYREAL: + *(unsigned Long*)x = rnan; + return; + case TYDREAL: + lx = (unsigned Long*)x; + lx[0] = dnan0; + lx[1] = dnan1; + return; + default: + printf("Surprise type %d in _uninit_f2c\n", type); + } + switch(type) { + case TYINT1: + memset(x, 'Z', len); + break; + case TYSHORT: + *(short*)x = 0xfa7a; + break; + case TYQUAD: + len *= 2; + /* no break */ + case TYLONG: + lx = (unsigned Long*)x; + lxe = lx + len; + while(lx < lxe) + *lx++ = FA7UL ; + break; + case TYCOMPLEX: + len *= 2; + /* no break */ + case TYREAL: + lx = (unsigned Long*)x; + lxe = lx + len; + while(lx < lxe) + *lx++ = rnan; + break; + case TYDCOMPLEX: + len *= 2; + /* no break */ + case TYDREAL: + lx = (unsigned Long*)x; + for(lxe = lx + 2*len; lx < lxe; lx += 2) { + lx[0] = dnan0; + lx[1] = dnan1; + } + } + } +#ifdef __cplusplus +} +#endif + +/* The rest of this code is architecture specific definitions + * of the ieee0() function, which sets up the FPU appropriately. + * FIXME whoever wrote this should have provided documentation + * on exactly what ieee0() is supposed to do. My best guess + * is that it should go for IEEE mode, double precision, with + * some sort of exception generated on overflow, zero-divide + * and invalid-operation. + * Also this file is a mess of architecture-specific and + * OS-specific #ifdefs. You have been warned. + * -- Peter Maydell + */ + +#ifndef MSpc +#ifdef MSDOS +#define MSpc +#else +#ifdef _WIN32 +#define MSpc +#endif +#endif +#endif + +#ifdef MSpc +#define IEEE0_done +#include "float.h" +#include "signal.h" + + static void +ieee0(Void) +{ +#ifndef __alpha + _control87(EM_DENORMAL | EM_UNDERFLOW | EM_INEXACT, MCW_EM); +#endif + /* With MS VC++, compiling and linking with -Zi will permit */ + /* clicking to invoke the MS C++ debugger, which will show */ + /* the point of error -- provided SIGFPE is SIG_DFL. */ + signal(SIGFPE, SIG_DFL); + } +#endif /* MSpc */ + +/* This code is (I think) SGI/MIPS specific. So it looks for IRIX + * via the __sgi flag (http://web.mit.edu/source/doc/standards) + */ +#if defined(__mips) && defined(__sgi) /* must link with -lfpe */ +#define IEEE0_done +/* code from Eric Grosse */ +#include +#include +#include "/usr/include/sigfpe.h" /* full pathname for lcc -N */ +#include "/usr/include/sys/fpu.h" + +static void +#ifdef KR_headers +ieeeuserhand(exception,val) unsigned exception[5]; int val[2]; +#else +ieeeuserhand(unsigned exception[5], int val[2]) +#endif +{ + fflush(stdout); + fprintf(stderr,"ieee0() aborting because of "); + if(exception[0]==_OVERFL) fprintf(stderr,"overflow\n"); + else if(exception[0]==_UNDERFL) fprintf(stderr,"underflow\n"); + else if(exception[0]==_DIVZERO) fprintf(stderr,"divide by 0\n"); + else if(exception[0]==_INVALID) fprintf(stderr,"invalid operation\n"); + else fprintf(stderr,"\tunknown reason\n"); + fflush(stderr); + abort(); +} + +static void +ieeeuserhand2(unsigned int **j) +{ + fprintf(stderr,"ieee0() aborting because of confusion\n"); + abort(); +} + +static int ieee_chk = 1; + + static void +ieee0(Void) +{ + int i; + char *s; + if(getenv("NoIEEE")!=NULL) + ieee_chk = 0; + for(i=1; i<=4; i++){ + sigfpe_[i].count = 1000; + sigfpe_[i].trace = 1; + sigfpe_[i].repls = _USER_DETERMINED; + } + sigfpe_[1].repls = _ZERO; /* underflow */ + if(ieee_chk){ + if(s=getenv("ROUND_MODE")){ + if( !isdigit(s[0]) || (i=s[0]-'0')<0 || i>3 ) + fprintf(stderr,"bad rounding mode %s\n",s); + else + swapRM(i); + } + handle_sigfpes( _ON, + _EN_UNDERFL|_EN_OVERFL|_EN_DIVZERO|_EN_INVALID, + ieeeuserhand,_ABORT_ON_ERROR,ieeeuserhand2); + } +} +#endif /* IRIX mips */ + +/* + * The following is the preferred method but depends upon a GLIBC extension only + * to be found in GLIBC 2.2 or later. It is a GNU extension, not included in the + * C99 extensions which allow the FP status register to be examined in a platform + * independent way. It should be used if at all possible -- AFRB + */ + +#if (defined(__GLIBC__)&&(!(__GLIBC__==2&&__GLIBC_MINOR<2)&&(!__GLIBC__<2))) + +#define _GNU_SOURCE 1 +#define IEEE0_done +#include + static void +ieee0(Void) +{ + /* Clear all exception flags */ + if (fedisableexcept(FE_ALL_EXCEPT)==-1) + unsupported_error(); + if (feenableexcept(FE_DIVBYZERO|FE_INVALID|FE_OVERFLOW)==-1) + unsupported_error(); +} + +#endif + + +/* Many linux cases will be treated through GLIBC. Note that modern + * linux runs on many non-i86 plaforms and as a result the following code + * must be processor dependent rather than simply OS specific */ + +#if (defined(__linux__)&&(!defined(IEEE0_done))) +#define IEEE0_done +#include "fpu_control.h" + +/* Not all versions of libc define _FPU_SETCW; + * some only provide the __setfpucw() function. + */ +#ifndef _FPU_SETCW +#define _FPU_SETCW(cw) __setfpucw(cw) +#endif + +/* The exact set of flags we want to set in the FPU control word + * depends on the architecture. + * Note also that whether an exception is enabled or disabled when + * the _FPU_MASK_nn bit is set is architecture dependent! + * Enabled-when-set: M68k, ARM, MIPS, PowerPC + * Disabled-when-set: x86, Alpha + * The state we are after is: + * IEEE mode, IEEE double precision, exceptions on division by zero, + * overflow and invalid operation. + */ +#if (defined(__mc68000__) || defined(__mc68020__) || defined(mc68020) || defined (__mc68k__)) +/* Reported 20010705 by Alan Bain + * Note that IEEE 754 IOP (illegal operation) + * = Signaling NAN (SNAN) + operation error (OPERR). + */ +#define RQD_FPU_STATE (_FPU_IEEE + _FPU_DOUBLE + _FPU_MASK_OPERR + \ + _FPU_MASK_DZ + _FPU_MASK_SNAN+_FPU_MASK_OVFL) + +#elif (defined(__powerpc__)||defined(_ARCH_PPC)||defined(_ARCH_PWR)) /* !__mc68k__ */ +/* The following is NOT a mistake -- the author of the fpu_control.h +for the PPC has erroneously defined IEEE mode to turn on exceptions +other than Inexact! Start from default then and turn on only the ones +which we want*/ + +/* I have changed _FPU_MASK_UM here to _FPU_MASK_ZM, because that is + * in line with all the other architectures specified here. -- Correct AFRB + */ +#define RQD_FPU_STATE (_FPU_DEFAULT +_FPU_MASK_OM+_FPU_MASK_IM+_FPU_MASK_ZM) + +#elif (defined(__arm__)) +/* On ARM too, IEEE implies all exceptions enabled. + * -- Peter Maydell + * Unfortunately some version of ARMlinux don't include any + * flags in the fpu_control.h file + */ +#define RQD_FPU_STATE (_FPU_DEFAULT +_FPU_MASK_OM+_FPU_MASK_IM+_FPU_MASK_ZM) + +#elif (defined(__mips__)) +/* And same again for MIPS; _FPU_IEEE => exceptions seems a common meme. + * MIPS uses different MASK constant names, no idea why -- PMM + */ +#define RQD_FPU_STATE (_FPU_DEFAULT +_FPU_MASK_O+_FPU_MASK_V+_FPU_MASK_Z) + +#elif (defined(__sparc__)) +#define RQD_FPU_STATE (_FPU_DEFAULT +_FPU_DOUBLE+_FPU_MASK_OM+_FPU_MASK_IM+_FPU_MASK_ZM) + +#elif (defined(__i386__) || defined(__alpha__)) +/* This case is for Intel, and also Alpha, because the Alpha header + * purposely emulates x86 flags and meanings for compatibility with + * stupid programs. + * We used to try this case for anything defining _FPU_IEEE, but I think + * that that's a bad idea because it isn't really likely to work. + * Instead for unknown architectures we just won't allow -trapuv to work. + * Trying this case was just getting us + * (a) compile errors on archs which didn't know all these constants + * (b) silent wrong behaviour on archs (like SPARC) which do know all + * constants but have different semantics for them + */ +#define RQD_FPU_STATE (_FPU_IEEE - _FPU_EXTENDED + _FPU_DOUBLE - _FPU_MASK_IM - _FPU_MASK_ZM - _FPU_MASK_OM) +#endif + + static void +ieee0(Void) +{ +#ifdef RQD_FPU_STATE + __fpu_control = RQD_FPU_STATE; + _FPU_SETCW(__fpu_control); +#else + /* FIXME why isn't this in the global default implementation of ieee0() at the bottom of the file? */ + /* The following seems better than apparently supporting unitialised + value detection and not actually doing it! */ + unsupported_error(); +#endif +} +#endif /* __linux__ */ + + +/* OSF-1 Specific Alpha Code */ + +#if (defined(__alpha)&&defined(__osf__)) +#ifndef IEEE0_done +#define IEEE0_done +#include + static void +ieee0(Void) +{ + ieee_set_fp_control(IEEE_TRAP_ENABLE_INV); + } +#endif /*IEEE0_done*/ +#endif /* OSF/1 specific alpha */ + +#ifdef __hpux +#ifndef IEEE0_done +#define IEEE0_done + +#define _INCLUDE_HPUX_SOURCE +#include + + static void +ieee0(Void) +{ + fpsetmask(FP_X_INV); + } +#endif +#endif /*__hpux*/ + +#ifdef _AIX +#ifndef IEEE0_done +#define IEEE0_done +#include + + static void +ieee0(Void) +{ + fp_enable(TRP_INVALID); + fp_trap(FP_TRAP_SYNC); + } +#endif +#endif /*_AIX*/ + +/* Unfortunately there is no reliably defined constants for SOLARIS systems + * so we shall have to leave this as stands */ + +#ifdef __sun +#ifndef IEEE0_done +#define IEEE0_done +#include + + static void +ieee0(Void) +{ + fpsetmask(FP_X_INV); + } +#endif +#endif /*__sparc*/ + +#ifndef IEEE0_done + static void +ieee0(Void) { +/* If there isn't a suitable implementation found from among those here + * cause an error */ + unsupported_error(); +} +#endif --- f2c-20020621.orig/fc.1 +++ f2c-20020621/fc.1 @@ -0,0 +1,129 @@ +'\" t +.\" Redistribution and use in source and binary forms of parts of or the +.\" whole original or derived work are permitted provided that the +.\" original work is properly attributed to the author. The name of the +.\" author may not be used to endorse or promote products derived from +.\" this software without specific prior written permission. This work +.\" is provided "as is" and without any express or implied warranties. +.\" +.\" Original version of this manpage: +.\" Peter Maydell (pmaydell@chiark.greenend.org.uk), 03/1998 +.\" Updated by Alan Bain (afrb2@cam.ac.uk), 15/05/1999 +.\" added reference to -o in command specification +.\" and to -U in options +.\" +.TH FC 1 "May 1999" +.SH NAME +fc \- frontend script to the f2c fortran compiler +.SH SYNOPSIS +.B /usr/bin/fc +.RB [ -o +.IR objfile ] +.RB [ -c ] +.RB [ -S ] +.RB [ -C ] +.RB [ -u ] +.RB [ -w ] +.RB [ -w66 ] +.RB [ -D +.IR switch ] +.RB [ -I +.IR includepath ] +.RB [ -Ntnnn ] +.RB [ -P ] +.I files +.RB [ -l +.IR library ] +.SH DESCRIPTION +.LP +.B fc +is a script intended to be used as a front end to the +.B f2c +FORTRAN-to-C translator. It is supposed to make the whole +.B f2c +and C compiler setup look like a real Fortran compiler. + +File arguments with a +.B .f +suffix are compiled as Fortran source. +Files with a +.B .F +suffix are passed through the C preprocessor +.B cpp(1) +first. Files with +.B .c +(C source) or +.B .s +(assembly source) +suffixes are passed to the C compiler directly. +Files with a +.B .e +suffix are treated as efl source files, and +files with a +.B .r +suffix are treated as RATFOR source files. + +.SH OPTIONS +.TP 8 +.I -o objfile +Produce an output executable named +.I objfile +rather than using the default name a.out. +.TP 8 +.I -c +Do not call the linker; instead, leave relocatable object files +as *.o. +.TP 8 +.I -S +Produce assembly output as file.s +.TP 8 +.I -C +Compile in extra code to check that array subscripts are in bounds. +.TP 8 +.I -l library +Libraries specified with this option are passed to the linker. +.TP 8 +.I -U def +Definitions specified with this option are passed to C compiler (for .c files) +or to cpp (for .F files) to remove definition. +.TP 8 +.I -u +Complain about undeclared variables. +.TP 8 +.I -w +Omit all warning messages. +.TP 8 +.I -w66 +Omit Fortran 66 (Fortran IV) compatibility warning messages. +.TP 8 +.I -D switch +The given switch is passed to the C compiler (for .c files), to cpp +(for .F files) and to f2c. +.TP 8 +.I -I includepath +Passed to the C compiler (for .c files), to cpp (for .F files) +and to f2c. +.TP 8 +.I -Ntnnn +Allow nnn entries in table t. +.TP 8 +.I -P +Emit .P files. +.SH BUGS +.B fc +isn't really very good -- try fort77 (1), which does a better job. +.br +This manual page isn't really very good either... +.SH AUTHOR +S. Feldman, D. Gay, M. Maimone, N, Schryer are all mentioned +in the paper on the conversion of Fortran to C. +.br +Peter Maydell (pmaydell@chiark.greenend.org.uk) wrote this manual page, +and Alan Bain (alanb@chiark.greenend.org.uk) made some minor +modifications. +.SH SEE ALSO +.BR f2c (1), +.BR fort77 (1), +.BR cc (1), +.BR cpp (1), +.BR ratfor (1)