summaryrefslogtreecommitdiff
path: root/flex
diff options
context:
space:
mode:
authorJohannes Winkelmann <jw@smts.ch>2006-02-23 15:26:10 +0000
committerJohannes Winkelmann <jw@smts.ch>2006-02-23 15:26:10 +0000
commite3afe2298e821d7f5860128720e665d8fb3bd641 (patch)
treebfb499432688352b1140b13ad8252c8e4e739006 /flex
downloadcore-e3afe2298e821d7f5860128720e665d8fb3bd641.tar.gz
core-e3afe2298e821d7f5860128720e665d8fb3bd641.tar.xz
create branch for 2.2
Diffstat (limited to 'flex')
-rw-r--r--flex/.footprint12
-rw-r--r--flex/.md5sum2
-rw-r--r--flex/Pkgfile21
-rw-r--r--flex/flex-2.5.31.patch253
4 files changed, 288 insertions, 0 deletions
diff --git a/flex/.footprint b/flex/.footprint
new file mode 100644
index 00000000..cd4bef79
--- /dev/null
+++ b/flex/.footprint
@@ -0,0 +1,12 @@
+drwxr-xr-x root/root usr/
+drwxr-xr-x root/root usr/bin/
+-rwxr-xr-x root/root usr/bin/flex
+lrwxrwxrwx root/root usr/bin/lex -> flex
+drwxr-xr-x root/root usr/include/
+-rw-r--r-- root/root usr/include/FlexLexer.h
+drwxr-xr-x root/root usr/lib/
+-rw-r--r-- root/root usr/lib/libfl.a
+drwxr-xr-x root/root usr/man/
+drwxr-xr-x root/root usr/man/man1/
+-rw-r--r-- root/root usr/man/man1/flex.1.gz
+lrwxrwxrwx root/root usr/man/man1/lex.1.gz -> flex.1.gz
diff --git a/flex/.md5sum b/flex/.md5sum
new file mode 100644
index 00000000..7a306a74
--- /dev/null
+++ b/flex/.md5sum
@@ -0,0 +1,2 @@
+ad1a7cf56f7a6ee3a8a2f5cbc485fd00 flex-2.5.31.patch
+363dcc4afc917dc51306eb9d3de0152f flex-2.5.31.tar.bz2
diff --git a/flex/Pkgfile b/flex/Pkgfile
new file mode 100644
index 00000000..f723dd32
--- /dev/null
+++ b/flex/Pkgfile
@@ -0,0 +1,21 @@
+# Description: Fast Lexical Analyzer Generator
+# URL: http://lex.sourceforge.net/
+# Maintainer: Per Lidén <per@fukt.bth.se>
+
+name=flex
+version=2.5.31
+release=2
+source=(http://dl.sourceforge.net/lex/$name-$version.tar.bz2 \
+ $name-$version.patch)
+
+build() {
+ cd $name-$version
+ patch -p1 < ../$name-$version.patch
+ ./configure --prefix=/usr --disable-nls
+ touch doc/flex.1 scan.c
+ make
+ make DESTDIR=$PKG install
+ ln -sf flex $PKG/usr/bin/lex
+ ln -sf flex.1.gz $PKG/usr/man/man1/lex.1.gz
+ rm -rf $PKG/usr/info
+}
diff --git a/flex/flex-2.5.31.patch b/flex/flex-2.5.31.patch
new file mode 100644
index 00000000..0a013bb2
--- /dev/null
+++ b/flex/flex-2.5.31.patch
@@ -0,0 +1,253 @@
+diff -Naur flex-2.5.31.orig/filter.c flex-2.5.31/filter.c
+--- flex-2.5.31.orig/filter.c 2003-03-25 11:39:08.000000000 -0500
++++ flex-2.5.31/filter.c 2004-03-01 23:14:28.868777672 -0500
+@@ -157,11 +157,15 @@
+ if (chain->filter_func) {
+ int r;
+
+- /* setup streams again */
++ /* setup streams again -- Removed. POSIX states that children inherit
++ open streams in the parent. Also, ANSI C99 states that the stdin
++ and stdout macors need not be modified lvalues; so this code is
++ broken in the first place.
+ if ((stdin = fdopen (0, "r")) == NULL)
+ flexfatal (_("fdopen(0) failed"));
+ if ((stdout = fdopen (1, "w")) == NULL)
+ flexfatal (_("fdopen(1) failed"));
++ */
+
+ if ((r = chain->filter_func (chain)) == -1)
+ flexfatal (_("filter_func failed"));
+@@ -181,9 +185,11 @@
+ if (dup2 (pipes[1], 1) == -1)
+ flexfatal (_("dup2(pipes[1],1)"));
+ close (pipes[1]);
++ /* This is not legal; stfout does not need to be a modifiable
++ lvalue
+ if ((stdout = fdopen (1, "w")) == NULL)
+ flexfatal (_("fdopen(1) failed"));
+-
++ */
+ return true;
+ }
+
+diff -Naur flex-2.5.31.orig/flex.skl flex-2.5.31/flex.skl
+--- flex-2.5.31.orig/flex.skl 2003-03-31 20:51:38.000000000 -0500
++++ flex-2.5.31/flex.skl 2004-03-01 23:14:28.870777368 -0500
+@@ -27,6 +27,11 @@
+ %# Macros for runtime processing stage.
+ m4_changecom
+ m4_changequote
++
++%# Let user use our quoting strings
++m4_changequote({, })
++m4_define( {m4_userquote_start}, {m4_changequote(<, >)[[m4_changequote([[, ]])})
++m4_define( {m4_userquote_end}, {m4_changequote(<, >)]]m4_changequote([[, ]])})
+ m4_changequote([[, ]])
+
+ %#
+@@ -345,19 +350,19 @@
+ %# yyscan_t yyscanner;
+ %#
+ %# Generate traditional function defs
+- m4_define( [[YYFARGS0]], [[(M4_YY_DEF_ONLY_ARG)
++ m4_define( [[YYFARGS0]], [[(M4_YY_DEF_ONLY_ARG) [[\]]
+ M4_YY_DECL_LAST_ARG]])
+- m4_define( [[YYFARGS1]], [[($2 M4_YY_DEF_LAST_ARG)
+- $1 $2;
++ m4_define( [[YYFARGS1]], [[($2 M4_YY_DEF_LAST_ARG) [[\]]
++ $1 $2; [[\]]
+ M4_YY_DECL_LAST_ARG]])
+- m4_define( [[YYFARGS2]], [[($2,$4 M4_YY_DEF_LAST_ARG)
+- $1 $2;
+- $3 $4;
++ m4_define( [[YYFARGS2]], [[($2,$4 M4_YY_DEF_LAST_ARG) [[\]]
++ $1 $2; [[\]]
++ $3 $4; [[\]]
+ M4_YY_DECL_LAST_ARG]])
+- m4_define( [[YYFARGS3]], [[($2,$4,$6 M4_YY_DEF_LAST_ARG)
+- $1 $2;
+- $3 $4;
+- $5 $6;
++ m4_define( [[YYFARGS3]], [[($2,$4,$6 M4_YY_DEF_LAST_ARG) [[\]]
++ $1 $2; [[\]]
++ $3 $4; [[\]]
++ $5 $6; [[\]]
+ M4_YY_DECL_LAST_ARG]])
+ ]],
+ [[
+@@ -724,6 +729,7 @@
+
+ m4_ifdef( [[M4_YY_NO_UNISTD_H]],,
+ [[
++#ifndef YY_NO_UNISTD_H
+ /* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+@@ -734,6 +740,7 @@
+ %if-c++-only
+ #include <unistd.h>
+ %endif
++#endif
+ ]])
+
+ #ifndef YY_EXTRA_TYPE
+@@ -1124,9 +1131,9 @@
+ m4_dnl The bison pure parser is used. Redefine yylex to
+ m4_dnl accept the lval parameter.
+
+- m4_define( [[M4_YY_LEX_PROTO]],
++ m4_define( [[M4_YY_LEX_PROTO]], [[\]]
+ [[M4_YY_PARAMS(YYSTYPE * yylval_param M4_YY_PROTO_LAST_ARG)]])
+- m4_define( [[M4_YY_LEX_DECLARATION]],
++ m4_define( [[M4_YY_LEX_DECLARATION]], [[\]]
+ [[YYFARGS1(YYSTYPE *,yylval_param)]])
+ ]])
+
+@@ -1134,9 +1141,9 @@
+ [[
+ m4_dnl Locations are used. yylex should also accept the ylloc parameter.
+
+- m4_define( [[M4_YY_LEX_PROTO]],
++ m4_define( [[M4_YY_LEX_PROTO]], [[\]]
+ [[M4_YY_PARAMS(YYSTYPE * yylval_param, YYLTYPE * yylloc_param M4_YY_PROTO_LAST_ARG)]])
+- m4_define( [[M4_YY_LEX_DECLARATION]],
++ m4_define( [[M4_YY_LEX_DECLARATION]], [[\]]
+ [[YYFARGS2(YYSTYPE *,yylval_param, YYLTYPE *,yylloc_param)]])
+ ]])
+
+@@ -2251,11 +2258,11 @@
+ * @note If you want to scan bytes that may contain NUL values, then use
+ * yy_scan_bytes() instead.
+ */
+-YY_BUFFER_STATE yy_scan_string YYFARGS1( yyconst char *,str)
++YY_BUFFER_STATE yy_scan_string YYFARGS1( yyconst char *,yy_str)
+ {
+ m4_dnl M4_YY_DECL_GUTS_VAR();
+
+- return yy_scan_bytes( str, strlen(str) M4_YY_CALL_LAST_ARG);
++ return yy_scan_bytes( yy_str, strlen(yy_str) M4_YY_CALL_LAST_ARG);
+ }
+ %endif
+ ]])
+diff -Naur flex-2.5.31.orig/gen.c flex-2.5.31/gen.c
+--- flex-2.5.31.orig/gen.c 2003-03-30 14:58:44.000000000 -0500
++++ flex-2.5.31/gen.c 2004-03-01 23:14:28.862778584 -0500
+@@ -1812,7 +1812,6 @@
+ if (yytext_is_array) {
+ if (!reentrant){
+ indent_puts ("static int yy_more_offset = 0;");
+- }else{
+ indent_puts ("static int yy_prev_more_offset = 0;");
+ }
+ }
+diff -Naur flex-2.5.31.orig/main.c flex-2.5.31/main.c
+--- flex-2.5.31.orig/main.c 2003-03-31 20:51:38.000000000 -0500
++++ flex-2.5.31/main.c 2004-03-01 23:14:28.863778432 -0500
+@@ -199,6 +199,7 @@
+ {
+ #if ENABLE_NLS
+ setlocale (LC_MESSAGES, "");
++ setlocale (LC_CTYPE, "");
+ textdomain (PACKAGE);
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ #endif
+@@ -1595,7 +1596,6 @@
+ outn ("#else");
+ outn (yy_stdinit);
+ outn ("#endif");
+- outn ("#endif");
+ }
+
+ else {
+diff -Naur flex-2.5.31.orig/scan.c flex-2.5.31/scan.c
+--- flex-2.5.31.orig/scan.c 2003-04-01 11:33:17.000000000 -0500
++++ flex-2.5.31/scan.c 2004-03-01 23:14:28.860778888 -0500
+@@ -1619,11 +1619,13 @@
+ #define LINEDIR 18
+ #define CODEBLOCK_MATCH_BRACE 19
+
++#ifndef YY_NO_UNISTD_H
+ /* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+ #include <unistd.h>
++#endif
+
+ #ifndef YY_EXTRA_TYPE
+ #define YY_EXTRA_TYPE void *
+diff -Naur flex-2.5.31.orig/scan.l flex-2.5.31/scan.l
+--- flex-2.5.31.orig/scan.l 2003-03-31 20:51:38.000000000 -0500
++++ flex-2.5.31/scan.l 2004-03-01 23:14:28.864778280 -0500
+@@ -194,8 +194,14 @@
+ <COMMENT>{
+ "*/" ACTION_ECHO; yy_pop_state();
+ "*" ACTION_ECHO;
+- [^*\n]+ ACTION_ECHO;
+- [^*\n]*{NL} ++linenum; ACTION_ECHO;
++ [\[\]] ACTION_ECHO;
++ [^*\[\]\n]+ ACTION_ECHO;
++ [^*\[\]\n]*{NL} ++linenum; ACTION_ECHO;
++ \[\[ add_action("[" "[]" "]m4_" "userquote_start()");
++ \]\] add_action("[" "[]" "]m4_" "userquote_end()");
++ /* Macros need to be clearly separated from surrounding
++ * text and this file needs to go through flex untouched.
++ */
+ }
+
+ <LINEDIR>{
+diff -Naur flex-2.5.31.orig/skel.c flex-2.5.31/skel.c
+--- flex-2.5.31.orig/skel.c 2003-04-01 11:33:08.000000000 -0500
++++ flex-2.5.31/skel.c 2004-03-01 23:14:28.867777824 -0500
+@@ -404,16 +404,16 @@
+ "%# yyscan_t yyscanner;",
+ "%#",
+ "%# Generate traditional function defs",
+- " m4_define( [[YYFARGS0]], [[(M4_YY_DEF_ONLY_ARG)",
++ " m4_define( [[YYFARGS0]], [[(M4_YY_DEF_ONLY_ARG) [[\\]]",
+ " M4_YY_DECL_LAST_ARG]])",
+- " m4_define( [[YYFARGS1]], [[($2 M4_YY_DEF_LAST_ARG)",
++ " m4_define( [[YYFARGS1]], [[($2 M4_YY_DEF_LAST_ARG) [[\\]]",
+ " $1 $2;",
+ " M4_YY_DECL_LAST_ARG]])",
+- " m4_define( [[YYFARGS2]], [[($2,$4 M4_YY_DEF_LAST_ARG)",
++ " m4_define( [[YYFARGS2]], [[($2,$4 M4_YY_DEF_LAST_ARG) [[\\]]",
+ " $1 $2;",
+ " $3 $4;",
+ " M4_YY_DECL_LAST_ARG]])",
+- " m4_define( [[YYFARGS3]], [[($2,$4,$6 M4_YY_DEF_LAST_ARG)",
++ " m4_define( [[YYFARGS3]], [[($2,$4,$6 M4_YY_DEF_LAST_ARG) [[\\]]",
+ " $1 $2;",
+ " $3 $4;",
+ " $5 $6;",
+@@ -783,6 +783,7 @@
+ "",
+ "m4_ifdef( [[M4_YY_NO_UNISTD_H]],,",
+ "[[",
++ "#ifndef YY_NO_UNISTD_H",
+ "/* Special case for \"unistd.h\", since it is non-ANSI. We include it way",
+ " * down here because we want the user's section 1 to have been scanned first.",
+ " * The user has a chance to override it with an option.",
+@@ -793,6 +794,7 @@
+ "%if-c++-only",
+ "#include <unistd.h>",
+ "%endif",
++ "#endif",
+ "]])",
+ "",
+ "#ifndef YY_EXTRA_TYPE",
+@@ -2454,11 +2456,11 @@
+ " * @note If you want to scan bytes that may contain NUL values, then use",
+ " * yy_scan_bytes() instead.",
+ " */",
+- "YY_BUFFER_STATE yy_scan_string YYFARGS1( yyconst char *,str)",
++ "YY_BUFFER_STATE yy_scan_string YYFARGS1( yyconst char *,yy_str)",
+ "{",
+ " m4_dnl M4_YY_DECL_GUTS_VAR();",
+ "",
+- " return yy_scan_bytes( str, strlen(str) M4_YY_CALL_LAST_ARG);",
++ " return yy_scan_bytes( yy_str, strlen(yy_str) M4_YY_CALL_LAST_ARG);",
+ "}",
+ "%endif",
+ "]])",

Generated by cgit