pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/f2c When calling 'cc -c' use a stripped down vers...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/61abb5b2afce
branches:  trunk
changeset: 542073:61abb5b2afce
user:      dmcmahill <dmcmahill%pkgsrc.org@localhost>
date:      Wed Apr 30 21:38:15 2008 +0000

description:
When calling 'cc -c' use a stripped down version of CFLAGS that
removes all -Wl,* entries.  Otherwise some versions of gcc will
give a warning which in turn breaks the autoconf check for fortran
libraries.  This fixes at least cad/tnt-mmtl and probably any
other package that uses the AC_F77_LIBRARY_LDFLAGS autoconf macro.

Bump rev to f2c-20001205nb10.

diffstat:

 lang/f2c/Makefile         |   4 ++--
 lang/f2c/files/f2c-f77.in |  19 +++++++++++++++----
 2 files changed, 17 insertions(+), 6 deletions(-)

diffs (76 lines):

diff -r c2efcf2d65f9 -r 61abb5b2afce lang/f2c/Makefile
--- a/lang/f2c/Makefile Wed Apr 30 21:35:59 2008 +0000
+++ b/lang/f2c/Makefile Wed Apr 30 21:38:15 2008 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.43 2007/12/16 15:47:55 gdt Exp $
+# $NetBSD: Makefile,v 1.44 2008/04/30 21:38:15 dmcmahill Exp $
 
 DISTNAME=      f2c-20001205
-PKGREVISION=   9
+PKGREVISION=   10
 CATEGORIES=    lang
 MASTER_SITES=  ${MASTER_SITE_LOCAL}
 
diff -r c2efcf2d65f9 -r 61abb5b2afce lang/f2c/files/f2c-f77.in
--- a/lang/f2c/files/f2c-f77.in Wed Apr 30 21:35:59 2008 +0000
+++ b/lang/f2c/files/f2c-f77.in Wed Apr 30 21:38:15 2008 +0000
@@ -303,12 +303,23 @@
 
 eval "set -- $ARGS"
 
+# strip off lines which just are for the linker in cases where
+# we are not linkng.  Otherwise we produce gcc warnings
+# like:
+#
+# cc: -R/usr/pkg/lib: linker input file unused because linking not done
+#
+# which messes up the autoconf tests for fortran libraries.
+ 
+CFLAGS_NOLINK=`echo $CFLAGS |  sed -e 's; '\''-Wl,[^ ]*; ;g' -e 's; -Wl,[^ ]*; ;g'`
+
 if test $VERBOSE = "yes"; then
   F2CVER=`$F2C < /dev/null | awk '/.*version/ {print $6" "$7}'`
   echo "f2c-f77:"
   echo "F2C= $F2C, $F2CVER"
   echo "CC= $CC"
   echo "CFLAGS= $CFLAGS"
+  echo "CFLAGS_NOLINK= $CFLAGS_NOLINK"
   echo "CPPFLAGS= $CPPFLAGS"
   echo "FLIBS= $FLIBS"
   echo "LD_RUN_PATH= @PREFIX@/lib"
@@ -343,7 +354,7 @@
                                ;;
                        esac
                case $rc in 0);; *) exit;; esac
-                eval "\$CC -c $CFLAGS \$b.c" 2>$s
+                eval "\$CC -c $CFLAGS_NOLINK \$b.c" 2>$s
                rc=$?
                sed '/parameter .* is not referenced/d;/warning: too many parameters/d' $s 1>&2
                case $rc in 0);; *) exit;; esac
@@ -358,7 +369,7 @@
                case $? in 0);; *) rc=$?; exit;; esac
                eval "\$F2C $F2CFLAGS \$b.f"
                case $? in 0);; *) rc=$?; exit;; esac
-                eval "\$CC -c $CFLAGS \$b.c"
+                eval "\$CC -c $CFLAGS_NOLINK \$b.c"
                case $? in 0);; *) rc=$?; exit;; esac
                OFILES="$OFILES $b.o"
                rm $b.[cf]
@@ -371,7 +382,7 @@
                case $? in 0);; *) rc=$?; exit;; esac
                eval "\$F2C $F2CFLAGS \$b.f"
                case $? in 0);; *) rc=$?; exit;; esac
-               eval "\$CC -c $CFLAGS \$b.c"
+               eval "\$CC -c $CFLAGS_NOLINK \$b.c"
                case $? in 0);; *) rc=$?; exit;; esac
                OFILES="$OFILES $b.o"
                rm $b.[cf]
@@ -390,7 +401,7 @@
        *.c)
                echo $1: 1>&2
                OFILE=`basename $1 .c`.o
-                eval "\$CC -c $CPPFLAGS $CFLAGS \$1"
+                eval "\$CC -c $CPPFLAGS $CFLAGS_NOLINK \$1"
                rc=$?; case $rc in 0);; *) rc=$?; exit;; esac
                OFILES="$OFILES $OFILE"
                case $cOPT in 1) cOPT=2;; esac



Home | Main Index | Thread Index | Old Index