pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/lang/f2c Bypass the default setting of CPP in OS X and...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ec294f872b93
branches:  trunk
changeset: 568804:ec294f872b93
user:      jmmv <jmmv%pkgsrc.org@localhost>
date:      Sun Dec 20 12:27:57 2009 +0000

description:
Bypass the default setting of CPP in OS X and explicitly use /usr/bin/cpp.
This makes f2c work.  Bump PKGREVISION.

The default CPP points to gcc, which broke f2c because gcc is unable to
preprocess Fortran files as the Fortran compiler is not installed.
Surprisingly, /usr/bin/cpp is just a wrapper around gcc, but it explicitly
passes '-x c' to cpp to force the language to be C and bypass the .F
extension.

diffstat:

 lang/f2c/Makefile |  16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diffs (39 lines):

diff -r 6b7dd2970258 -r ec294f872b93 lang/f2c/Makefile
--- a/lang/f2c/Makefile Sun Dec 20 11:31:58 2009 +0000
+++ b/lang/f2c/Makefile Sun Dec 20 12:27:57 2009 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.50 2009/12/03 12:48:37 asau Exp $
+# $NetBSD: Makefile,v 1.51 2009/12/20 12:27:57 jmmv Exp $
 
 DISTNAME=      f2c-20090411    # see notes below
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    lang
 MASTER_SITES=  ${MASTER_SITE_LOCAL}
 
@@ -20,6 +20,16 @@
 USE_TOOLS+=            yacc
 INSTALLATION_DIRS=     bin share/doc/f2c ${PKGMANDIR}/man1 ${PKGMANDIR}/cat1
 
+.include "../../mk/bsd.prefs.mk"
+
+# XXX(jmmv): This is a very ugly workaround.  CPP should probably default to
+# /usr/bin/cpp in OS X.
+.if ${OPSYS} == "Darwin"
+F2C_F77_CPP=   /usr/bin/cpp
+.else
+F2C_F77_CPP=   ${CPP}
+.endif
+
 post-extract:
        @${CP} ${FILESDIR:Q}/f2c.mk ${WRKSRC}/src/Makefile
        @mv ${WRKSRC}/src/.depend  ${WRKSRC}/src/depend.orig
@@ -28,7 +38,7 @@
 # Handle f2c-f77 script:
 post-build:
        ${SED} -e 's;@PREFIX@;${PREFIX};g' \
-         -e 's;@CC@;${CC};g' -e 's;@CPP@;${CPP};g' \
+         -e 's;@CC@;${CC};g' -e 's;@CPP@;${F2C_F77_CPP};g' \
          -e "s;@SHELL@;${TOOLS_PLATFORM.sh:Q};g" \
         ${FILESDIR}/f2c-f77.in > ${WRKSRC}/f2c-f77
 



Home | Main Index | Thread Index | Old Index