Pregenerate the parser (gram.c) and disable implicit regeneration.

Drop yacc(1) dependency.
This solves the circular dependency f2c->bison->libiconv->libtool-base->f2c
This commit is contained in:
tnn 2010-01-03 01:37:59 +00:00
parent 447f8b9908
commit ab06a972d6
3 changed files with 2776 additions and 4 deletions

View file

@ -1,7 +1,7 @@
# $NetBSD: Makefile,v 1.52 2009/12/28 11:42:19 tnn Exp $
# $NetBSD: Makefile,v 1.53 2010/01/03 01:37:59 tnn Exp $
DISTNAME= f2c-20090411 # see notes below
PKGREVISION= 3
PKGREVISION= 4
CATEGORIES= lang
MASTER_SITES= ${MASTER_SITE_LOCAL}
@ -18,7 +18,6 @@ WRKSRC= ${WRKDIR}/f2c
BUILD_DIRS= src
USE_BSD_MAKEFILE= yes
MAKE_ENV+= MKCATPAGES=no
USE_TOOLS+= yacc
INSTALLATION_DIRS= bin share/doc/f2c ${PKGMANDIR}/man1
.include "../../mk/bsd.prefs.mk"
@ -33,6 +32,7 @@ F2C_F77_CPP= ${CPP}
post-extract:
@${CP} ${FILESDIR:Q}/f2c.mk ${WRKSRC}/src/Makefile
@${CP} ${FILESDIR:Q}/gram.c ${WRKSRC}/src/gram.c
@mv ${WRKSRC}/src/.depend ${WRKSRC}/src/depend.orig
@mv ${WRKSRC}/src/f2c.1 ${WRKSRC}/src/f2c.1.orig

View file

@ -1,7 +1,7 @@
# Makefile for f2c, a Fortran 77 to C converter
PROG= f2c
SRCS= main.c init.c gram.y lex.c proc.c equiv.c data.c format.c \
SRCS= main.c init.c gram.c lex.c proc.c equiv.c data.c format.c \
expr.c exec.c intr.c io.c misc.c error.c mem.c names.c \
output.c p1output.c pread.c put.c putpcc.c vax.c formatdata.c \
parse_args.c niceprintf.c cds.c sysdep.c version.c $(MALLOC)
@ -21,6 +21,7 @@ MALLOC= # empty
# (derived with a Unix variant of the yacc from plan9).
# There should be 4 shift/reduce conflicts:
.if make(gram.c)
gram.y: gram.head gram.dcl gram.expr gram.exec gram.io tokdefs.h
( sed "s/#define/%token/" < $(.ALLSRC:M*tokdefs.h) ; \
cat $(.ALLSRC:M*gram.head) \
@ -29,6 +30,9 @@ gram.y: gram.head gram.dcl gram.expr gram.exec gram.io tokdefs.h
$(.ALLSRC:M*gram.exec) \
$(.ALLSRC:M*gram.io) ) > $@
CLEANFILES+= gram.y
.else
gram.c:
.endif
DPADD= defs.h ftypes.h defines.h machdefs.h sysdep.h

2768
lang/f2c/files/gram.c Normal file

File diff suppressed because it is too large Load diff