debian/0000775000000000000000000000000011741065352007174 5ustar debian/README.debian0000664000000000000000000000023011716471340011270 0ustar f2c for debian -------------- Original source downloaded from ftp://netlib.bell-labs.com/netlib/f2c. Alan Bain Sat, 10 May 2008 debian/patches/0000775000000000000000000000000011741065256010626 5ustar debian/patches/0003-struct-init-braces.patch0000664000000000000000000003217111741064611015747 0ustar From: "Barak A. Pearlmutter" Date: Tue, 14 Feb 2012 15:12:31 +0000 Subject: struct init braces --- src/intr.c | 278 ++++++++++++++++++++++++++++++------------------------------ src/io.c | 18 ++-- src/lex.c | 54 ++++++------ 3 files changed, 175 insertions(+), 175 deletions(-) diff --git a/src/intr.c b/src/intr.c index dcae4db..9da6757 100644 --- a/src/intr.c +++ b/src/intr.c @@ -48,182 +48,182 @@ LOCAL struct Intrblock struct Intrbits intrval; } intrtab[ ] = { -"int", { INTRCONV, TYLONG }, -"real", { INTRCONV, TYREAL, 1 }, +{"int", { INTRCONV, TYLONG }}, +{"real", { INTRCONV, TYREAL, 1 }}, /* 1 ==> real(TYDCOMPLEX) yields TYDREAL */ -"dble", { INTRCONV, TYDREAL }, -"dreal", { INTRCONV, TYDREAL, 0, 0, 0, 1 }, -"cmplx", { INTRCONV, TYCOMPLEX }, -"dcmplx", { INTRCONV, TYDCOMPLEX, 0, 1 }, -"ifix", { INTRCONV, TYLONG }, -"idint", { INTRCONV, TYLONG }, -"float", { INTRCONV, TYREAL }, -"dfloat", { INTRCONV, TYDREAL }, -"sngl", { INTRCONV, TYREAL }, -"ichar", { INTRCONV, TYLONG }, -"iachar", { INTRCONV, TYLONG }, -"char", { INTRCONV, TYCHAR }, -"achar", { INTRCONV, TYCHAR }, +{"dble", { INTRCONV, TYDREAL }}, +{"dreal", { INTRCONV, TYDREAL, 0, 0, 0, 1 }}, +{"cmplx", { INTRCONV, TYCOMPLEX }}, +{"dcmplx", { INTRCONV, TYDCOMPLEX, 0, 1 }}, +{"ifix", { INTRCONV, TYLONG }}, +{"idint", { INTRCONV, TYLONG }}, +{"float", { INTRCONV, TYREAL }}, +{"dfloat", { INTRCONV, TYDREAL }}, +{"sngl", { INTRCONV, TYREAL }}, +{"ichar", { INTRCONV, TYLONG }}, +{"iachar", { INTRCONV, TYLONG }}, +{"char", { INTRCONV, TYCHAR }}, +{"achar", { INTRCONV, TYCHAR }}, /* any MAX or MIN can be used with any types; the compiler will cast them correctly. So rules against bad syntax in these expressions are not enforced */ -"max", { INTRMAX, TYUNKNOWN }, -"max0", { INTRMAX, TYLONG }, -"amax0", { INTRMAX, TYREAL }, -"max1", { INTRMAX, TYLONG }, -"amax1", { INTRMAX, TYREAL }, -"dmax1", { INTRMAX, TYDREAL }, - -"and", { INTRBOOL, TYUNKNOWN, OPBITAND }, -"or", { INTRBOOL, TYUNKNOWN, OPBITOR }, -"xor", { INTRBOOL, TYUNKNOWN, OPBITXOR }, -"not", { INTRBOOL, TYUNKNOWN, OPBITNOT }, -"lshift", { INTRBOOL, TYUNKNOWN, OPLSHIFT }, -"rshift", { INTRBOOL, TYUNKNOWN, OPRSHIFT }, +{"max", { INTRMAX, TYUNKNOWN }}, +{"max0", { INTRMAX, TYLONG }}, +{"amax0", { INTRMAX, TYREAL }}, +{"max1", { INTRMAX, TYLONG }}, +{"amax1", { INTRMAX, TYREAL }}, +{"dmax1", { INTRMAX, TYDREAL }}, + +{"and", { INTRBOOL, TYUNKNOWN, OPBITAND }}, +{"or", { INTRBOOL, TYUNKNOWN, OPBITOR }}, +{"xor", { INTRBOOL, TYUNKNOWN, OPBITXOR }}, +{"not", { INTRBOOL, TYUNKNOWN, OPBITNOT }}, +{"lshift", { INTRBOOL, TYUNKNOWN, OPLSHIFT }}, +{"rshift", { INTRBOOL, TYUNKNOWN, OPRSHIFT }}, -"min", { INTRMIN, TYUNKNOWN }, -"min0", { INTRMIN, TYLONG }, -"amin0", { INTRMIN, TYREAL }, -"min1", { INTRMIN, TYLONG }, -"amin1", { INTRMIN, TYREAL }, -"dmin1", { INTRMIN, TYDREAL }, +{"min", { INTRMIN, TYUNKNOWN }}, +{"min0", { INTRMIN, TYLONG }}, +{"amin0", { INTRMIN, TYREAL }}, +{"min1", { INTRMIN, TYLONG }}, +{"amin1", { INTRMIN, TYREAL }}, +{"dmin1", { INTRMIN, TYDREAL }}, -"aint", { INTRGEN, 2, 0 }, -"dint", { INTRSPEC, TYDREAL, 1 }, +{"aint", { INTRGEN, 2, 0 }}, +{"dint", { INTRSPEC, TYDREAL, 1 }}, -"anint", { INTRGEN, 2, 2 }, -"dnint", { INTRSPEC, TYDREAL, 3 }, +{"anint", { INTRGEN, 2, 2 }}, +{"dnint", { INTRSPEC, TYDREAL, 3 }}, -"nint", { INTRGEN, 4, 4 }, -"idnint", { INTRGEN, 2, 6 }, +{"nint", { INTRGEN, 4, 4 }}, +{"idnint", { INTRGEN, 2, 6 }}, -"abs", { INTRGEN, 6, 8 }, -"iabs", { INTRGEN, 2, 9 }, -"dabs", { INTRSPEC, TYDREAL, 11 }, -"cabs", { INTRSPEC, TYREAL, 12, 0, 13 }, -"zabs", { INTRSPEC, TYDREAL, 13, 1 }, +{"abs", { INTRGEN, 6, 8 }}, +{"iabs", { INTRGEN, 2, 9 }}, +{"dabs", { INTRSPEC, TYDREAL, 11 }}, +{"cabs", { INTRSPEC, TYREAL, 12, 0, 13 }}, +{"zabs", { INTRSPEC, TYDREAL, 13, 1 }}, -"mod", { INTRGEN, 4, 14 }, -"amod", { INTRSPEC, TYREAL, 16, 0, 17 }, -"dmod", { INTRSPEC, TYDREAL, 17 }, +{"mod", { INTRGEN, 4, 14 }}, +{"amod", { INTRSPEC, TYREAL, 16, 0, 17 }}, +{"dmod", { INTRSPEC, TYDREAL, 17 }}, -"sign", { INTRGEN, 4, 18 }, -"isign", { INTRGEN, 2, 19 }, -"dsign", { INTRSPEC, TYDREAL, 21 }, +{"sign", { INTRGEN, 4, 18 }}, +{"isign", { INTRGEN, 2, 19 }}, +{"dsign", { INTRSPEC, TYDREAL, 21 }}, -"dim", { INTRGEN, 4, 22 }, -"idim", { INTRGEN, 2, 23 }, -"ddim", { INTRSPEC, TYDREAL, 25 }, +{"dim", { INTRGEN, 4, 22 }}, +{"idim", { INTRGEN, 2, 23 }}, +{"ddim", { INTRSPEC, TYDREAL, 25 }}, -"dprod", { INTRSPEC, TYDREAL, 26 }, +{"dprod", { INTRSPEC, TYDREAL, 26 }}, -"len", { INTRSPEC, TYLONG, 27 }, -"index", { INTRSPEC, TYLONG, 29 }, +{"len", { INTRSPEC, TYLONG, 27 }}, +{"index", { INTRSPEC, TYLONG, 29 }}, -"imag", { INTRGEN, 2, 31 }, -"aimag", { INTRSPEC, TYREAL, 31, 0, 32 }, -"dimag", { INTRSPEC, TYDREAL, 32 }, +{"imag", { INTRGEN, 2, 31 }}, +{"aimag", { INTRSPEC, TYREAL, 31, 0, 32 }}, +{"dimag", { INTRSPEC, TYDREAL, 32 }}, -"conjg", { INTRGEN, 2, 33 }, -"dconjg", { INTRSPEC, TYDCOMPLEX, 34, 1 }, +{"conjg", { INTRGEN, 2, 33 }}, +{"dconjg", { INTRSPEC, TYDCOMPLEX, 34, 1 }}, -"sqrt", { INTRGEN, 4, 35 }, -"dsqrt", { INTRSPEC, TYDREAL, 36 }, -"csqrt", { INTRSPEC, TYCOMPLEX, 37, 0, 38 }, -"zsqrt", { INTRSPEC, TYDCOMPLEX, 38, 1 }, +{"sqrt", { INTRGEN, 4, 35 }}, +{"dsqrt", { INTRSPEC, TYDREAL, 36 }}, +{"csqrt", { INTRSPEC, TYCOMPLEX, 37, 0, 38 }}, +{"zsqrt", { INTRSPEC, TYDCOMPLEX, 38, 1 }}, -"exp", { INTRGEN, 4, 39 }, -"dexp", { INTRSPEC, TYDREAL, 40 }, -"cexp", { INTRSPEC, TYCOMPLEX, 41, 0, 42 }, -"zexp", { INTRSPEC, TYDCOMPLEX, 42, 1 }, +{"exp", { INTRGEN, 4, 39 }}, +{"dexp", { INTRSPEC, TYDREAL, 40 }}, +{"cexp", { INTRSPEC, TYCOMPLEX, 41, 0, 42 }}, +{"zexp", { INTRSPEC, TYDCOMPLEX, 42, 1 }}, -"log", { INTRGEN, 4, 43 }, -"alog", { INTRSPEC, TYREAL, 43, 0, 44 }, -"dlog", { INTRSPEC, TYDREAL, 44 }, -"clog", { INTRSPEC, TYCOMPLEX, 45, 0, 46 }, -"zlog", { INTRSPEC, TYDCOMPLEX, 46, 1 }, +{"log", { INTRGEN, 4, 43 }}, +{"alog", { INTRSPEC, TYREAL, 43, 0, 44 }}, +{"dlog", { INTRSPEC, TYDREAL, 44 }}, +{"clog", { INTRSPEC, TYCOMPLEX, 45, 0, 46 }}, +{"zlog", { INTRSPEC, TYDCOMPLEX, 46, 1 }}, -"log10", { INTRGEN, 2, 47 }, -"alog10", { INTRSPEC, TYREAL, 47, 0, 48 }, -"dlog10", { INTRSPEC, TYDREAL, 48 }, +{"log10", { INTRGEN, 2, 47 }}, +{"alog10", { INTRSPEC, TYREAL, 47, 0, 48 }}, +{"dlog10", { INTRSPEC, TYDREAL, 48 }}, -"sin", { INTRGEN, 4, 49 }, -"dsin", { INTRSPEC, TYDREAL, 50 }, -"csin", { INTRSPEC, TYCOMPLEX, 51, 0, 52 }, -"zsin", { INTRSPEC, TYDCOMPLEX, 52, 1 }, +{"sin", { INTRGEN, 4, 49 }}, +{"dsin", { INTRSPEC, TYDREAL, 50 }}, +{"csin", { INTRSPEC, TYCOMPLEX, 51, 0, 52 }}, +{"zsin", { INTRSPEC, TYDCOMPLEX, 52, 1 }}, -"cos", { INTRGEN, 4, 53 }, -"dcos", { INTRSPEC, TYDREAL, 54 }, -"ccos", { INTRSPEC, TYCOMPLEX, 55, 0, 56 }, -"zcos", { INTRSPEC, TYDCOMPLEX, 56, 1 }, +{"cos", { INTRGEN, 4, 53 }}, +{"dcos", { INTRSPEC, TYDREAL, 54 }}, +{"ccos", { INTRSPEC, TYCOMPLEX, 55, 0, 56 }}, +{"zcos", { INTRSPEC, TYDCOMPLEX, 56, 1 }}, -"tan", { INTRGEN, 2, 57 }, -"dtan", { INTRSPEC, TYDREAL, 58 }, +{"tan", { INTRGEN, 2, 57 }}, +{"dtan", { INTRSPEC, TYDREAL, 58 }}, -"asin", { INTRGEN, 2, 59 }, -"dasin", { INTRSPEC, TYDREAL, 60 }, +{"asin", { INTRGEN, 2, 59 }}, +{"dasin", { INTRSPEC, TYDREAL, 60 }}, -"acos", { INTRGEN, 2, 61 }, -"dacos", { INTRSPEC, TYDREAL, 62 }, +{"acos", { INTRGEN, 2, 61 }}, +{"dacos", { INTRSPEC, TYDREAL, 62 }}, -"atan", { INTRGEN, 2, 63 }, -"datan", { INTRSPEC, TYDREAL, 64 }, +{"atan", { INTRGEN, 2, 63 }}, +{"datan", { INTRSPEC, TYDREAL, 64 }}, -"atan2", { INTRGEN, 2, 65 }, -"datan2", { INTRSPEC, TYDREAL, 66 }, +{"atan2", { INTRGEN, 2, 65 }}, +{"datan2", { INTRSPEC, TYDREAL, 66 }}, -"sinh", { INTRGEN, 2, 67 }, -"dsinh", { INTRSPEC, TYDREAL, 68 }, +{"sinh", { INTRGEN, 2, 67 }}, +{"dsinh", { INTRSPEC, TYDREAL, 68 }}, -"cosh", { INTRGEN, 2, 69 }, -"dcosh", { INTRSPEC, TYDREAL, 70 }, +{"cosh", { INTRGEN, 2, 69 }}, +{"dcosh", { INTRSPEC, TYDREAL, 70 }}, -"tanh", { INTRGEN, 2, 71 }, -"dtanh", { INTRSPEC, TYDREAL, 72 }, +{"tanh", { INTRGEN, 2, 71 }}, +{"dtanh", { INTRSPEC, TYDREAL, 72 }}, -"lge", { INTRSPEC, TYLOGICAL, 73}, -"lgt", { INTRSPEC, TYLOGICAL, 75}, -"lle", { INTRSPEC, TYLOGICAL, 77}, -"llt", { INTRSPEC, TYLOGICAL, 79}, +{"lge", { INTRSPEC, TYLOGICAL, 73}}, +{"lgt", { INTRSPEC, TYLOGICAL, 75}}, +{"lle", { INTRSPEC, TYLOGICAL, 77}}, +{"llt", { INTRSPEC, TYLOGICAL, 79}}, #if 0 -"epbase", { INTRCNST, 4, 0 }, -"epprec", { INTRCNST, 4, 4 }, -"epemin", { INTRCNST, 2, 8 }, -"epemax", { INTRCNST, 2, 10 }, -"eptiny", { INTRCNST, 2, 12 }, -"ephuge", { INTRCNST, 4, 14 }, -"epmrsp", { INTRCNST, 2, 18 }, +{"epbase", { INTRCNST, 4, 0 }}, +{"epprec", { INTRCNST, 4, 4 }}, +{"epemin", { INTRCNST, 2, 8 }}, +{"epemax", { INTRCNST, 2, 10 }}, +{"eptiny", { INTRCNST, 2, 12 }}, +{"ephuge", { INTRCNST, 4, 14 }}, +{"epmrsp", { INTRCNST, 2, 18 }}, #endif -"fpexpn", { INTRGEN, 4, 81 }, -"fpabsp", { INTRGEN, 2, 85 }, -"fprrsp", { INTRGEN, 2, 87 }, -"fpfrac", { INTRGEN, 2, 89 }, -"fpmake", { INTRGEN, 2, 91 }, -"fpscal", { INTRGEN, 2, 93 }, - -"cdabs", { INTRSPEC, TYDREAL, 13, 1, 0, 1 }, -"cdsqrt", { INTRSPEC, TYDCOMPLEX, 38, 1, 0, 1 }, -"cdexp", { INTRSPEC, TYDCOMPLEX, 42, 1, 0, 1 }, -"cdlog", { INTRSPEC, TYDCOMPLEX, 46, 1, 0, 1 }, -"cdsin", { INTRSPEC, TYDCOMPLEX, 52, 1, 0, 1 }, -"cdcos", { INTRSPEC, TYDCOMPLEX, 56, 1, 0, 1 }, - -"iand", { INTRBOOL, TYUNKNOWN, OPBITAND, 0, 0, 2 }, -"ior", { INTRBOOL, TYUNKNOWN, OPBITOR, 0, 0, 2 }, -"ieor", { INTRBOOL, TYUNKNOWN, OPBITXOR, 0, 0, 2 }, - -"btest", { INTRBGEN, TYLOGICAL, OPBITTEST,0, 0, 2 }, -"ibclr", { INTRBGEN, TYUNKNOWN, OPBITCLR, 0, 0, 2 }, -"ibset", { INTRBGEN, TYUNKNOWN, OPBITSET, 0, 0, 2 }, -"ibits", { INTRBGEN, TYUNKNOWN, OPBITBITS,0, 0, 2 }, -"ishft", { INTRBGEN, TYUNKNOWN, OPBITSH, 0, 0, 2 }, -"ishftc", { INTRBGEN, TYUNKNOWN, OPBITSHC, 0, 0, 2 }, - -"" }; +{"fpexpn", { INTRGEN, 4, 81 }}, +{"fpabsp", { INTRGEN, 2, 85 }}, +{"fprrsp", { INTRGEN, 2, 87 }}, +{"fpfrac", { INTRGEN, 2, 89 }}, +{"fpmake", { INTRGEN, 2, 91 }}, +{"fpscal", { INTRGEN, 2, 93 }}, + +{"cdabs", { INTRSPEC, TYDREAL, 13, 1, 0, 1 }}, +{"cdsqrt", { INTRSPEC, TYDCOMPLEX, 38, 1, 0, 1 }}, +{"cdexp", { INTRSPEC, TYDCOMPLEX, 42, 1, 0, 1 }}, +{"cdlog", { INTRSPEC, TYDCOMPLEX, 46, 1, 0, 1 }}, +{"cdsin", { INTRSPEC, TYDCOMPLEX, 52, 1, 0, 1 }}, +{"cdcos", { INTRSPEC, TYDCOMPLEX, 56, 1, 0, 1 }}, + +{"iand", { INTRBOOL, TYUNKNOWN, OPBITAND, 0, 0, 2 }}, +{"ior", { INTRBOOL, TYUNKNOWN, OPBITOR, 0, 0, 2 }}, +{"ieor", { INTRBOOL, TYUNKNOWN, OPBITXOR, 0, 0, 2 }}, + +{"btest", { INTRBGEN, TYLOGICAL, OPBITTEST,0, 0, 2 }}, +{"ibclr", { INTRBGEN, TYUNKNOWN, OPBITCLR, 0, 0, 2 }}, +{"ibset", { INTRBGEN, TYUNKNOWN, OPBITSET, 0, 0, 2 }}, +{"ibits", { INTRBGEN, TYUNKNOWN, OPBITBITS,0, 0, 2 }}, +{"ishft", { INTRBGEN, TYUNKNOWN, OPBITSH, 0, 0, 2 }}, +{"ishftc", { INTRBGEN, TYUNKNOWN, OPBITSHC, 0, 0, 2 }}, + +{"" }}; LOCAL struct Specblock diff --git a/src/io.c b/src/io.c index ed1ed16..b35a0f6 100644 --- a/src/io.c +++ b/src/io.c @@ -273,15 +273,15 @@ LOCAL char **io_fields; #define zork(n,t) n, sizeof(n)/sizeof(char *) - 1, t LOCAL io_setup io_stuff[] = { - zork(cilist_names, TYCILIST), /* external read/write */ - zork(inlist_names, TYINLIST), /* inquire */ - zork(olist_names, TYOLIST), /* open */ - zork(cllist_names, TYCLLIST), /* close */ - zork(alist_names, TYALIST), /* rewind */ - zork(alist_names, TYALIST), /* backspace */ - zork(alist_names, TYALIST), /* endfile */ - zork(icilist_names,TYICILIST), /* internal read */ - zork(icilist_names,TYICILIST) /* internal write */ + {zork(cilist_names, TYCILIST)}, /* external read/write */ + {zork(inlist_names, TYINLIST)}, /* inquire */ + {zork(olist_names, TYOLIST)}, /* open */ + {zork(cllist_names, TYCLLIST)}, /* close */ + {zork(alist_names, TYALIST)}, /* rewind */ + {zork(alist_names, TYALIST)}, /* backspace */ + {zork(alist_names, TYALIST)}, /* endfile */ + {zork(icilist_names,TYICILIST)}, /* internal read */ + {zork(icilist_names,TYICILIST)} /* internal write */ }; #undef zork diff --git a/src/lex.c b/src/lex.c index 4b4bce4..b593113 100644 --- a/src/lex.c +++ b/src/lex.c @@ -158,36 +158,36 @@ LOCAL struct Keylist *keystart[26], *keyend[26]; static struct Punctlist puncts[ ] = { - '(', SLPAR, - ')', SRPAR, - '=', SEQUALS, - ',', SCOMMA, - '+', SPLUS, - '-', SMINUS, - '*', SSTAR, - '/', SSLASH, - '$', SCURRENCY, - ':', SCOLON, - '<', SLT, - '>', SGT, - 0, 0 }; + {'(', SLPAR}, + {')', SRPAR}, + {'=', SEQUALS}, + {',', SCOMMA}, + {'+', SPLUS}, + {'-', SMINUS}, + {'*', SSTAR}, + {'/', SSLASH}, + {'$', SCURRENCY}, + {':', SCOLON}, + {'<', SLT}, + {'>', SGT}, + {0, 0}}; LOCAL struct Dotlist dots[ ] = { - "and.", SAND, - "or.", SOR, - "not.", SNOT, - "true.", STRUE, - "false.", SFALSE, - "eq.", SEQ, - "ne.", SNE, - "lt.", SLT, - "le.", SLE, - "gt.", SGT, - "ge.", SGE, - "neqv.", SNEQV, - "eqv.", SEQV, - 0, 0 }; + {"and.", SAND}, + {"or.", SOR}, + {"not.", SNOT}, + {"true.", STRUE}, + {"false.", SFALSE}, + {"eq.", SEQ}, + {"ne.", SNE}, + {"lt.", SLT}, + {"le.", SLE}, + {"gt.", SGT}, + {"ge.", SGE}, + {"neqv.", SNEQV}, + {"eqv.", SEQV}, + {0, 0}}; LOCAL struct Keylist keys[ ] = { debian/patches/0002-prototype-rmdir.patch0000664000000000000000000000077711741064611015413 0ustar From: "Barak A. Pearlmutter" Date: Tue, 14 Feb 2012 14:52:48 +0000 Subject: prototype rmdir --- src/sysdep.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sysdep.c b/src/sysdep.c index 3d7478d..7d0ed55 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -23,6 +23,7 @@ use or performance of this software. #include "defs.h" #include "usignal.h" #include +#include char binread[] = "rb", textread[] = "r"; char binwrite[] = "wb", textwrite[] = "w"; debian/patches/series0000664000000000000000000000025711741065256012047 0ustar 0000-prequilt-tweaks.patch 0001-make-tweaks.patch 0002-prototype-rmdir.patch 0003-struct-init-braces.patch 0004-man-dash-hyphen-slash.patch 0005-distclean-is-very-clean.patch debian/patches/0001-make-tweaks.patch0000664000000000000000000000304611741064611014433 0ustar From: "Barak A. Pearlmutter" Date: Tue, 14 Feb 2012 13:43:17 +0000 Subject: make tweaks Tweak src/makefile.u: use default rules for .o object files and for f2c executable. Create stub f2c.c to allow f2c executable to depend on f2c.o which allows a default rule for f2c executable. Supply stub top-level Makefile. --- Makefile | 4 ++++ src/f2c.c | 1 + src/makefile.u | 7 ++++--- 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 Makefile create mode 100644 src/f2c.c diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..dd4f903 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +all: + +%: + $(MAKE) -C src -f makefile.u $@ diff --git a/src/f2c.c b/src/f2c.c new file mode 100644 index 0000000..17ca069 --- /dev/null +++ b/src/f2c.c @@ -0,0 +1 @@ +/* stub to make default make rule for f2c happy */ diff --git a/src/makefile.u b/src/makefile.u index 0f12022..a9ef4ed 100644 --- a/src/makefile.u +++ b/src/makefile.u @@ -7,8 +7,8 @@ SHELL = /bin/sh YACC = yacc YFLAGS = -.c.o: - $(CC) -c $(CFLAGS) $*.c +#.c.o: +# $(CC) -c $(CFLAGS) $*.c OBJECTSd = main.o init.o gram.o lex.o proc.o equiv.o data.o format.o \ expr.o exec.o intr.o io.o misc.o error.o mem.o names.o \ @@ -26,8 +26,9 @@ OBJECTS = $(OBJECTSd) $(MALLOC) all: f2c +f2c: f2c.o f2c: $(OBJECTS) - $(CC) $(LDFLAGS) $(OBJECTS) -o f2c +# $(CC) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@ # The following used to be a rule for gram.c rather than gram1.c, but # there are too many broken variants of yacc around, so now we debian/patches/0000-prequilt-tweaks.patch0000664000000000000000000005312211741064611015362 0ustar From: Alan Bain Date: Tue, 10 Apr 2012 18:10:19 +0100 Subject: 0000-prequilt-tweaks --- f2c.1t | 126 ++++++++++++++++++++++++++++------------------------ fc | 18 ++++---- fc.1 | 134 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/f2c.1t | 126 ++++++++++++++++++++++++++++------------------------ src/makefile.u | 2 +- src/sysdep.c | 6 +++ 6 files changed, 285 insertions(+), 127 deletions(-) create mode 100644 fc.1 diff --git a/f2c.1t b/f2c.1t index d73d334..4723784 100644 --- a/f2c.1t +++ b/f2c.1t @@ -19,7 +19,6 @@ .hy 14 .. .TH F2C 1 -.CT 1 prog_other .SH NAME f2c \- Convert Fortran 77 to C or C++ . \" f\^2c changed to f2c in the previous line for the benefit of @@ -58,24 +57,24 @@ or .L .P are taken to be prototype files, as produced by option -.LR -P , +.LR \-P , and are read first. .PP The following options have the same meaning as in .IR f\^77 (1). .TP -.B -C +.B \-C Compile code to check that subscripts are within declared array bounds. .TP -.B -I2 +.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) variables in INQUIREs. Option -.L -I4 +.L \-I4 confirms the default rendering of INTEGER as long int. .TP -.BI -I dir +.BI \-I dir Look for a non-absolute include file first in the directory of the current input file, then in directories specified by \f(CW-I\fP options (one directory per option). Options @@ -83,34 +82,34 @@ options (one directory per option). Options have precedence, so, e.g., a directory named \f(CW2\fP should be specified by \f(CW-I./2\fP . .TP -.B -onetrip +.B \-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.) .TP -.B -U +.B \-U Honor the case of variable and external names. Fortran keywords must be in .I lower case. .TP -.B -u +.B \-u Make the default type of a variable `undefined' rather than using the default Fortran rules. .TP -.B -w +.B \-w Suppress all warning messages, or, if the option is -.LR -w66 , +.LR \-w66 , just Fortran 66 compatibility warnings. .PP The following options are peculiar to .IR f\^2c . .TP -.B -A +.B \-A Produce .SM ANSI C (default, starting 20020621). For old-style C, use option \f(CW-K\fP. .TP -.B -a +.B \-a Make local variables automatic rather than static unless they appear in a .SM "DATA, EQUIVALENCE, NAMELIST," @@ -118,26 +117,26 @@ or .SM SAVE statement. .TP -.B -C++ +.B \-C++ Output C++ code. .TP -.B -c +.B \-c Include original Fortran source as comments. .TP -.B -cd +.B \-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. .TP -.BI -d dir +.BI \-d dir Write .L .c files in directory .I dir instead of the current directory. .TP -.B -E +.B \-E Declare uninitialized .SM COMMON to be @@ -147,7 +146,7 @@ to be as .B extern). .TP -.B -ec +.B \-ec Place uninitialized .SM COMMON blocks in separate files: @@ -161,36 +160,36 @@ into the output file, with comments that give an unbundling .IR sed (1) script. .TP -.B -ext +.B \-ext Complain about .IR f\^77 (1) extensions. .TP -.B -f +.B \-f Assume free-format input: accept text after column 72 and do not pad fixed-format lines shorter than 72 characters with blanks. .TP -.B -72 +.B \-72 Treat text appearing after column 72 as an error. .TP -.B -g +.B \-g Include original Fortran line numbers in \f(CW#line\fR lines. .TP -.B -h +.B \-h Emulate Fortran 66's treatment of Hollerith: try to align character strings on word (or, if the option is -.LR -hd , +.LR \-hd , on double-word) boundaries. .TP -.B -i2 +.B \-i2 Similar to -.BR -I2 , +.BR \-I2 , but assume a modified .I libF77 and .I libI77 (compiled with -.BR -Df\^2c_i2 ), +.BR \-Df\^2c_i2 ), so .SM INTEGER and @@ -199,18 +198,18 @@ variables may be assigned by .SM INQUIRE and array lengths are stored in short ints. .TP -.B -i90 +.B \-i90 Do not recognize the Fortran 90 bit-manipulation intrinsics btest, iand, ibclr, ibits, ibset, ieor, ior, ishft, and ishftc. .TP -.B -kr +.B \-kr Use temporary values to enforce Fortran expression evaluation where K&R (first edition) parenthesization rules allow rearrangement. If the option is -.LR -krd , +.LR \-krd , use double precision temporaries even for single-precision operands. .TP -.B -P +.B \-P Write a .IB file .P of ANSI (or C++) prototypes @@ -220,24 +219,24 @@ or .IB file .F . When reading Fortran from standard input, write prototypes at the beginning of standard output. Option -.B -Ps +.B \-Ps implies -.B -P +.B \-P and gives exit status 4 if rerunning .I f\^2c may change prototypes or declarations. .TP -.B -p +.B \-p Supply preprocessor definitions to make common-block members look like local variables. .TP -.B -R +.B \-R Do not promote .SM REAL functions and operations to .SM DOUBLE PRECISION. Option -.L -!R +.L \-!R confirms the default, which imitates .IR f\^77 . .TP @@ -245,7 +244,7 @@ confirms the default, which imitates Cast REAL arguments of intrinsic functions and values of REAL functions (including intrinsics) to REAL. .TP -.B -r8 +.B \-r8 Promote .SM REAL to @@ -253,16 +252,16 @@ to to .SM DOUBLE COMPLEX. .TP -.B -s +.B \-s Preserve multidimensional subscripts. Suppressed by option -.L -C +.L \-C \&. .TP -.BI -T dir +.BI \-T dir Put temporary files in directory .I dir. .TP -.B -trapuv +.B \-trapuv Dynamically initialize local variables, except those appearing in .SM SAVE or @@ -271,42 +270,42 @@ statements, with values that may help find references to uninitialized variables. For example, with IEEE arithmetic, initialize local floating-point variables to signaling NaNs. .TP -.B -w8 +.B \-w8 Suppress warnings when .SM COMMON or .SM EQUIVALENCE forces odd-word alignment of doubles. .TP -.BI -W n +.BI \-W n Assume .I n characters/word (default 4) when initializing numeric variables with character data. .TP -.B -z +.B \-z Do not implicitly recognize .SM DOUBLE COMPLEX. .TP -.B -!bs +.B \-!bs Do not recognize \fIb\fRack\fIs\fRlash escapes (\e", \e', \e0, \e\e, \eb, \ef, \en, \er, \et, \ev) in character strings. .TP -.B -!c +.B \-!c Inhibit C output, but produce .B -P output. .TP -.B -!I +.B i\-!I Reject .B include statements. .TP -.B -!i8 +.B \-!i8 Disallow .SM INTEGER*8 , or, if the option is -.LR -!i8const , +.LR \-!i8const , permit .SM INTEGER*8 but do not promote integer @@ -314,17 +313,20 @@ constants to .SM INTEGER*8 when they involve more than 32 bits. .TP -.B -!it +.B \-!it Don't infer types of untyped .SM EXTERNAL procedures from use as parameters to previously defined or prototyped procedures. .TP -.B -!P +.B \-!P Do not attempt to infer .SM ANSI or C++ prototypes from usage. +.TP +.B \-v, \-\-version +Print the version number of f2c .PP The resulting C invokes the support routines of .IR f\^77 ; @@ -353,14 +355,22 @@ output file .F /usr/include/f2c.h header file .TP -.F /usr/lib/libF77.a -intrinsic function library +.F /usr/lib/libf2c.a +static link intrinsic and I/O library +.TP +.F /usr/lib/libf2c_i2.a +static link intrinsic and I/O library for use with +files translated using the +\-i2 f\^2c option +.TP +.F /usr/lib/libf2c.so +shared object intrinsic and I/O library .TP -.F /usr/lib/libI77.a -Fortran I/O library +.F /usr/lib/libf2c_i2.so +shared object intrinsic and I/O library for use with +files translated using the +\-i2 f\^2c option .TP -.F /lib/libc.a -C library, see section 3 .SH "SEE ALSO" S. I. Feldman and P. J. Weinberger, diff --git a/fc b/fc index 1f71e59..46d13c7 100644 --- a/fc +++ b/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=/bin:/usr/bin # f77-style shell script to compile and load fortran, C, and assembly codes @@ -80,12 +80,13 @@ PATH=/usr/local/bin:/bin:/usr/bin # -U def passed to C compiler (for .c files) # or to cpp (for .F files) to remove def - # -v show current f2c version # --version same as -v -s=/tmp/stderr_$$ -t=/tmp/f77_$$.o +s=`tempfile --prefix=stderr` || { echo "$0: Cannot create temporary file" ; exit 1; } +t=`tempfile --suffix=.o --prefix=f77` || { echo "$0: Cannot create temporary file" ; exit 1; } +trap "rm -f $s $t; exit \$rc" 0 + ### On some systems (e.g., IRIX), -common prevents complaints ### about multiple definitions of COMMON blocks. #CC=${CC_f2c:-'cc -common'} @@ -94,7 +95,7 @@ EFL=${EFL:-efl} EFLFLAGS=${EFLFLAGS:-'system=portable deltastno=10'} RATFOR=${RATFOR:-ratfor} RFLAGS=${RFLAGS:-'-6&'} -F2C=${F2C:-/usr/local/bin/f2c} +F2C=${F2C:-/usr/bin/f2c} show_fc_help=0 case $1 in --help) show_fc_help=1;; @@ -116,14 +117,11 @@ case $show_fc_help in F2CFLAGS=${F2CFLAGS:='-ARw8 -Nn802 -Nq300 -Nx400'} CPP=${CPP:-/lib/cpp} rc=0 -trap "rm -f $s $t; exit \$rc" 0 OUTF=a.out OUTO= cOPT=1 set -- `getopt acCD:gI:L:m:N:O:U:o:r:sSt:uw6 "$@"` case $? in 0);; *) rc=$?; exit;; esac -CPPFLAGS=${CPPFLAGS:-'-I/usr/local/include'} -CFLAGSF2C=${CFLAGSF2C:-'-I/usr/local/include'} OFILES= trapuv= strip= @@ -358,8 +356,8 @@ done case $cOPT in 2) # case $trapuv in 1) OFILES="$OFILES -lfpe";; esac -# $CC -Wl,-dont_warn_unused -o $OUTF -u MAIN__ -L/usr/local/lib $OFILES $LIBS - $CC -o $OUTF -u MAIN__ -L/usr/local/lib $OFILES $LIBS +# $CC -Wl,-dont_warn_unused -o $OUTF -u MAIN__ $OFILES $LIBS + $CC -o $OUTF -u MAIN__ $OFILES $LIBS case $strip in 1) strip $OUTF;; esac ;; esac rc=$? diff --git a/fc.1 b/fc.1 new file mode 100644 index 0000000..1bb23db --- /dev/null +++ b/fc.1 @@ -0,0 +1,134 @@ +'\" 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 +.\" Updated by Alan Bain (afrb2@debian.org), 28/4/2008 +.\" mention -v and --version options, change hyphens to minus signs +.\" +.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 \-v, \-\-version +Print version of f2c in use +.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) diff --git a/src/f2c.1t b/src/f2c.1t index d73d334..4723784 100644 --- a/src/f2c.1t +++ b/src/f2c.1t @@ -19,7 +19,6 @@ .hy 14 .. .TH F2C 1 -.CT 1 prog_other .SH NAME f2c \- Convert Fortran 77 to C or C++ . \" f\^2c changed to f2c in the previous line for the benefit of @@ -58,24 +57,24 @@ or .L .P are taken to be prototype files, as produced by option -.LR -P , +.LR \-P , and are read first. .PP The following options have the same meaning as in .IR f\^77 (1). .TP -.B -C +.B \-C Compile code to check that subscripts are within declared array bounds. .TP -.B -I2 +.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) variables in INQUIREs. Option -.L -I4 +.L \-I4 confirms the default rendering of INTEGER as long int. .TP -.BI -I dir +.BI \-I dir Look for a non-absolute include file first in the directory of the current input file, then in directories specified by \f(CW-I\fP options (one directory per option). Options @@ -83,34 +82,34 @@ options (one directory per option). Options have precedence, so, e.g., a directory named \f(CW2\fP should be specified by \f(CW-I./2\fP . .TP -.B -onetrip +.B \-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.) .TP -.B -U +.B \-U Honor the case of variable and external names. Fortran keywords must be in .I lower case. .TP -.B -u +.B \-u Make the default type of a variable `undefined' rather than using the default Fortran rules. .TP -.B -w +.B \-w Suppress all warning messages, or, if the option is -.LR -w66 , +.LR \-w66 , just Fortran 66 compatibility warnings. .PP The following options are peculiar to .IR f\^2c . .TP -.B -A +.B \-A Produce .SM ANSI C (default, starting 20020621). For old-style C, use option \f(CW-K\fP. .TP -.B -a +.B \-a Make local variables automatic rather than static unless they appear in a .SM "DATA, EQUIVALENCE, NAMELIST," @@ -118,26 +117,26 @@ or .SM SAVE statement. .TP -.B -C++ +.B \-C++ Output C++ code. .TP -.B -c +.B \-c Include original Fortran source as comments. .TP -.B -cd +.B \-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. .TP -.BI -d dir +.BI \-d dir Write .L .c files in directory .I dir instead of the current directory. .TP -.B -E +.B \-E Declare uninitialized .SM COMMON to be @@ -147,7 +146,7 @@ to be as .B extern). .TP -.B -ec +.B \-ec Place uninitialized .SM COMMON blocks in separate files: @@ -161,36 +160,36 @@ into the output file, with comments that give an unbundling .IR sed (1) script. .TP -.B -ext +.B \-ext Complain about .IR f\^77 (1) extensions. .TP -.B -f +.B \-f Assume free-format input: accept text after column 72 and do not pad fixed-format lines shorter than 72 characters with blanks. .TP -.B -72 +.B \-72 Treat text appearing after column 72 as an error. .TP -.B -g +.B \-g Include original Fortran line numbers in \f(CW#line\fR lines. .TP -.B -h +.B \-h Emulate Fortran 66's treatment of Hollerith: try to align character strings on word (or, if the option is -.LR -hd , +.LR \-hd , on double-word) boundaries. .TP -.B -i2 +.B \-i2 Similar to -.BR -I2 , +.BR \-I2 , but assume a modified .I libF77 and .I libI77 (compiled with -.BR -Df\^2c_i2 ), +.BR \-Df\^2c_i2 ), so .SM INTEGER and @@ -199,18 +198,18 @@ variables may be assigned by .SM INQUIRE and array lengths are stored in short ints. .TP -.B -i90 +.B \-i90 Do not recognize the Fortran 90 bit-manipulation intrinsics btest, iand, ibclr, ibits, ibset, ieor, ior, ishft, and ishftc. .TP -.B -kr +.B \-kr Use temporary values to enforce Fortran expression evaluation where K&R (first edition) parenthesization rules allow rearrangement. If the option is -.LR -krd , +.LR \-krd , use double precision temporaries even for single-precision operands. .TP -.B -P +.B \-P Write a .IB file .P of ANSI (or C++) prototypes @@ -220,24 +219,24 @@ or .IB file .F . When reading Fortran from standard input, write prototypes at the beginning of standard output. Option -.B -Ps +.B \-Ps implies -.B -P +.B \-P and gives exit status 4 if rerunning .I f\^2c may change prototypes or declarations. .TP -.B -p +.B \-p Supply preprocessor definitions to make common-block members look like local variables. .TP -.B -R +.B \-R Do not promote .SM REAL functions and operations to .SM DOUBLE PRECISION. Option -.L -!R +.L \-!R confirms the default, which imitates .IR f\^77 . .TP @@ -245,7 +244,7 @@ confirms the default, which imitates Cast REAL arguments of intrinsic functions and values of REAL functions (including intrinsics) to REAL. .TP -.B -r8 +.B \-r8 Promote .SM REAL to @@ -253,16 +252,16 @@ to to .SM DOUBLE COMPLEX. .TP -.B -s +.B \-s Preserve multidimensional subscripts. Suppressed by option -.L -C +.L \-C \&. .TP -.BI -T dir +.BI \-T dir Put temporary files in directory .I dir. .TP -.B -trapuv +.B \-trapuv Dynamically initialize local variables, except those appearing in .SM SAVE or @@ -271,42 +270,42 @@ statements, with values that may help find references to uninitialized variables. For example, with IEEE arithmetic, initialize local floating-point variables to signaling NaNs. .TP -.B -w8 +.B \-w8 Suppress warnings when .SM COMMON or .SM EQUIVALENCE forces odd-word alignment of doubles. .TP -.BI -W n +.BI \-W n Assume .I n characters/word (default 4) when initializing numeric variables with character data. .TP -.B -z +.B \-z Do not implicitly recognize .SM DOUBLE COMPLEX. .TP -.B -!bs +.B \-!bs Do not recognize \fIb\fRack\fIs\fRlash escapes (\e", \e', \e0, \e\e, \eb, \ef, \en, \er, \et, \ev) in character strings. .TP -.B -!c +.B \-!c Inhibit C output, but produce .B -P output. .TP -.B -!I +.B i\-!I Reject .B include statements. .TP -.B -!i8 +.B \-!i8 Disallow .SM INTEGER*8 , or, if the option is -.LR -!i8const , +.LR \-!i8const , permit .SM INTEGER*8 but do not promote integer @@ -314,17 +313,20 @@ constants to .SM INTEGER*8 when they involve more than 32 bits. .TP -.B -!it +.B \-!it Don't infer types of untyped .SM EXTERNAL procedures from use as parameters to previously defined or prototyped procedures. .TP -.B -!P +.B \-!P Do not attempt to infer .SM ANSI or C++ prototypes from usage. +.TP +.B \-v, \-\-version +Print the version number of f2c .PP The resulting C invokes the support routines of .IR f\^77 ; @@ -353,14 +355,22 @@ output file .F /usr/include/f2c.h header file .TP -.F /usr/lib/libF77.a -intrinsic function library +.F /usr/lib/libf2c.a +static link intrinsic and I/O library +.TP +.F /usr/lib/libf2c_i2.a +static link intrinsic and I/O library for use with +files translated using the +\-i2 f\^2c option +.TP +.F /usr/lib/libf2c.so +shared object intrinsic and I/O library .TP -.F /usr/lib/libI77.a -Fortran I/O library +.F /usr/lib/libf2c_i2.so +shared object intrinsic and I/O library for use with +files translated using the +\-i2 f\^2c option .TP -.F /lib/libc.a -C library, see section 3 .SH "SEE ALSO" S. I. Feldman and P. J. Weinberger, diff --git a/src/makefile.u b/src/makefile.u index e9f9c5e..0f12022 100644 --- a/src/makefile.u +++ b/src/makefile.u @@ -24,7 +24,7 @@ MALLOC = OBJECTS = $(OBJECTSd) $(MALLOC) -all: xsum.out f2c +all: f2c f2c: $(OBJECTS) $(CC) $(LDFLAGS) $(OBJECTS) -o f2c diff --git a/src/sysdep.c b/src/sysdep.c index ab5b04e..3d7478d 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -22,6 +22,7 @@ use or performance of this software. ****************************************************************/ #include "defs.h" #include "usignal.h" +#include char binread[] = "rb", textread[] = "r"; char binwrite[] = "wb", textwrite[] = "w"; @@ -94,7 +95,9 @@ Un_link_all(int cdelete) if (!debugflag) { unlink(c_functions); unlink(initfname); + unlink(initbname); unlink(p1_file); + unlink(p1_bakfile); unlink(sortfname); unlink(blkdfname); if (cdelete && coutput) @@ -233,6 +236,9 @@ set_tmp_names(Void) #endif /*NO_TEMPDIR*/ } alloc_names(); + /* What follows is safe if tmpdir is really + a private diectory created by us -- otherwise + the file could be a sym link somewhere else....*/ sprintf(c_functions, "%s/f2c%ld_func", tmpdir, pid); sprintf(initfname, "%s/f2c%ld_rd", tmpdir, pid); sprintf(blkdfname, "%s/f2c%ld_blkd", tmpdir, pid); debian/patches/0005-distclean-is-very-clean.patch0000664000000000000000000000111511741064611016643 0ustar From: "Barak A. Pearlmutter" Date: Tue, 10 Apr 2012 17:33:51 +0100 Subject: distclean is very clean --- src/makefile.u | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/makefile.u b/src/makefile.u index a9ef4ed..575ebc7 100644 --- a/src/makefile.u +++ b/src/makefile.u @@ -92,6 +92,8 @@ clean: veryclean: clean rm -f xsum +distclean: veryclean + b = Notice README cds.c data.c defines.h defs.h equiv.c error.c \ exec.c expr.c f2c.1 f2c.1t f2c.h format.c format.h formatdata.c \ ftypes.h gram.c gram.dcl gram.exec gram.expr gram.head gram.io \ debian/patches/0004-man-dash-hyphen-slash.patch0000664000000000000000000000126511741064611016317 0ustar From: "Barak A. Pearlmutter" Date: Tue, 14 Feb 2012 15:31:20 +0000 Subject: man dash hyphen slash --- fc.1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fc.1 b/fc.1 index 1bb23db..52a0971 100644 --- a/fc.1 +++ b/fc.1 @@ -105,14 +105,14 @@ Omit Fortran 66 (Fortran IV) compatibility warning messages. 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 +.I \-I includepath Passed to the C compiler (for .c files), to cpp (for .F files) and to f2c. .TP 8 -.I -Ntnnn +.I \-Ntnnn Allow nnn entries in table t. .TP 8 -.I -P +.I \-P Emit .P files. .SH BUGS .B fc debian/f2c.manpages0000664000000000000000000000001411716471340011356 0ustar fc.1 f2c.1t debian/source/0000775000000000000000000000000011741063336010474 5ustar debian/source/format0000664000000000000000000000001411741060070011672 0ustar 3.0 (quilt) debian/control0000664000000000000000000000177011741034050010573 0ustar Source: f2c Section: devel Priority: optional Maintainer: Alan Bain Uploaders: Barak A. Pearlmutter Standards-Version: 3.9.3 Build-Depends: debhelper (>= 9) Homepage: http://www.netlib.org/f2c/ Vcs-Git: git://git.debian.org/git/collab-maint/f2c.git Vcs-Browser: http://git.debian.org/?p=collab-maint/f2c.git Package: f2c Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, libf2c2-dev Recommends: gcc Suggests: fort77 Description: FORTRAN 77 to C/C++ translator 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. debian/f2c.install0000664000000000000000000000003711716471340011236 0ustar src/f2c /usr/bin fc /usr/bin debian/f2c.docs0000664000000000000000000000001611716471340010515 0ustar f2c.ps README debian/changelog0000664000000000000000000002450611741064414011053 0ustar f2c (20100827-1) unstable; urgency=low * new upstream version * update packaging - dh9 - bump policy version - snag hardening flags etc in debian/rules - dpkg source format 3.0 (quilt) - move upstream mods into big quilt patch for later dissection * remove debian-specific fc; upstream caught up * quilt patch for C warnings * quilt patch for man page hyphens * quilt patches for build system to simplify debian/rules -- Barak A. Pearlmutter Tue, 10 Apr 2012 18:08:28 +0100 f2c (20090411-1) unstable; urgency=low * new upstream source * remove .CT macro from manpage as not supported by groff * remove .comment section from f2c binary * update the f2c manpage to reference correct libraries -- Alan Bain Wed, 5 Aug 2009 21:00:07 +0100 f2c (20061008-3) unstable; urgency=low * remove use of DH_COMPAT from debian/rules -- Alan Bain Mon, 12 May 2008 22:15:24 +0100 f2c (20061008-2) unstable; urgency=low * fixes for IA64 architecture, segmentation violation on invocation -- Alan Bain Sat, 10 May 2008 10:55:03 +0100 f2c (20061008-1) unstable; urgency=low * new upstream source (closes: bug#401094) * correction to handling of integer*8 subscripts -- Alan Bain Sun, 27 Apr 2008 19:40:03 +0100 f2c (20050501-3) unstable; urgency=low * Correct date error in previous changelog. -- Alan Bain Sun, 27 Apr 2008 16:45:03 +0100 f2c (20050501-2) unstable; urgency=low * removed empty /usr/include dir * remove bashism from debian rules (closes: bug#477579) * handle nostrip option (closes: bug#436825) * package is not orphaned (closes: bug#465909) * generate md5sums -- Alan Bain Sun, 27 Apr 2008 16:15:03 +0100 f2c (20050501-1) unstable; urgency=low * Separated libf2c2 into a separate package to be more standards compilant. * New upstream release of f2c. This addresses * Bug fix for f2c -s processing of real part of complex array reference. * Warnings issued about inappropriate use of arrays. * Upstream author fix for [CAN-2005-0017] so when -T not specified the temporary files are created in a private directory created by mkdtemp() and removed after execution. -- Alan Bain Sun, 18 Sep 2005 21:19:48 +0100 f2c (20020621-4) unstable; urgency=low * Removed /usr/doc symlink (closes: bug#322830) * NMU fixed bugs (closes: bug#292792, bug# 305971) -- Alan Bain Thu, 18 Aug 2005 19:27:10 +0100 f2c (20020621-3.4) unstable; urgency=high * Re-NMU for same issue, yay * Fix a remaining extern char * that needs to be extern char[]; build tested to actually work this time. ;) Really-closes: #305971. -- Steve Langasek Sat, 30 Apr 2005 20:03:18 -0700 f2c (20020621-3.3) unstable; urgency=medium * Re-NMU for same issue. * Use preallocated buffers for our tmpfile names, instead of using randomly-sized strings and scribbling on memory. Closes: #305971. (Patch by Steve Langasek.) * Lowered upload urgency to get a little more testing this time. -- Joey Hess Mon, 25 Apr 2005 14:32:09 -0400 f2c (20020621-3.2) unstable; urgency=HIGH * NMU again for same security issues. * Corrected the patch to create proper temporary files by not shadowing global scope variables with local scope ones. Thanks to Dan McMahill from NetBSD [src/sysdep.c, patches/patch.CAN-2005-0017.f2c, CAN-2005-0017] -- Joey Hess Thu, 21 Apr 2005 12:32:07 -0400 f2c (20020621-3.1) unstable; urgency=HIGH * NMU for security issues. Closes: #292792 * Corrected creating of temporary files f2c [CAN-2005-0017] * Added patch by Javier Fernandez-Sanguino Peña to fix temporary file problem in fc [CAN-2005-0018] * Removed xsum comparison since it prevents security updates from being applied [src/makefile] -- Joey Hess Fri, 4 Feb 2005 13:28:26 -0500 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. debian/copyright0000664000000000000000000000224011716471340011125 0ustar /**************************************************************** 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. ****************************************************************/ debian/compat0000664000000000000000000000000211741033736010373 0ustar 9 debian/clean0000664000000000000000000000010111716471340010171 0ustar src/xsum src/xsum1.out src/xsum.out build build_f2c build_f2c_i2 debian/rules0000775000000000000000000000045711741057266010267 0ustar #!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 %: dh $@ --parallel override_dh_auto_build: dh_auto_build -- $(shell dpkg-buildflags --export=configure) override_dh_auto_test: override_dh_auto_install: override_dh_installchangelog: dh_installchangelog changes debian/watch0000664000000000000000000000040711716471340010226 0ustar # Netlib # Unfortunately it is not easy to determine the version # number from upstream. It is contained in a source code # file src/version.c # http://www.netlib.org/f2c/index.html # which can be directly accessed as # http://www.netlib.org/f2c/src/version.c