ports/128603: textproc/flex has too small capacity
Olaf Seibert
olafs at cs.ru.nl
Thu Feb 12 14:20:05 UTC 2009
The following reply was made to PR ports/128603; it has been noted by GNATS.
From: Olaf Seibert <olafs at cs.ru.nl>
To: Stefan Walter <stefan at freebsd.org>
Cc: Olaf Seibert <olafs at cs.ru.nl>, GNATS <FreeBSD-gnats-submit at FreeBSD.org>
Subject: Re: ports/128603: textproc/flex has too small capacity
Date: Thu, 12 Feb 2009 15:11:06 +0100
Here is a stab at an optional patch to textproc/flex.
Unfortunately there doesn't seem to be a way in the OPTIONS system to
ask the user for a number.
Therefore I used a mixed approach, where the OPTIONS are used to turn
the patch on and off, and where the user can optionally set
FLEX_NUMBER_OF_NFA_STATES to the desired value (somehow). I found using
/etc/port.conf useful, while putting options in between
".if ${.CURDIR:M*/textproc/flex}" and ".endif" lines.
--- Makefile.orig Thu Feb 12 12:50:30 2009
+++ Makefile Thu Feb 12 15:01:34 2009
@@ -27,9 +27,24 @@
PLIST_FILES= bin/flex include/flex/FlexLexer.h lib/libfl.a lib/libfl_pic.a
PLIST_DIRS= include/flex
-post-patch:
+post-patch::
@${REINPLACE_CMD} -e 's/install-info-recursive//g;s/info-recursive//g' \
-e 's/po //;s/tests//' ${WRKSRC}/Makefile.in
@${REINPLACE_CMD} -e 's/ install-info-am//' ${WRKSRC}/doc/Makefile.in
-.include <bsd.port.mk>
+# Set options (before including bsd.port.pre.mk)
+
+OPTIONS = MORE_NFA_STATES "Increase the number of NFA states" OFF
+
+.include <bsd.port.pre.mk>
+
+.if defined(WITH_MORE_NFA_STATES)
+
+FLEX_NUMBER_OF_NFA_STATES ?= 99999
+
+post-patch::
+ ${REINPLACE_CMD} -e '/define MAXIMUM_MNS /s/[0-9][0-9]*/${FLEX_NUMBER_OF_NFA_STATES}/' ${WRKSRC}/flexdef.h
+
+.endif
+
+.include <bsd.port.post.mk>
-Olaf.
--
More information about the freebsd-ports-bugs
mailing list