the Fink project is an effort to port
popular Unix programs to Mac OS X
Package: f2c
Version: 20090414
Revision: 2
Description: Convert Fortran 77 source code to C
License: OSI-Approved
Suggests: fort77
Source: mirror:sourceforge:fink/%n-%v.tar.bz2
Source-MD5: 55be2562c57c61cfcd7e7ee46cb56768
#Source: ftp://ftp.netlib.org/f2c.tar.gz
#Source: ftp://ftp.cdc.noaa.gov/Public/jsw/%n-%v.tar.bz2 # outdated, historic
CompileScript: <<
#!/bin/sh -ev
if test -f src/notice ; then /bin/mv src/notice src/Notice ; fi
if test -f src/readme ; then /bin/mv src/readme src/README ; fi
sed 's/CFLAGS = -O/CFLAGS = -O2 -fno-common/; s/ld -r -x/ld -r/' libf2c/makefile.u > libf2c/makefile
sed 's/CFLAGS = -O/CFLAGS = -O2 -fno-common/; s/ld -r -x/ld -r/' src/makefile.u > src/makefile
cd libf2c
make
cd ../src
make
cd ..
mv fc fc.orig
sed 's/CFLAGS="$CFLAGS $O"/CFLAGS="$CFLAGS $O""3"/; s/ -lm//g; s/ -u MAIN__//g; s|/usr/local|%p|g; s/lib\/cpp/usr\/bin\/cpp/g' fc.orig > fc
chmod +x fc
<<
InstallScript: <<
#!/bin/sh -ev
mkdir -p %i/include
cp libf2c/f2c.h %i/include
mkdir -p %i/lib
cp libf2c/libf2c.a %i/lib
ranlib %i/lib/libf2c.a
mkdir -p %i/bin
cp src/f2c %i/bin
cp src/xsum %i/bin
cp fc %i/bin
mkdir -p %i/share/man/man1
cp f2c.1t %i/share/man/man1/f2c.1
<<
DocFiles: <<
f2c.pdf README libf2c/README:README.libf2c src/Notice permission disclaimer
changes 00lastchange fixlog
<<
DescUsage: <<
f2c converts f77 source code to C, which can then be compiled with a C
compiler. The shell script fc does both, conversion to C and compilation.
It acts very much like a 'real' compiler. The fort77 package
provides a perl script with similar, but added, functionality.
To test:
f2c myprog.f
cc -O2 -I $PREFIX/include -L$PREFIX/lib -lf2c -o myprog myprog.c
./myprog
or:
setenv F2CFLAGS {any flags you want fc to pass to f2c here}
fc -O -o myprog myprog.f
./myprog
where $PREFIX is the root of fink's directory hierarchy (/sw by default).
<<
Maintainer: Karl-Michael Schindler
Homepage: http://www.netlib.org/f2c