SHA256
1
0
forked from pool/flex

Accepting request 138308 from home:coolo:branches:openSUSE:Factory

- update to 2.5.37
  ** Import flex into git. See
     git://flex.git.sourceforge.net/gitroot/flex/flex.
  ** Fix make install target to not fail when the flex++ program is
     already installed
  ** New translations from the translation project: de, fi, pl, vi
  ** various portability fixes that quiet compiler warnings on 64-bit
     hosts
  ** various manual fixes, including correcting the name of a %option and
     updating some simple examples to use ANSI C syntax
  ** various bug fixes that prevent certain error conditions from
     persisting when they should not persist
  ** improvements to the test suite so it behaves better when linking
     compiled files
  ** new translations from the translation project: ca, da, es, fi, fr,
     ga, ko, pt_br, ro, ru, sv, tr, zh_cn
  ** the flex distribution is now built with automake 1.10.1 and automake
     2.61
- add patch flex-2.5.37-notex.patch to compile without texlive
- remove patches no longer required:
   flex-2.5.33-yylineno.patch
   flex-2.5.34-doc-fix.diff
   flex-2.5.34-g++44.diff

OBS-URL: https://build.opensuse.org/request/show/138308
OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/flex?expand=0&rev=12
This commit is contained in:
Factory Maintainer 2012-10-16 11:16:33 +00:00 committed by Git OBS Bridge
parent 4c01500091
commit 89a672bb76
11 changed files with 159 additions and 182 deletions

View File

@ -1,36 +0,0 @@
--- main.c
+++ main.c
@@ -1633,9 +1633,11 @@
if (!C_plus_plus && !reentrant) {
outn ("extern int yylineno;");
- OUT_BEGIN_CODE ();
- outn ("int yylineno = 1;");
- OUT_END_CODE ();
+ if (do_yylineno) {
+ OUT_BEGIN_CODE ();
+ outn ("int yylineno = 1;");
+ OUT_END_CODE ();
+ }
}
if (C_plus_plus) {
--- flex.skl
+++ flex.skl
@@ -80,6 +80,16 @@
m4preproc_define(`M4_GEN_PREFIX',
``m4_define(yy[[$1]], [[M4_YY_PREFIX[[$1]]m4_ifelse($'`#,0,,[[($'`@)]])]])'')
+%# don't use yylineno in non-reentrant scanners when %option yylineno not given
+m4_ifdef( [[M4_YY_REENTRANT]],,
+ [[m4_ifdef( [[M4_YY_USE_LINENO]],,
+ [[
+ m4_define( [[M4_YY_NO_GET_LINENO]], [[]])
+ m4_define( [[M4_YY_NO_SET_LINENO]], [[]])
+ ]])
+ ]]
+)
+
%if-c++-only
/* The c++ scanner is a mess. The FlexLexer.h header file relies on the
* following macro. This is required in order to pass the c++-multiple-scanners

View File

@ -1,15 +0,0 @@
libraries need to be last
Index: tests/test-pthread/Makefile.am
===================================================================
--- tests/test-pthread/Makefile.am.orig
+++ tests/test-pthread/Makefile.am
@@ -37,7 +37,7 @@ scanner.c: $(srcdir)/scanner.l
$(FLEX) $(LFLAGS) $<
$(testname)$(EXEEXT): $(OBJS)
- $(CC) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES)
+ $(CC) -o $@ $(OBJS) $(LOADLIBES) $(LDFLAGS)
test: $(testname)$(EXEEXT)
./$(testname) $(srcdir)/test-*.input

View File

@ -1,96 +0,0 @@
The documentation has the td_hilen and td_lolen fields in the wrong
order (comapre with tables_shared.h).
Andreas Gruenbacher <agruen@suse.de>
---
doc/flex.info-1 | 16 ++++++++--------
doc/flex.texi | 14 +++++++-------
2 files changed, 15 insertions(+), 15 deletions(-)
--- doc/flex.info-1.orig
+++ doc/flex.info-1
@@ -4171,8 +4171,8 @@ indexed by name, as described below. The
+-------------------------------+
Table 1 | uint16 td_id; |
| uint16 td_flags; |
- | uint32 td_lolen; |
| uint32 td_hilen; |
+ | uint32 td_lolen; |
| void td_data[]; |
| uint8 td_pad64[]; |
+-------------------------------+
@@ -4303,12 +4303,6 @@ Fields of a table:
elements or between structs. The type of each member is
determined by the `YYTD_DATA*' bits.
-`td_lolen'
- Specifies the number of elements in the lowest dimension array. If
- this is a one-dimensional array, then it is simply the number of
- elements in this array. The element size is determined by the
- `td_flags' field.
-
`td_hilen'
If `td_hilen' is non-zero, then the data is a two-dimensional
array. Otherwise, the data is a one-dimensional array. `td_hilen'
@@ -4324,11 +4318,17 @@ Fields of a table:
simply skipped. Flex does not currently generate tables of zero
length.
+`td_lolen'
+ Specifies the number of elements in the lowest dimension array. If
+ this is a one-dimensional array, then it is simply the number of
+ elements in this array. The element size is determined by the
+ `td_flags' field.
+
`td_data[]'
The table data. This array may be a one- or two-dimensional array,
of type `int8', `int16', `int32', `struct yy_trans_info', or
`struct yy_trans_info*', depending upon the values in the
- `td_flags', `td_lolen', and `td_hilen' fields.
+ `td_flags', `td_hilen', and `td_lolen' fields.
`td_pad64[]'
Zero or more NULL bytes, padding the entire table to the next
--- doc/flex.texi.orig
+++ doc/flex.texi
@@ -5083,8 +5083,8 @@ indexed by name, as described below. The
+-------------------------------+
Table 1 | uint16 td_id; |
| uint16 td_flags; |
- | uint32 td_lolen; |
| uint32 td_hilen; |
+ | uint32 td_lolen; |
| void td_data[]; |
| uint8 td_pad64[]; |
+-------------------------------+
@@ -5203,11 +5203,6 @@ two integers. There is no padding betwee
The type of each member is determined by the @code{YYTD_DATA*} bits.
@end table
-@item td_lolen
-Specifies the number of elements in the lowest dimension array. If this is
-a one-dimensional array, then it is simply the number of elements in this array.
-The element size is determined by the @code{td_flags} field.
-
@item td_hilen
If @code{td_hilen} is non-zero, then the data is a two-dimensional array.
Otherwise, the data is a one-dimensional array. @code{td_hilen} contains the
@@ -5221,11 +5216,16 @@ by the @code{td_flags} field. It is pos
array, and no data is loaded, i.e., this table is simply skipped. Flex does not
currently generate tables of zero length.
+@item td_lolen
+Specifies the number of elements in the lowest dimension array. If this is
+a one-dimensional array, then it is simply the number of elements in this array.
+The element size is determined by the @code{td_flags} field.
+
@item td_data[]
The table data. This array may be a one- or two-dimensional array, of type
@code{int8}, @code{int16}, @code{int32}, @code{struct yy_trans_info}, or
@code{struct yy_trans_info*}, depending upon the values in the
-@code{td_flags}, @code{td_lolen}, and @code{td_hilen} fields.
+@code{td_flags}, @code{td_hilen}, and @code{td_lolen} fields.
@item td_pad64[]
Zero or more NULL bytes, padding the entire table to the next 64-bit boundary as

View File

@ -5,6 +5,8 @@ instead.
Makefile.am | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
Index: Makefile.am
===================================================================
--- Makefile.am.orig
+++ Makefile.am
@@ -40,8 +40,7 @@ indent = @INDENT@
@ -17,7 +19,7 @@ instead.
flex_SOURCES = \
ccl.c \
@@ -70,13 +69,7 @@ libfl_a_SOURCES = \
@@ -73,13 +72,7 @@ libfl_a_SOURCES = \
libmain.c \
libyywrap.c

View File

@ -1,12 +0,0 @@
Index: skel.c
===================================================================
--- skel.c 2008-02-26 22:34:19.000000000 +0100
+++ skel.c 2009-01-12 11:29:26.000000000 +0100
@@ -286,6 +286,7 @@ const char *skel[] = {
"#include <errno.h>",
"#include <cstdlib>",
"#include <cstring>",
+ "#include <cstdio>",
"/* end standard C++ headers. */",
"%endif",
"",

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0becbd4b2b36b99c67f8c22ab98f7f80c9860aec70f0350a0018f29a88704e7b
size 1256501

View File

@ -0,0 +1,95 @@
Submitted By: Bruce Dubbs <bdubbs@linuxfromscratch.org>
Date: 2012-08-20
Initial Package Version: 2.5.36
Origin: Redhat
Description: This fixes two errors in the regression tests due to changes
in bison.
diff -up flex-2.5.36/tests/test-bison-yylloc/main.c~ flex-2.5.36/tests/test-bison-yylloc/main.c
--- flex-2.5.36/tests/test-bison-yylloc/main.c~ 2002-06-25 21:37:06.000000000 +0200
+++ flex-2.5.36/tests/test-bison-yylloc/main.c 2012-07-31 18:53:22.007394045 +0200
@@ -21,8 +21,6 @@
#include "parser.h"
#include "scanner.h"
-extern int testparse(yyscan_t);
-
int main ( int argc, char** argv )
{
yyscan_t scanner;
diff -up flex-2.5.36/tests/test-bison-yylloc/parser.y~ flex-2.5.36/tests/test-bison-yylloc/parser.y
--- flex-2.5.36/tests/test-bison-yylloc/parser.y~ 2002-07-25 02:43:47.000000000 +0200
+++ flex-2.5.36/tests/test-bison-yylloc/parser.y 2012-08-01 01:06:53.093155586 +0200
@@ -21,6 +21,8 @@
* PURPOSE.
*/
+%parse-param { void* scanner }
+
/*
How to compile:
bison --defines --output-file="parser.c" --name-prefix="test" parser.y
@@ -32,10 +34,8 @@
#include "config.h"
#define YYERROR_VERBOSE 1
-#define YYPARSE_PARAM scanner
#define YYLEX_PARAM scanner
-int yyerror(char* msg);
extern int testget_lineno(void*);
@@ -89,7 +89,7 @@ line:
%%
-int yyerror(char* msg) {
+int yyerror(void* scanner, char* msg) {
fprintf(stderr,"%s\n",msg);
return 0;
}
diff -up flex-2.5.36/tests/test-bison-yylval/main.c~ flex-2.5.36/tests/test-bison-yylval/main.c
--- flex-2.5.36/tests/test-bison-yylval/main.c~ 2002-06-25 21:37:06.000000000 +0200
+++ flex-2.5.36/tests/test-bison-yylval/main.c 2012-08-01 01:10:02.015510280 +0200
@@ -24,8 +24,6 @@
#include "parser.h"
#include "scanner.h"
-extern int testparse(yyscan_t);
-
int main ( int argc, char** argv )
{
yyscan_t scanner;
diff -up flex-2.5.36/tests/test-bison-yylval/parser.y~ flex-2.5.36/tests/test-bison-yylval/parser.y
--- flex-2.5.36/tests/test-bison-yylval/parser.y~ 2002-06-25 21:37:06.000000000 +0200
+++ flex-2.5.36/tests/test-bison-yylval/parser.y 2012-08-01 01:13:11.239867147 +0200
@@ -25,6 +25,7 @@
How to compile:
bison --defines --output-file="parser.c" --name-prefix="test" parser.y
*/
+%parse-param { void* scanner }
%{
#include <stdio.h>
#include <stdlib.h>
@@ -32,11 +33,8 @@
#include "config.h"
#define YYERROR_VERBOSE 1
-#define YYPARSE_PARAM scanner
#define YYLEX_PARAM scanner
-int yyerror(char* msg);
-
/* A dummy function. A check against seg-faults in yylval->str. */
int process_text(char* s) {
@@ -76,7 +74,7 @@ starttag: LT TAGNAME GT { process_
endtag: LTSLASH TAGNAME GT { process_text($2);free($2);} ;
%%
-int yyerror(char* msg) {
+int yyerror(void* scanner, char* msg) {
fprintf(stderr,"%s\n",msg);
return 0;
}

15
flex-2.5.37-notex.patch Normal file
View File

@ -0,0 +1,15 @@
We don't need texlive in the core bootstrap cycle
Index: flex-2.5.37/doc/Makefile.am
===================================================================
--- flex-2.5.37.orig/doc/Makefile.am
+++ flex-2.5.37/doc/Makefile.am
@@ -2,7 +2,7 @@ help2man = @HELP2MAN@
info_TEXINFOS = flex.texi
dist_man_MANS = flex.1
-dist_doc_DATA= flex.pdf
+#dist_doc_DATA= flex.pdf
CLEANFILES = \
flex.hks \

3
flex-2.5.37.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:17aa7b4ebf19a13bc2dff4115b416365c95f090061539a932a68092349ac052a
size 1303313

View File

@ -1,3 +1,30 @@
-------------------------------------------------------------------
Tue Oct 16 08:33:54 UTC 2012 - coolo@suse.com
- update to 2.5.37
** Import flex into git. See
git://flex.git.sourceforge.net/gitroot/flex/flex.
** Fix make install target to not fail when the flex++ program is
already installed
** New translations from the translation project: de, fi, pl, vi
** various portability fixes that quiet compiler warnings on 64-bit
hosts
** various manual fixes, including correcting the name of a %option and
updating some simple examples to use ANSI C syntax
** various bug fixes that prevent certain error conditions from
persisting when they should not persist
** improvements to the test suite so it behaves better when linking
compiled files
** new translations from the translation project: ca, da, es, fi, fr,
ga, ko, pt_br, ro, ru, sv, tr, zh_cn
** the flex distribution is now built with automake 1.10.1 and automake
2.61
- add patch flex-2.5.37-notex.patch to compile without texlive
- remove patches no longer required:
flex-2.5.33-yylineno.patch
flex-2.5.34-doc-fix.diff
flex-2.5.34-g++44.diff
-------------------------------------------------------------------
Fri Dec 2 15:41:49 UTC 2011 - coolo@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package flex
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -15,14 +15,14 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: flex
BuildRequires: automake
BuildRequires: bison
BuildRequires: gcc-c++
BuildRequires: help2man
BuildRequires: makeinfo
Url: http://flex.sourceforge.net/
License: BSD-3-Clause
Group: Development/Languages/C and C++
Requires: m4
PreReq: %install_info_prereq
# bug437293
@ -30,18 +30,20 @@ PreReq: %install_info_prereq
Obsoletes: flex-64bit
%endif
#
Version: 2.5.35
Version: 2.5.37
Release: 0
Summary: Fast Lexical Analyzer Generator
Source: %{name}-%{version}.tar.bz2
License: BSD-3-Clause
Group: Development/Languages/C and C++
Source: http://prdownloads.sourceforge.net/flex/flex-%{version}.tar.bz2
Source1: lex-wrapper.sh
Source2: README.SUSE
Source3: baselibs.conf
Patch1: flex-2.5.34-fPIC.patch
Patch2: flex-2.5.33-yylineno.patch
Patch3: flex-2.5.34-doc-fix.diff
Patch4: flex-2.5.34-g++44.diff
Patch5: flex-2.5.34-asneeded.patch
# PATCH-FIX-OPENSUSE Remove tex dependency, info is enough for us, we don't need pdf - coolo@suse.de
Patch2: flex-2.5.37-notex.patch
# PATCH-FIX-UPSTREAM fix tests for new bison
Patch3: http://www.linuxfromscratch.org/patches/lfs/7.2/flex-2.5.37-bison-2.6.1-1.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@ -51,17 +53,12 @@ patterns in text.
%prep
%setup -q
%patch1
# Patch2 disabled for now, as the testsuite explicitly tests for yylineno in
# all scanners. Let's see if the failing packages got fixed in the meantime.
#patch2
%patch3
%patch4
%patch5
cp %{S:2} .
%patch2 -p1
%patch3 -p1
%build
autoreconf -fi
%configure
%configure --docdir=%{_docdir}/%{name}
make %{?_smp_mflags}
%check
@ -72,8 +69,8 @@ make check
%install
make install DESTDIR=$RPM_BUILD_ROOT
install %{S:1} $RPM_BUILD_ROOT/%{_bindir}/lex
ln -s flex $RPM_BUILD_ROOT/%{_bindir}/flex++
ln -s flex.1.gz $RPM_BUILD_ROOT/%{_mandir}/man1/lex.1.gz
cp %{S:2} $RPM_BUILD_ROOT/%{_docdir}/%{name}
%find_lang %{name}
%files -f %{name}.lang
@ -86,7 +83,7 @@ ln -s flex.1.gz $RPM_BUILD_ROOT/%{_mandir}/man1/lex.1.gz
%{_mandir}/man1/flex.1.gz
%{_mandir}/man1/lex.1.gz
%{_infodir}/flex*
%doc README README.SUSE AUTHORS COPYING NEWS
%{_docdir}/%name
%post
%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz