View | Details | Raw Unified | Return to bug 101054
Collapse All | Expand All

(-)lang/f2c/Makefile (-16 / +47 lines)
Lines 6-40 Link Here
6
#
6
#
7
7
8
PORTNAME=	f2c
8
PORTNAME=	f2c
9
PORTVERSION=	3.0.0
9
PORTVERSION=	20060506
10
PORTREVISION=	1
11
CATEGORIES=	lang
10
CATEGORIES=	lang
12
MASTER_SITES=	${MASTER_SITE_LOCAL}
11
MASTER_SITES=	ftp://netlib.bell-labs.com/netlib/
13
MASTER_SITE_SUBDIR=	lioux
12
DISTNAME=	${PORTNAME}
14
DISTNAME=	f2c-freebsd.3.0.0
13
EXTRACT_SUFX=	.tar
14
DIST_SUBDIR=	${PORTNAME}-${PORTVERSION}
15
15
16
MAINTAINER=	ports@FreeBSD.org
16
MAINTAINER=	ports@FreeBSD.org
17
COMMENT=	Fortran-to-C converter and its run-time libraries
17
COMMENT=	Fortran-to-C converter and its run-time libraries
18
18
19
.include <bsd.port.pre.mk>
19
EXTRACT_DEPENDS=${UNZIP_CMD}:${PORTSDIR}/archivers/unzip
20
20
21
.if (${ARCH} == "alpha")
21
USE_GMAKE=	yes
22
pre-configure:
22
INSTALLS_SHLIB=	yes
23
	@${CP} ${FILESDIR}/f2c.h.alpha ${WRKSRC}/f2c/f2c.h
24
.endif
25
23
26
ALL_TARGET=	depend all
24
# Set FCNAME to the name of the Fortran 77 / F2C wrapper.
25
FCNAME?=	fc
26
PLIST_SUB=	FCNAME=${FCNAME}
27
27
28
MAN1=		f2c.1
28
MAN1=		f2c.1
29
29
30
PORTDOCS=	00lastchange README README_libf2c changes f2c.pdf permission
31
32
.include <bsd.port.pre.mk>
33
34
post-extract:
35
	cd ${WRKSRC} && ${FIND} . -name "*.gz" | ${XARGS} ${GUNZIP_CMD}
36
	cd ${WRKSRC} && ${UNZIP_CMD} libf2c.zip
37
	${CP} -p ${WRKSRC}/libf2c/README ${WRKSRC}/README_libf2c
38
39
pre-patch:
40
	${CP} -p ${WRKSRC}/libf2c/makefile.u ${WRKSRC}/libf2c/Makefile
41
	${CP} -p ${WRKSRC}/src/makefile.u ${WRKSRC}/src/Makefile
42
43
pre-configure:
44
	${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' ${WRKSRC}/fc
45
46
do-build:
47
	@${ECHO_MSG} "===> Building f2c..."
48
	@(cd ${WRKSRC}/src;	\
49
	${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET})
50
	@${ECHO_MSG} "===> Building libf2c..."
51
	@(cd ${WRKSRC}/libf2c;	\
52
	${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET} libf2c.so)
53
30
do-install:
54
do-install:
31
	${INSTALL_PROGRAM} ${WRKSRC}/f2c/f2c ${PREFIX}/bin
55
	${INSTALL_PROGRAM} ${WRKSRC}/src/f2c ${PREFIX}/bin
32
	${INSTALL_DATA} ${WRKSRC}/f2c/f2c.h ${PREFIX}/include
56
	${INSTALL_SCRIPT} ${WRKSRC}/fc ${PREFIX}/bin/${FCNAME}
33
	${INSTALL_MAN} ${WRKSRC}/f2c/f2c.1 ${PREFIX}/man/man1
57
	${INSTALL_DATA} ${WRKSRC}/src/f2c.h ${PREFIX}/include
34
	${INSTALL_DATA} ${WRKSRC}/libf2c/libf2c.* ${PREFIX}/lib
58
	${INSTALL_MAN} ${WRKSRC}/src/f2c.1 ${MAN1PREFIX}/man/man1
59
	${MV} ${WRKSRC}/libf2c/libf2c.so ${WRKSRC}/libf2c/libf2c.so.2
60
	${INSTALL_DATA} ${WRKSRC}/libf2c/libf2c.a ${PREFIX}/lib
61
	${INSTALL_DATA} ${WRKSRC}/libf2c/libf2c.so.2 ${PREFIX}/lib
35
	${LN} -sf libf2c.so.2 ${PREFIX}/lib/libf2c.so
62
	${LN} -sf libf2c.so.2 ${PREFIX}/lib/libf2c.so
36
63
37
post-install:
64
post-install:
38
	${LDCONFIG} -m ${PREFIX}/lib
65
.if !defined(NOPORTDOCS)
66
	${MKDIR} ${DOCSDIR}
67
	${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${DOCSDIR}
68
	@${ECHO_MSG} "===> Documentation installed in ${DOCSDIR}."
69
.endif
39
70
40
.include <bsd.port.post.mk>
71
.include <bsd.port.post.mk>
(-)lang/f2c/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
MD5 (f2c-freebsd.3.0.0.tar.gz) = e69b37fd3801faa82e5112806358b246
1
MD5 (f2c-20060506/f2c.tar) = cd0d08d082a41235b17fbdb708acbe64
2
SHA256 (f2c-freebsd.3.0.0.tar.gz) = 40fabd560f4984e82c30d08e9addf1c76afb5954cac6954c3f51faccbe80f8ec
2
SHA256 (f2c-20060506/f2c.tar) = f4d4882436e51f6ad14bdeb215435ddccccab74ea41a41a8c6e197bbf5ce2ba1
3
SIZE (f2c-freebsd.3.0.0.tar.gz) = 266829
3
SIZE (f2c-20060506/f2c.tar) = 1200128
(-)lang/f2c/files/f2c.h.alpha (-223 lines)
Lines 1-223 Link Here
1
/* f2c.h  --  Standard Fortran to C header file */
2
3
/**  barf  [ba:rf]  2.  "He suggested using FORTRAN, and everybody barfed."
4
5
	- From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */
6
7
#ifndef F2C_INCLUDE
8
#define F2C_INCLUDE
9
10
typedef int integer;
11
typedef unsigned int uinteger;
12
typedef char *address;
13
typedef short int shortint;
14
typedef float real;
15
typedef double doublereal;
16
typedef struct { real r, i; } complex;
17
typedef struct { doublereal r, i; } doublecomplex;
18
typedef int logical;
19
typedef short int shortlogical;
20
typedef char logical1;
21
typedef char integer1;
22
#if 0	/* Adjust for integer*8. */
23
typedef long long longint;		/* system-dependent */
24
typedef unsigned long long ulongint;	/* system-dependent */
25
#define qbit_clear(a,b)	((a) & ~((ulongint)1 << (b)))
26
#define qbit_set(a,b)	((a) |  ((ulongint)1 << (b)))
27
#endif
28
29
#define TRUE_ (1)
30
#define FALSE_ (0)
31
32
/* Extern is for use with -E */
33
#ifndef Extern
34
#define Extern extern
35
#endif
36
37
/* I/O stuff */
38
39
#ifdef f2c_i2
40
/* for -i2 */
41
typedef short flag;
42
typedef short ftnlen;
43
typedef short ftnint;
44
#else
45
typedef int flag;
46
typedef int ftnlen;
47
typedef int ftnint;
48
#endif
49
50
/*external read, write*/
51
typedef struct
52
{	flag cierr;
53
	ftnint ciunit;
54
	flag ciend;
55
	char *cifmt;
56
	ftnint cirec;
57
} cilist;
58
59
/*internal read, write*/
60
typedef struct
61
{	flag icierr;
62
	char *iciunit;
63
	flag iciend;
64
	char *icifmt;
65
	ftnint icirlen;
66
	ftnint icirnum;
67
} icilist;
68
69
/*open*/
70
typedef struct
71
{	flag oerr;
72
	ftnint ounit;
73
	char *ofnm;
74
	ftnlen ofnmlen;
75
	char *osta;
76
	char *oacc;
77
	char *ofm;
78
	ftnint orl;
79
	char *oblnk;
80
} olist;
81
82
/*close*/
83
typedef struct
84
{	flag cerr;
85
	ftnint cunit;
86
	char *csta;
87
} cllist;
88
89
/*rewind, backspace, endfile*/
90
typedef struct
91
{	flag aerr;
92
	ftnint aunit;
93
} alist;
94
95
/* inquire */
96
typedef struct
97
{	flag inerr;
98
	ftnint inunit;
99
	char *infile;
100
	ftnlen infilen;
101
	ftnint	*inex;	/*parameters in standard's order*/
102
	ftnint	*inopen;
103
	ftnint	*innum;
104
	ftnint	*innamed;
105
	char	*inname;
106
	ftnlen	innamlen;
107
	char	*inacc;
108
	ftnlen	inacclen;
109
	char	*inseq;
110
	ftnlen	inseqlen;
111
	char 	*indir;
112
	ftnlen	indirlen;
113
	char	*infmt;
114
	ftnlen	infmtlen;
115
	char	*inform;
116
	ftnint	informlen;
117
	char	*inunf;
118
	ftnlen	inunflen;
119
	ftnint	*inrecl;
120
	ftnint	*innrec;
121
	char	*inblank;
122
	ftnlen	inblanklen;
123
} inlist;
124
125
#define VOID void
126
127
union Multitype {	/* for multiple entry points */
128
	integer1 g;
129
	shortint h;
130
	integer i;
131
	/* longint j; */
132
	real r;
133
	doublereal d;
134
	complex c;
135
	doublecomplex z;
136
	};
137
138
typedef union Multitype Multitype;
139
140
/*typedef long int Long;*/	/* No longer used; formerly in Namelist */
141
142
struct Vardesc {	/* for Namelist */
143
	char *name;
144
	char *addr;
145
	ftnlen *dims;
146
	int  type;
147
	};
148
typedef struct Vardesc Vardesc;
149
150
struct Namelist {
151
	char *name;
152
	Vardesc **vars;
153
	int nvars;
154
	};
155
typedef struct Namelist Namelist;
156
157
#define abs(x) ((x) >= 0 ? (x) : -(x))
158
#define dabs(x) (doublereal)abs(x)
159
#define min(a,b) ((a) <= (b) ? (a) : (b))
160
#define max(a,b) ((a) >= (b) ? (a) : (b))
161
#define dmin(a,b) (doublereal)min(a,b)
162
#define dmax(a,b) (doublereal)max(a,b)
163
#define bit_test(a,b)	((a) >> (b) & 1)
164
#define bit_clear(a,b)	((a) & ~((uinteger)1 << (b)))
165
#define bit_set(a,b)	((a) |  ((uinteger)1 << (b)))
166
167
/* procedure parameter types for -A and -C++ */
168
169
#define F2C_proc_par_types 1
170
#ifdef __cplusplus
171
typedef int /* Unknown procedure type */ (*U_fp)(...);
172
typedef shortint (*J_fp)(...);
173
typedef integer (*I_fp)(...);
174
typedef real (*R_fp)(...);
175
typedef doublereal (*D_fp)(...), (*E_fp)(...);
176
typedef /* Complex */ VOID (*C_fp)(...);
177
typedef /* Double Complex */ VOID (*Z_fp)(...);
178
typedef logical (*L_fp)(...);
179
typedef shortlogical (*K_fp)(...);
180
typedef /* Character */ VOID (*H_fp)(...);
181
typedef /* Subroutine */ int (*S_fp)(...);
182
#else
183
typedef int /* Unknown procedure type */ (*U_fp)();
184
typedef shortint (*J_fp)();
185
typedef integer (*I_fp)();
186
typedef real (*R_fp)();
187
typedef doublereal (*D_fp)(), (*E_fp)();
188
typedef /* Complex */ VOID (*C_fp)();
189
typedef /* Double Complex */ VOID (*Z_fp)();
190
typedef logical (*L_fp)();
191
typedef shortlogical (*K_fp)();
192
typedef /* Character */ VOID (*H_fp)();
193
typedef /* Subroutine */ int (*S_fp)();
194
#endif
195
/* E_fp is for real functions when -R is not specified */
196
typedef VOID C_f;	/* complex function */
197
typedef VOID H_f;	/* character function */
198
typedef VOID Z_f;	/* double complex function */
199
typedef doublereal E_f;	/* real function with -R not specified */
200
201
/* undef any lower-case symbols that your C compiler predefines, e.g.: */
202
203
#ifndef Skip_f2c_Undefs
204
#undef cray
205
#undef gcos
206
#undef mc68010
207
#undef mc68020
208
#undef mips
209
#undef pdp11
210
#undef sgi
211
#undef sparc
212
#undef sun
213
#undef sun2
214
#undef sun3
215
#undef sun4
216
#undef u370
217
#undef u3b
218
#undef u3b2
219
#undef u3b5
220
#undef unix
221
#undef vax
222
#endif
223
#endif
(-)lang/f2c/files/patch-f2c_f2c.h (-44 lines)
Lines 1-44 Link Here
1
--- f2c/f2c.h.orig	Mon Jan  1 12:03:53 2001
2
+++ f2c/f2c.h	Tue Oct  4 19:30:53 2005
3
@@ -6,22 +6,23 @@
4
 
5
 #ifndef F2C_INCLUDE
6
 #define F2C_INCLUDE
7
+#include <sys/types.h>
8
 
9
-typedef long int integer;
10
-typedef unsigned long int uinteger;
11
+typedef int32_t integer;
12
+typedef uint32_t uinteger;
13
 typedef char *address;
14
 typedef short int shortint;
15
 typedef float real;
16
 typedef double doublereal;
17
 typedef struct { real r, i; } complex;
18
 typedef struct { doublereal r, i; } doublecomplex;
19
-typedef long int logical;
20
+typedef int32_t logical;
21
 typedef short int shortlogical;
22
 typedef char logical1;
23
 typedef char integer1;
24
 #ifdef INTEGER_STAR_8	/* Adjust for integer*8. */
25
-typedef long long longint;		/* system-dependent */
26
-typedef unsigned long long ulongint;	/* system-dependent */
27
+typedef int64_t longint;               /* system-dependent */
28
+typedef uint64_t ulongint;     /* system-dependent */
29
 #define qbit_clear(a,b)	((a) & ~((ulongint)1 << (b)))
30
 #define qbit_set(a,b)	((a) |  ((ulongint)1 << (b)))
31
 #endif
32
@@ -42,9 +43,9 @@
33
 typedef short ftnlen;
34
 typedef short ftnint;
35
 #else
36
-typedef long int flag;
37
-typedef long int ftnlen;
38
-typedef long int ftnint;
39
+typedef int32_t flag;
40
+typedef int32_t ftnlen;
41
+typedef int32_t ftnint;
42
 #endif
43
 
44
 /*external read, write*/
(-)lang/f2c/files/patch-libf2c_MAIN.c (+21 lines)
Line 0 Link Here
1
--- libf2c/MAIN.c.orig	Sun Jul 30 15:06:49 2006
2
+++ libf2c/MAIN.c	Sun Jul 30 15:12:02 2006
3
@@ -0,0 +1,18 @@
4
+/* $FreeBSD$
5
+   Add a pseudo entry point for cases where the main FOTRAN program is missing
6
+   e.g. ports/cad/tochnog.
7
+
8
+   Credit: adapted from Sergio Gelato <gelato (at) sissa.it> on Usenet.
9
+*/
10
+
11
+#include <stdio.h>
12
+#include <stdlib.h>
13
+#include <sys/cdefs.h>
14
+
15
+__weak_reference(missing_MAIN__,MAIN__);
16
+
17
+void missing_MAIN__ (void)
18
+{
19
+    fprintf(stderr, "The Fortran main program is missing.\n");
20
+    abort();
21
+}
(-)lang/f2c/files/patch-libf2c_Makefile (+50 lines)
Line 0 Link Here
1
--- libf2c/Makefile.orig	Fri Jun  6 15:09:42 2003
2
+++ libf2c/Makefile	Sun Jul 30 11:48:17 2006
3
@@ -13,9 +13,9 @@
4
 # to the CFLAGS = line below.
5
 
6
 .SUFFIXES: .c .o
7
-CC = cc
8
+#CC = cc
9
 SHELL = /bin/sh
10
-CFLAGS = -O
11
+CFLAGS += -fPIC
12
 
13
 # compile, then strip unnecessary symbols
14
 .c.o:
15
@@ -29,7 +29,7 @@
16
 
17
 MISC =	f77vers.o i77vers.o main.o s_rnge.o abort_.o exit_.o getarg_.o iargc_.o\
18
 	getenv_.o signal_.o s_stop.o s_paus.o system_.o cabs.o\
19
-	derf_.o derfc_.o erf_.o erfc_.o sig_die.o uninit.o
20
+	derf_.o derfc_.o erf_.o erfc_.o sig_die.o uninit.o MAIN.o
21
 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
22
 CX =	c_abs.o c_cos.o c_div.o c_exp.o c_log.o c_sin.o c_sqrt.o
23
 DCX =	z_abs.o z_cos.o z_div.o z_exp.o z_log.o z_sin.o z_sqrt.o
24
@@ -82,7 +82,7 @@
25
 ## of "cc -shared".
26
 
27
 libf2c.so: $(OFILES)
28
-	cc -shared -o libf2c.so $(OFILES)
29
+	$(CC) -shared -o libf2c.so $(OFILES)
30
 
31
 ### If your system lacks ranlib, you don't need it; see README.
32
 
33
@@ -110,12 +110,15 @@
34
 # If your system lacks onexit() and you are not using an
35
 # ANSI C compiler, then you should uncomment the following
36
 # two lines (for compiling main.o):
37
-#main.o: main.c
38
-#	$(CC) -c -DNO_ONEXIT -DSkip_f2c_Undefs main.c
39
+main.o: main.c
40
+	$(CC) -c $(CFLAGS) -DNO_ONEXIT -DSkip_f2c_Undefs main.c
41
 # On at least some Sun systems, it is more appropriate to
42
 # uncomment the following two lines:
43
 #main.o: main.c
44
 #	$(CC) -c -Donexit=on_exit -DSkip_f2c_Undefs main.c
45
+
46
+MAIN.o: MAIN.c
47
+	$(CC) -c $(CFLAGS) -DSkip_f2c_Undefs MAIN.c
48
 
49
 install: libf2c.a
50
 	cp libf2c.a $(LIBDIR)
(-)lang/f2c/files/patch-src_Makefile (+13 lines)
Line 0 Link Here
1
--- ./src/Makefile.orig	Sat Mar  5 02:24:21 2005
2
+++ ./src/Makefile	Thu Jul 27 22:50:42 2006
3
@@ -1,8 +1,8 @@
4
 #	Makefile for f2c, a Fortran 77 to C converter
5
 
6
 .SUFFIXES: .c .o
7
-CC = cc
8
-CFLAGS = -O
9
+#CC = cc
10
+#CFLAGS = -O
11
 SHELL = /bin/sh
12
 YACC = yacc
13
 YFLAGS =
(-)lang/f2c/pkg-descr (-2 / +1 lines)
Lines 1-7 Link Here
1
f2c and its run-time library, libf2c.a, are a port of the
1
f2c and its run-time library, libf2c.a, are a port of the
2
Fortran-to-C converter available from ftp.netlib.org.  This
2
Fortran-to-C converter available from ftp.netlib.org.  This
3
software was originally developed by AT&T, Lucent Technologies,
3
software was originally developed by AT&T, Lucent Technologies,
4
and Bellcore.  The port contains some enhancements for FreeBSD.
4
and Bellcore.
5
5
6
WWW: http://www.netlib.org/
6
WWW: http://www.netlib.org/
7
FTP: ftp://ftp.netlib.org/
(-)lang/f2c/pkg-plist (-2 / +2 lines)
Lines 1-6 Link Here
1
bin/f2c
1
bin/f2c
2
bin/%%FCNAME%%
2
include/f2c.h
3
include/f2c.h
3
lib/libf2c.a
4
lib/libf2c.a
4
lib/libf2c.so.2
5
lib/libf2c.so
5
lib/libf2c.so
6
@exec /sbin/ldconfig -m %D/lib
6
lib/libf2c.so.2

Return to bug 101054