SHA256
3
0
forked from pool/flex

Accepting request 391664 from devel:tools:compiler

- Update to version 2.6.1
  * A number of compiler warnings have been remedied.
  * Line directives should now work as expected and be absent when
    that is expected.
  * Resolved github issues #53, #54, #55, #61.
  * Resolved sf bugs #128, #129, #155, #160, #184, #187, #195.
- Refresh flex-2.5.34-fPIC.patch -> flex-2.6.1-fPIC.patch
- Drop upstream patches: config-guess-sub-update.patch,
  flex-2.5.37-bison-2.6.1-1.patch, flex-compatible-with-bison3.patch,
  flex-yyleng.patch
- Drop unneeded patch flex-2.5.37-notex.patch

OBS-URL: https://build.opensuse.org/request/show/391664
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/flex?expand=0&rev=28
This commit is contained in:
Dominique Leuenberger 2016-05-12 07:32:05 +00:00 committed by Git OBS Bridge
commit deb289c5e8
11 changed files with 77 additions and 1779 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,36 +0,0 @@
We've been packaging an -fPIC enabled libfl.a since some time, switching to
the new scheme is not worth it, package a libfl_pic.a -> libfl.a symlink
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@
bin_PROGRAMS = flex
lib_LIBRARIES = \
- libfl.a \
- libfl_pic.a
+ libfl.a
flex_SOURCES = \
ccl.c \
@@ -73,13 +72,7 @@ libfl_a_SOURCES = \
libmain.c \
libyywrap.c
-libfl_pic_a_SOURCES = \
- libmain.c \
- libyywrap.c
-
-libfl_pic_a_CFLAGS = \
- -fPIC \
- $(AM_CFLAGS)
+libfl_a_CFLAGS = -fPIC $(AM_CFLAGS)
noinst_HEADERS = \
flexdef.h \

View File

@ -1,95 +0,0 @@
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;
}

View File

@ -1,15 +0,0 @@
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 \

View File

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

27
flex-2.6.1-fPIC.patch Normal file
View File

@ -0,0 +1,27 @@
Index: flex-2.6.1/src/Makefile.am
===================================================================
--- flex-2.6.1.orig/src/Makefile.am
+++ flex-2.6.1/src/Makefile.am
@@ -8,8 +8,7 @@ m4 = @M4@
bin_PROGRAMS = flex
noinst_PROGRAMS = stage1flex
lib_LTLIBRARIES = \
- libfl.la \
- libfl_pic.la
+ libfl.la
stage1flex_SOURCES = \
scan.l \
@@ -49,12 +48,6 @@ libfl_la_SOURCES = \
libfl_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@
-libfl_pic_la_SOURCES = \
- libmain.c \
- libyywrap.c
-
-libfl_pic_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@
-
noinst_HEADERS = \
flexdef.h \
flexint.h \

3
flex-2.6.1.tar.xz Normal file
View File

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

View File

@ -1,54 +0,0 @@
--- flex-2.5.37.orig/tests/test-bison-yylloc/parser.y
+++ flex-2.5.37/tests/test-bison-yylloc/parser.y
@@ -22,6 +22,7 @@
*/
%parse-param { void* scanner }
+%lex-param { void* scanner }
/*
How to compile:
@@ -34,7 +35,6 @@
#include "config.h"
#define YYERROR_VERBOSE 1
-#define YYLEX_PARAM scanner
extern int testget_lineno(void*);
@@ -52,7 +52,7 @@ int process_text(char* s) {
%}
-%pure_parser
+%pure-parser
%union {
int lineno;
--- flex-2.5.37.orig/tests/test-bison-yylval/parser.y
+++ flex-2.5.37/tests/test-bison-yylval/parser.y
@@ -26,6 +26,7 @@
bison --defines --output-file="parser.c" --name-prefix="test" parser.y
*/
%parse-param { void* scanner }
+%lex-param { void* scanner }
%{
#include <stdio.h>
#include <stdlib.h>
@@ -33,7 +34,6 @@
#include "config.h"
#define YYERROR_VERBOSE 1
-#define YYLEX_PARAM scanner
/* A dummy function. A check against seg-faults in yylval->str. */
@@ -49,7 +49,7 @@ int process_text(char* s) {
%}
-%pure_parser
+%pure-parser
%union {
long unused;

View File

@ -1,116 +0,0 @@
Index: flex-2.5.37/gen.c
===================================================================
--- flex-2.5.37.orig/gen.c
+++ flex-2.5.37/gen.c
@@ -1516,11 +1516,11 @@ void make_tables ()
if (yymore_used && !yytext_is_array) {
indent_puts ("YY_G(yytext_ptr) -= YY_G(yy_more_len); \\");
indent_puts
- ("yyleng = (size_t) (yy_cp - YY_G(yytext_ptr)); \\");
+ ("yyleng = (int) (yy_cp - YY_G(yytext_ptr)); \\");
}
else
- indent_puts ("yyleng = (size_t) (yy_cp - yy_bp); \\");
+ indent_puts ("yyleng = (int) (yy_cp - yy_bp); \\");
/* Now also deal with copying yytext_ptr to yytext if needed. */
skelout (); /* %% [3.0] - break point in skel */
Index: flex-2.5.37/scan.c
===================================================================
--- flex-2.5.37.orig/scan.c
+++ flex-2.5.37/scan.c
@@ -158,7 +158,7 @@ typedef struct yy_buffer_state *YY_BUFFE
typedef size_t yy_size_t;
#endif
-extern yy_size_t yyleng;
+extern int yyleng;
extern FILE *yyin, *yyout;
@@ -272,7 +272,7 @@ static YY_BUFFER_STATE * yy_buffer_stack
/* yy_hold_char holds the character lost when yytext is formed. */
static char yy_hold_char;
static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
-yy_size_t yyleng;
+int yyleng;
/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
@@ -356,7 +356,7 @@ static void yy_fatal_error (yyconst char
#define YY_DO_BEFORE_ACTION \
(yytext_ptr) = yy_bp; \
(yytext_ptr) -= (yy_more_len); \
- yyleng = (size_t) (yy_cp - (yytext_ptr)); \
+ yyleng = (int) (yy_cp - (yytext_ptr)); \
(yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
@@ -2036,7 +2036,7 @@ FILE *yyget_out (void );
void yyset_out (FILE * out_str );
-yy_size_t yyget_leng (void );
+int yyget_leng (void );
char *yyget_text (void );
@@ -4968,7 +4968,7 @@ FILE *yyget_out (void)
/** Get the length of the current token.
*
*/
-yy_size_t yyget_leng (void)
+int yyget_leng (void)
{
return yyleng;
}
Index: flex-2.5.37/skel.c
===================================================================
--- flex-2.5.37.orig/skel.c
+++ flex-2.5.37/skel.c
@@ -536,7 +536,7 @@ const char *skel[] = {
"#endif",
"",
"%if-not-reentrant",
- "extern yy_size_t yyleng;",
+ "extern int yyleng;",
"%endif",
"",
"%if-c-only",
@@ -712,7 +712,7 @@ const char *skel[] = {
"/* yy_hold_char holds the character lost when yytext is formed. */",
"static char yy_hold_char;",
"static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */",
- "yy_size_t yyleng;",
+ "int yyleng;",
"",
"/* Points to current character in buffer. */",
"static char *yy_c_buf_p = (char *) 0;",
@@ -875,7 +875,7 @@ const char *skel[] = {
" YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */",
" char yy_hold_char;",
" yy_size_t yy_n_chars;",
- " yy_size_t yyleng_r;",
+ " int yyleng_r;",
" char *yy_c_buf_p;",
" int yy_init;",
" int yy_start;",
@@ -1012,7 +1012,7 @@ const char *skel[] = {
"",
"m4_ifdef( [[M4_YY_NO_GET_LENG]],,",
"[[",
- "yy_size_t yyget_leng M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );",
+ "int yyget_leng M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );",
"]])",
"",
"m4_ifdef( [[M4_YY_NO_GET_TEXT]],,",
@@ -2792,7 +2792,7 @@ const char *skel[] = {
"/** Get the length of the current token.",
" * M4_YY_DOC_PARAM",
" */",
- "yy_size_t yyget_leng YYFARGS0(void)",
+ "int yyget_leng YYFARGS0(void)",
"{",
" M4_YY_DECL_GUTS_VAR();",
" return yyleng;",

View File

@ -1,3 +1,18 @@
-------------------------------------------------------------------
Tue Apr 26 09:26:03 UTC 2016 - idonmez@suse.com
- Update to version 2.6.1
* A number of compiler warnings have been remedied.
* Line directives should now work as expected and be absent when
that is expected.
* Resolved github issues #53, #54, #55, #61.
* Resolved sf bugs #128, #129, #155, #160, #184, #187, #195.
- Refresh flex-2.5.34-fPIC.patch -> flex-2.6.1-fPIC.patch
- Drop upstream patches: config-guess-sub-update.patch,
flex-2.5.37-bison-2.6.1-1.patch, flex-compatible-with-bison3.patch,
flex-yyleng.patch
- Drop unneeded patch flex-2.5.37-notex.patch
-------------------------------------------------------------------
Sun Feb 15 17:45:41 UTC 2015 - schwab@linux-m68k.org

View File

@ -1,7 +1,7 @@
#
# spec file for package flex
#
# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -17,38 +17,26 @@
Name: flex
BuildRequires: automake
BuildRequires: bison
BuildRequires: gcc-c++
BuildRequires: help2man
BuildRequires: makeinfo
Url: http://flex.sourceforge.net/
Requires: m4
PreReq: %install_info_prereq
# bug437293
%ifarch ppc64
Obsoletes: flex-64bit
%endif
#
Version: 2.5.37
Version: 2.6.1
Release: 0
Summary: Fast Lexical Analyzer Generator
License: BSD-3-Clause
Group: Development/Languages/C and C++
Source: http://prdownloads.sourceforge.net/flex/flex-%{version}.tar.bz2
Url: http://flex.sourceforge.net/
Source: https://github.com/westes/flex/releases/download/v%{version}/flex-%{version}.tar.xz
Source1: lex-wrapper.sh
Source2: README.SUSE
Source3: baselibs.conf
Patch1: flex-2.5.34-fPIC.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
# PATCH-FIX-UPSTREAM flex-2.5.37-bison3.patch mlin@suse.com - fix tests for bison3
Patch4: flex-compatible-with-bison3.patch
Patch5: config-guess-sub-update.patch
# PATCH-FIX-UPSTREAM fix type of yyleng as mandated by POSIX (flex bug #187)
Patch6: flex-yyleng.patch
Patch1: flex-2.6.1-fPIC.patch
BuildRequires: automake
BuildRequires: bison
BuildRequires: gcc-c++
BuildRequires: help2man
BuildRequires: libtool
BuildRequires: makeinfo
Requires: m4
PreReq: %{install_info_prereq}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@ -57,46 +45,47 @@ patterns in text.
%prep
%setup -q
%patch1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5
%patch6 -p1
%patch1 -p1
%build
autoreconf -fi
%configure --docdir=%{_docdir}/%{name}
%configure \
--docdir=%{_docdir}/%{name} \
--disable-shared
make %{?_smp_mflags}
%check
%if !0%{?qemu_user_space_build:1}
make check
make %{?_smp_mflags} check
%endif
%install
make install DESTDIR=$RPM_BUILD_ROOT
install %{S:1} $RPM_BUILD_ROOT/%{_bindir}/lex
ln -s flex.1.gz $RPM_BUILD_ROOT/%{_mandir}/man1/lex.1.gz
cp %{S:2} $RPM_BUILD_ROOT/%{_docdir}/%{name}
make %{?_smp_mflags} DESTDIR=%{buildroot} install
install %{SOURCE1} %{buildroot}/%{_bindir}/lex
ln -s flex.1.gz %{buildroot}/%{_mandir}/man1/lex.1.gz
cp %{SOURCE2} %{buildroot}/%{_docdir}/%{name}
find %{buildroot} -name *.la -delete
%find_lang %{name}
%files -f %{name}.lang
%defattr(-,root,root)
/usr/bin/flex
/usr/bin/flex++
/usr/bin/lex
/usr/include/FlexLexer.h
%{_bindir}/flex
%{_bindir}/flex++
%{_bindir}/lex
%{_includedir}/FlexLexer.h
%{_libdir}/libfl.a
%{_mandir}/man1/flex.1.gz
%{_mandir}/man1/lex.1.gz
%{_infodir}/flex*
%{_docdir}/%name
%{_docdir}/%{name}
%post
%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%postun
%preun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%changelog