Index: head/lang/f2c/Makefile =================================================================== --- head/lang/f2c/Makefile (revision 557138) +++ head/lang/f2c/Makefile (revision 557139) @@ -1,76 +1,81 @@ # Created by: Steven G. Kargl # $FreeBSD$ PORTNAME= f2c -PORTVERSION= 20060810 -PORTREVISION= 6 +PORTVERSION= 20200916 CATEGORIES= lang -MASTER_SITES= LOCAL/maho/f2c -DISTNAME= ${PORTNAME} -EXTRACT_SUFX= .tar +MASTER_SITES= NETLIB/f2c +DISTFILES= ${SIMPLEDIST} libf2c.zip src.tgz DIST_SUBDIR= ${PORTNAME}-${PORTVERSION} MAINTAINER= fortran@FreeBSD.org COMMENT= Fortran-to-C converter and its run-time libraries +LICENSE= ATT +LICENSE_NAME= Copyright of AT&T, Lucent Technologies and Bellcore +LICENSE_FILE= ${WRKSRC}/libf2c/Notice +LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept + BROKEN_mips= fails to compile: /usr/include/sigfpe.h: No such file or directory BROKEN_mips64= fails to compile: /usr/include/sigfpe.h: No such file or directory -EXTRACT_DEPENDS= ${UNZIP_CMD}:archivers/unzip - -GUNZIP_CMD= minigzip -d USES= gmake USE_LDCONFIG= yes LIBVER= 2 +SIMPLEDIST= changes f2c.1 f2c.1t f2c.h f2c.pdf fc getopt.c README # Set FCNAME to the name of the Fortran 77 / F2C wrapper. FCNAME?= fc PLIST_SUB= FCNAME=${FCNAME} LIBVER=${LIBVER} -PORTDOCS= 00lastchange README README_libf2c changes f2c.pdf permission +PORTDOCS= README README_libf2c changes f2c.pdf OPTIONS_DEFINE= DOCS FC LEAD_0 OPTIONS_SUB= yes FC_DESC= f77 script based on f2c LEAD_0_DESC= Print with leading zeros LEAD_0_CFLAGS= -DWANT_LEAD_0 -post-extract: - cd ${WRKSRC} && ${FIND} . -name "*.gz" | ${XARGS} ${GUNZIP_CMD} - cd ${WRKSRC} && ${UNZIP_CMD} libf2c.zip - ${CP} -p ${WRKSRC}/libf2c/README ${WRKSRC}/README_libf2c +do-extract: + ${MKDIR} ${WRKSRC}/libf2c +.for f in ${SIMPLEDIST} + ${CP} ${_DISTDIR}/${f} ${WRKSRC} +.endfor + ${UNZIP_NATIVE_CMD} ${_DISTDIR}/libf2c.zip -q -d ${WRKSRC}/libf2c + (cd ${WRKSRC} && ${TAR} xfz ${_DISTDIR}/src.tgz) pre-patch: ${CP} -p ${WRKSRC}/libf2c/makefile.u ${WRKSRC}/libf2c/Makefile ${CP} -p ${WRKSRC}/src/makefile.u ${WRKSRC}/src/Makefile pre-configure: ${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' ${WRKSRC}/fc ${REINPLACE_CMD} -e 's|#CFLAGS = -O|CFLAGS = ${CFLAGS}|' ${WRKSRC}/src/Makefile ${REINPLACE_CMD} 's|%%LIBVER%%|${LIBVER}|' ${WRKSRC}/libf2c/Makefile do-build: @${ECHO_MSG} "===> Building f2c..." - @(cd ${WRKSRC}/src && ${DO_MAKE_BUILD} ${ALL_TARGET}) + (cd ${WRKSRC}/src && ${DO_MAKE_BUILD} ${ALL_TARGET}) @${ECHO_MSG} "===> Building libf2c..." - @(cd ${WRKSRC}/libf2c && ${DO_MAKE_BUILD} ${ALL_TARGET} libf2c.so) + (cd ${WRKSRC}/libf2c && ${DO_MAKE_BUILD} ${ALL_TARGET} libf2c.so) ${MV} ${WRKSRC}/libf2c/libf2c.so ${WRKSRC}/libf2c/libf2c.so.${LIBVER} do-install: ${INSTALL_PROGRAM} ${WRKSRC}/src/f2c ${STAGEDIR}${PREFIX}/bin ${INSTALL_DATA} ${WRKSRC}/src/f2c.h ${STAGEDIR}${PREFIX}/include ${INSTALL_MAN} ${WRKSRC}/src/f2c.1t ${STAGEDIR}${MAN1PREFIX}/man/man1/f2c.1 ${INSTALL_DATA} ${WRKSRC}/libf2c/libf2c.a ${STAGEDIR}${PREFIX}/lib ${INSTALL_LIB} ${WRKSRC}/libf2c/libf2c.so.${LIBVER} ${STAGEDIR}${PREFIX}/lib ${LN} -sf libf2c.so.${LIBVER} ${STAGEDIR}${PREFIX}/lib/libf2c.so do-install-DOCS-on: + ${CP} ${WRKSRC}/libf2c/README ${WRKSRC}/README_libf2c @${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR} do-install-FC-on: ${INSTALL_SCRIPT} ${WRKSRC}/fc ${STAGEDIR}${PREFIX}/bin/${FCNAME} .include Index: head/lang/f2c/distinfo =================================================================== --- head/lang/f2c/distinfo (revision 557138) +++ head/lang/f2c/distinfo (revision 557139) @@ -1,2 +1,21 @@ -SHA256 (f2c-20060810/f2c.tar) = 0ce78544ddfcdac24b3ffc4cf8696f3b1b49390198e2d85fec3ce3a78545a948 -SIZE (f2c-20060810/f2c.tar) = 1201152 +TIMESTAMP = 1607198735 +SHA256 (f2c-20200916/changes) = 5b7993437e1281f860a81de86875b1cf36e2eae75f6330b666e38ce3273a7814 +SIZE (f2c-20200916/changes) = 135491 +SHA256 (f2c-20200916/f2c.1) = f66eb9fb49984799c5fe7fc7651da2712d4ef40d505a337625216dac0e032dfb +SIZE (f2c-20200916/f2c.1) = 7532 +SHA256 (f2c-20200916/f2c.1t) = d37a61295b245906a81d262a667f2a4491f5bd9243b07d46a6fb2e1689e8e8e5 +SIZE (f2c-20200916/f2c.1t) = 7574 +SHA256 (f2c-20200916/f2c.h) = 7d323c009951dbd40201124b9302cb21daab2d98bed3d4a56b51b48958bc76ef +SIZE (f2c-20200916/f2c.h) = 4688 +SHA256 (f2c-20200916/f2c.pdf) = 816cdbfd20ce3695be0eb976648714b6fe496785bb8026c6b8911712764d57c7 +SIZE (f2c-20200916/f2c.pdf) = 73606 +SHA256 (f2c-20200916/fc) = f0dced9b581a5808bd2d0d5e4716997043960a56333d5f4c44b201b870aa0ea8 +SIZE (f2c-20200916/fc) = 7751 +SHA256 (f2c-20200916/getopt.c) = e71a770ef56f5a340a2fe114e202de51d58a1ebca0e39d26b3e17f9808af6ebb +SIZE (f2c-20200916/getopt.c) = 2586 +SHA256 (f2c-20200916/libf2c.zip) = f13c01421e9668dc86c78159d87c2f802dd1f8e62037834285c7ab77200d97d5 +SIZE (f2c-20200916/libf2c.zip) = 128845 +SHA256 (f2c-20200916/src.tgz) = d4847456aa91c74e5e61e2097780ca6ac3b20869fae8864bfa8dcc66f6721d35 +SIZE (f2c-20200916/src.tgz) = 284025 +SHA256 (f2c-20200916/README) = 0d9a1fdcb9b6bbcd4877f24429db93f55cb08ab7469ebbc81afb21df4eba5d51 +SIZE (f2c-20200916/README) = 7973 Index: head/lang/f2c/files/patch-better-security =================================================================== --- head/lang/f2c/files/patch-better-security (revision 557138) +++ head/lang/f2c/files/patch-better-security (revision 557139) @@ -1,76 +1,73 @@ -diff -ruN f2c.orig/files/patch-libf2c+lwrite.c f2c/files/patch-libf2c+lwrite.c ---- f2c.orig/files/patch-libf2c+lwrite.c 1969-12-31 19:00:00.000000000 -0500 -+++ f2c/files/patch-libf2c+lwrite.c 2008-07-29 14:05:35.000000000 -0500 +--- f2c/files/patch-libf2c+lwrite.c.orig 2020-12-05 22:19:12 UTC ++++ f2c/files/patch-libf2c+lwrite.c @@ -0,0 +1,24 @@ +--- libf2c/lwrite.c.orig 2008-07-29 13:57:49.000000000 -0500 -++++ libf2c/lwrite.c 2008-07-29 14:02:33.000000000 -0500 +++++ libf2c/lwrite.c +@@ -107,10 +107,10 @@ + absn = -absn; + fmt = LLOW <= absn && absn < LHIGH ? LFFMT : LEFMT; + #ifdef USE_STRLEN +- sprintf(buf, fmt, n); ++ snprintf(buf, sizeof(buf), fmt, n); + return strlen(buf); + #else +- return sprintf(buf, fmt, n); ++ return snprintf(buf, sizeof(buf), fmt, n); + #endif + + #else +@@ -134,7 +134,7 @@ + *b = 0; + goto f__ret; + } +- sprintf(b, LGFMT, n); ++ snprintf(b, sizeof(b), LGFMT, n); + switch(*b) { + #ifndef WANT_LEAD_0 + case '0': -diff -ruN f2c.orig/files/patch-libf2c+open.c f2c/files/patch-libf2c+open.c ---- f2c.orig/files/patch-libf2c+open.c 1969-12-31 19:00:00.000000000 -0500 -+++ f2c/files/patch-libf2c+open.c 2008-07-29 14:08:51.000000000 -0500 +--- f2c/files/patch-libf2c+open.c.orig 2020-12-05 22:19:12 UTC ++++ f2c/files/patch-libf2c+open.c @@ -0,0 +1,29 @@ +--- libf2c/open.c.orig 2008-07-29 13:58:04.000000000 -0500 -++++ libf2c/open.c 2008-07-29 14:08:30.000000000 -0500 +++++ libf2c/open.c +@@ -12,7 +12,7 @@ + #ifdef KR_headers + extern char *malloc(); + #ifdef NON_ANSI_STDIO +-extern char *mktemp(); ++extern int mkstemp(); + #endif + extern integer f_clos(); + #else +@@ -187,7 +187,7 @@ + opnerr(a->oerr,107,"open") + } + else +- sprintf(buf, "fort.%ld", (long)a->ounit); ++ snprintf(buf, sizeof(buf), "fort.%ld", (long)a->ounit); + b->uscrtch = 0; + b->uend=0; + b->uwrt = 0; +@@ -211,7 +211,7 @@ + b->uscrtch=1; + #ifdef NON_ANSI_STDIO + (void) strcpy(buf,"tmp.FXXXXXX"); +- (void) mktemp(buf); ++ (void) mkstemp(buf); + goto replace; + #else + if (!(b->ufd = tmpfile())) -diff -ruN f2c.orig/files/patch-libf2c+rawio.h f2c/files/patch-libf2c+rawio.h ---- f2c.orig/files/patch-libf2c+rawio.h 1969-12-31 19:00:00.000000000 -0500 -+++ f2c/files/patch-libf2c+rawio.h 2008-07-29 14:09:17.000000000 -0500 +--- f2c/files/patch-libf2c+rawio.h.orig 2020-12-05 22:19:12 UTC ++++ f2c/files/patch-libf2c+rawio.h @@ -0,0 +1,11 @@ +--- libf2c/rawio.h.orig 2008-07-29 14:07:02.000000000 -0500 -++++ libf2c/rawio.h 2008-07-29 14:08:08.000000000 -0500 +++++ libf2c/rawio.h +@@ -26,7 +26,7 @@ + #endif + #endif /*KR_HEADERS*/ + +-extern char *mktemp(char*); ++extern int mkstemp(char*); + + #ifdef __cplusplus + } Index: head/lang/f2c/files/patch-f2c.h =================================================================== --- head/lang/f2c/files/patch-f2c.h (revision 557138) +++ head/lang/f2c/files/patch-f2c.h (revision 557139) @@ -1,171 +1,172 @@ taken from /usr/src/gnu/lib/libg2c/g2c.h of FreeBSD 6.2-RELEASE ---- src/xsum0.out Mon Jan 15 16:39:12 2007 -+++ src/xsum0.out Mon Jan 15 16:39:45 2007 +--- src/xsum0.out.orig 2020-09-16 22:54:09.000000000 +0000 ++++ src/xsum0.out 2020-12-06 12:12:56.822181000 +0000 @@ -10,7 +10,7 @@ expr.c 6bfe005 72276 f2c.1 b0441b2 7532 f2c.1t bf1f87 7574 -f2c.h e770b7d8 4688 +f2c.h 119ccae4 5589 - format.c bc32336 59652 + format.c f00da069 59974 format.h b396862 458 - formatdata.c 11a95834 28870 + formatdata.c 1f0f56eb 28988 ---- libf2c/f2c.h0.orig Tue Sep 7 13:46:24 1999 -+++ libf2c/f2c.h0 Mon Jan 15 16:39:12 2007 -@@ -1,4 +1,13 @@ +--- libf2c/f2c.h0.orig 1999-09-07 17:46:24 UTC ++++ libf2c/f2c.h0 +@@ -1,5 +1,14 @@ -/* f2c.h -- Standard Fortran to C header file */ +/* g2c.h -- g77 version of f2c (Standard Fortran to C header file) */ -+ + +/* This file is generated by the g77 libg2c configuration process from a + file named g2c.hin. This process sets up the appropriate types, + defines the appropriate macros, and so on. The resulting g2c.h file + is used to build g77's copy of libf2c, named libg2c, and also can + be used when compiling C code produced by f2c to link the resulting + object file(s) with those produced by the same version of g77 that + produced this file, allowing inter-operability of f2c-compiled and + g77-compiled code. */ - ++ /** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed." + - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */ @@ -7,24 +16,24 @@ #ifndef F2C_INCLUDE #define F2C_INCLUDE -typedef long int integer; -typedef unsigned long int uinteger; +/* F2C_INTEGER will normally be `int' but would be `long' on 16-bit systems */ +/* we assume short, float are OK */ +typedef int /* long int */ integer; +typedef unsigned long int /* long */ 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 int /* 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 */ +typedef long long int /* long long */ longint; /* system-dependent */ +typedef unsigned long long int /* 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) -@@ -37,14 +46,15 @@ +@@ -37,14 +46,15 @@ typedef unsigned long long ulongint; /* system-depende /* I/O stuff */ #ifdef f2c_i2 +#error "f2c_i2 will not work with g77!!!!" /* for -i2 */ typedef short flag; typedef short ftnlen; typedef short ftnint; #else -typedef long int flag; -typedef long int ftnlen; -typedef long int ftnint; +typedef int /* long int */ flag; +typedef int /* long int */ ftnlen; +typedef int /* long int */ ftnint; #endif /*external read, write*/ -@@ -201,6 +211,9 @@ +@@ -201,6 +211,9 @@ typedef doublereal E_f; /* real function with -R not s /* undef any lower-case symbols that your C compiler predefines, e.g.: */ #ifndef Skip_f2c_Undefs +/* (No such symbols should be defined in a strict ANSI C compiler. + We can avoid trouble with f2c-translated code by using + gcc -ansi [-traditional].) */ #undef cray #undef gcos #undef mc68010 - ---- src/f2c.h.orig Mon Jan 15 16:39:12 2007 -+++ src/f2c.h Mon Jan 15 16:39:12 2007 -@@ -1,4 +1,13 @@ +--- src/f2c.h.orig 1999-09-07 17:46:24 UTC ++++ src/f2c.h +@@ -1,5 +1,14 @@ -/* f2c.h -- Standard Fortran to C header file */ +/* g2c.h -- g77 version of f2c (Standard Fortran to C header file) */ -+ + +/* This file is generated by the g77 libg2c configuration process from a + file named g2c.hin. This process sets up the appropriate types, + defines the appropriate macros, and so on. The resulting g2c.h file + is used to build g77's copy of libf2c, named libg2c, and also can + be used when compiling C code produced by f2c to link the resulting + object file(s) with those produced by the same version of g77 that + produced this file, allowing inter-operability of f2c-compiled and + g77-compiled code. */ - ++ /** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed." + - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */ @@ -7,24 +16,24 @@ #ifndef F2C_INCLUDE #define F2C_INCLUDE -typedef long int integer; -typedef unsigned long int uinteger; +/* F2C_INTEGER will normally be `int' but would be `long' on 16-bit systems */ +/* we assume short, float are OK */ +typedef int /* long int */ integer; +typedef unsigned long int /* long */ 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 int /* 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 */ +typedef long long int /* long long */ longint; /* system-dependent */ +typedef unsigned long long int /* 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) -@@ -37,14 +46,15 @@ +@@ -37,14 +46,15 @@ typedef unsigned long long ulongint; /* system-depende /* I/O stuff */ #ifdef f2c_i2 +#error "f2c_i2 will not work with g77!!!!" /* for -i2 */ typedef short flag; typedef short ftnlen; typedef short ftnint; #else -typedef long int flag; -typedef long int ftnlen; -typedef long int ftnint; +typedef int /* long int */ flag; +typedef int /* long int */ ftnlen; +typedef int /* long int */ ftnint; #endif /*external read, write*/ -@@ -201,6 +211,9 @@ +@@ -201,6 +211,9 @@ typedef doublereal E_f; /* real function with -R not s /* undef any lower-case symbols that your C compiler predefines, e.g.: */ #ifndef Skip_f2c_Undefs +/* (No such symbols should be defined in a strict ANSI C compiler. + We can avoid trouble with f2c-translated code by using + gcc -ansi [-traditional].) */ #undef cray #undef gcos #undef mc68010 Index: head/lang/f2c/files/patch-libf2c_MAIN.c =================================================================== --- head/lang/f2c/files/patch-libf2c_MAIN.c (revision 557138) +++ head/lang/f2c/files/patch-libf2c_MAIN.c (revision 557139) @@ -1,21 +1,21 @@ ---- libf2c/MAIN.c.orig Sun Jul 30 15:06:49 2006 -+++ libf2c/MAIN.c Sun Jul 30 15:12:02 2006 +--- libf2c/MAIN.c.orig 2020-12-05 22:19:12 UTC ++++ libf2c/MAIN.c @@ -0,0 +1,18 @@ +/* + Add a pseudo entry point for cases where the main FOTRAN program is missing + e.g. ports/cad/tochnog. + + Credit: adapted from Sergio Gelato on Usenet. +*/ + +#include +#include +#include + +__weak_reference(missing_MAIN__,MAIN__); + +void missing_MAIN__ (void) +{ + fprintf(stderr, "The Fortran main program is missing.\n"); + abort(); +} Index: head/lang/f2c/files/patch-libf2c_Makefile =================================================================== --- head/lang/f2c/files/patch-libf2c_Makefile (revision 557138) +++ head/lang/f2c/files/patch-libf2c_Makefile (revision 557139) @@ -1,50 +1,52 @@ ---- libf2c/Makefile.orig Fri Jun 6 15:09:42 2003 -+++ libf2c/Makefile Sun Jul 30 11:48:17 2006 +--- libf2c/Makefile.orig 2008-11-27 06:20:03 UTC ++++ libf2c/Makefile @@ -13,9 +13,9 @@ # to the CFLAGS = line below. .SUFFIXES: .c .o -CC = cc +#CC = cc SHELL = /bin/sh -CFLAGS = -O +CFLAGS += -fPIC # compile, then strip unnecessary symbols .c.o: -@@ -29,7 +29,7 @@ +@@ -29,7 +29,7 @@ CFLAGS = -O MISC = f77vers.o i77vers.o main.o s_rnge.o abort_.o exit_.o getarg_.o iargc_.o\ - getenv_.o signal_.o s_stop.o s_paus.o system_.o cabs.o\ + getenv_.o signal_.o s_stop.o s_paus.o system_.o cabs.o ctype.o\ - derf_.o derfc_.o erf_.o erfc_.o sig_die.o uninit.o + derf_.o derfc_.o erf_.o erfc_.o sig_die.o uninit.o MAIN.o POW = pow_ci.o pow_dd.o pow_di.o pow_hh.o pow_ii.o pow_ri.o pow_zi.o pow_zz.o CX = c_abs.o c_cos.o c_div.o c_exp.o c_log.o c_sin.o c_sqrt.o DCX = z_abs.o z_cos.o z_div.o z_exp.o z_log.o z_sin.o z_sqrt.o -@@ -82,7 +82,7 @@ - ## of "cc -shared". +@@ -86,7 +86,7 @@ libf2c.a: $(OFILES) + ## arrange for $DYLD_LIBRARY_PATH to include the directory containing libf2c.so. libf2c.so: $(OFILES) -- cc -shared -o libf2c.so $(OFILES) +- $(CC) -shared -o libf2c.so $(OFILES) + $(CC) -shared -Wl,-soname,libf2c.so.%%LIBVER%% -o libf2c.so $(OFILES) ### If your system lacks ranlib, you don't need it; see README. -@@ -110,12 +110,15 @@ +@@ -114,12 +114,15 @@ sysdep1.h: sysdep1.h0 # If your system lacks onexit() and you are not using an # ANSI C compiler, then you should uncomment the following # two lines (for compiling main.o): -#main.o: main.c -# $(CC) -c -DNO_ONEXIT -DSkip_f2c_Undefs main.c +main.o: main.c + $(CC) -c $(CFLAGS) -DNO_ONEXIT -DSkip_f2c_Undefs main.c # On at least some Sun systems, it is more appropriate to # uncomment the following two lines: - #main.o: main.c - # $(CC) -c -Donexit=on_exit -DSkip_f2c_Undefs main.c +-#main.o: main.c +-# $(CC) -c -Donexit=on_exit -DSkip_f2c_Undefs main.c ++main.o: main.c ++ $(CC) -c $(CFLAGS) -Donexit=on_exit -DSkip_f2c_Undefs main.c + +MAIN.o: MAIN.c + $(CC) -c $(CFLAGS) -DSkip_f2c_Undefs MAIN.c install: libf2c.a cp libf2c.a $(LIBDIR)