summaryrefslogtreecommitdiff
path: root/lang/f2c/patches
diff options
context:
space:
mode:
authordmcmahill <dmcmahill@pkgsrc.org>2004-09-15 20:56:31 +0000
committerdmcmahill <dmcmahill@pkgsrc.org>2004-09-15 20:56:31 +0000
commitdb66e6eea23eb0dc67d7904e98e6eaead6a0cd03 (patch)
tree644c54f94fc1c45ec66cfa1ca23d0155afd9f3b5 /lang/f2c/patches
parentc01abd22f6480724039dd0e9480628f880dc7dba (diff)
downloadpkgsrc-db66e6eea23eb0dc67d7904e98e6eaead6a0cd03.tar.gz
- don't hard code the c compiler name.
- automatically figure out MAIN__ vs _MAIN__ - don't clobber the path when running f2c-f77. This lets you have a better chance of finding the c compiler! With all this this package now seems fully functional on solaris-2.9 as well as NetBSD.
Diffstat (limited to 'lang/f2c/patches')
-rw-r--r--lang/f2c/patches/patch-aa12
-rw-r--r--lang/f2c/patches/patch-ac10
-rw-r--r--lang/f2c/patches/patch-ah12
3 files changed, 25 insertions, 9 deletions
diff --git a/lang/f2c/patches/patch-aa b/lang/f2c/patches/patch-aa
index e340d32730c..9050b253b9e 100644
--- a/lang/f2c/patches/patch-aa
+++ b/lang/f2c/patches/patch-aa
@@ -1,8 +1,8 @@
-$NetBSD: patch-aa,v 1.13 2004/09/14 22:09:40 dmcmahill Exp $
+$NetBSD: patch-aa,v 1.14 2004/09/15 20:56:31 dmcmahill Exp $
--- Makefile.orig Tue Sep 14 16:47:52 2004
+++ Makefile
-@@ -0,0 +1,43 @@
+@@ -0,0 +1,47 @@
+# Top level Makefile for f2c, libF77, and libI77
+
+all: f2c libF77/libF77.la libI77/libI77.la f2c-f77 man
@@ -44,5 +44,9 @@ $NetBSD: patch-aa,v 1.13 2004/09/14 22:09:40 dmcmahill Exp $
+ ${BSD_INSTALL_MAN} ./f2c.1 ${PREFIX}/man/man1
+ ${BSD_INSTALL_MAN} ./f2c.0 ${PREFIX}/man/cat1
+
-+f2c-f77: fc
-+ sed 's!@PREFIX@!${PREFIX}!g' fc > f2c-f77
++f2c-f77: fc f2c hello.f
++ ./src/f2c -Aw8 -Nn802 -Nx400 hello.f
++ $(CC) $(CFLAGS) -c hello.c
++ main=`$(NM) hello.o | ${AWK} 'BEGIN{x=""} {gsub(/\|/,""); for(i=1; i<=NF; i=i+1){if($$i ~ /MAIN/){x="-u " $$i}}} END{print x}'` ; \
++ ${ECHO} "Adding $$main to f2c-f77 script" ; \
++ sed -e 's;@PREFIX@;${PREFIX};g' -e 's;@CC@;${CC};g' -e 's;@CPP@;${CPP};g' -e "s;@MAIN@;$$main;g" fc > f2c-f77
diff --git a/lang/f2c/patches/patch-ac b/lang/f2c/patches/patch-ac
index a14586fa262..ffc265108c0 100644
--- a/lang/f2c/patches/patch-ac
+++ b/lang/f2c/patches/patch-ac
@@ -1,4 +1,4 @@
-$NetBSD: patch-ac,v 1.13 2002/01/22 16:47:23 dmcmahill Exp $
+$NetBSD: patch-ac,v 1.14 2004/09/15 20:56:31 dmcmahill Exp $
Much cleanup of the script. Added various options such as
-O for optimization
@@ -31,7 +31,7 @@ Also only pass -m* to the C compiler not f2c.
-PATH=/usr/local/bin:/bin:/usr/bin
-
+#!/bin/sh
-+PATH=/bin:/usr/bin:@PREFIX@/bin
++PATH=$PATH:/bin:/usr/bin:@PREFIX@/bin
+#USAGESTART
# f77-style shell script to compile and load fortran, C, and assembly codes
-
@@ -165,7 +165,7 @@ Also only pass -m* to the C compiler not f2c.
-### about multiple definitions of COMMON blocks.
-#CC=${CC_f2c:-'cc -common'}
-CC=${CC_f2c:-'cc'}
-+CC=${CC_f2c:-'cc '}
++CC=${CC_f2c:-'@CC@ '}
EFL=${EFL:-efl}
EFLFLAGS=${EFLFLAGS:-'system=portable deltastno=10'}
RATFOR=${RATFOR:-ratfor}
@@ -176,7 +176,7 @@ Also only pass -m* to the C compiler not f2c.
+F2C=${F2C:-@PREFIX@/bin/f2c}
+F2CFLAGS=${F2CFLAGS:='-Aw8 -Nn802 -Nx400'}
+S2DBLFLAG="-R"
-+CPP=${CPP:-/usr/bin/cpp}
++CPP=${CPP:-'@CPP@ '}
rc=0
trap "rm -f $s $t; exit \$rc" 0
OUTF=a.out
@@ -447,7 +447,7 @@ Also only pass -m* to the C compiler not f2c.
-### about unnecessary -l options.
+case $cOPT
+in
-+ 2) $CC $CFLAGS -o $OUTF -u _MAIN__ $OFILES $LIBS $FLIBS
++ 2) $CC $CFLAGS -o $OUTF @MAIN@ $OFILES $LIBS $FLIBS
+ ;;
+esac
diff --git a/lang/f2c/patches/patch-ah b/lang/f2c/patches/patch-ah
new file mode 100644
index 00000000000..c14276c6147
--- /dev/null
+++ b/lang/f2c/patches/patch-ah
@@ -0,0 +1,12 @@
+$NetBSD: patch-ah,v 1.5 2004/09/15 20:56:31 dmcmahill Exp $
+
+Used in checks for _MAIN__ vs MAIN__
+
+--- /dev/null Wed Sep 15 12:50:48 2004
++++ hello.f Wed Sep 15 13:48:00 2004
+@@ -0,0 +1,5 @@
++
++ PROGRAM hello
++ print*, 'hello world'
++ END
++