Skip to contentSkip to conversation

flex: bump to version v2.6.4

PATCH New Adam Duskett 3 participants 4 messages May 10, 2017 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 flex: bump to version v2.6.4

flex.mk:
- The package is now hosted on github not sourceforge.
- autogen.sh is now used, set FLEX_AUTORECONF to YES.
- host-gettext is now required. Without it autoconf fails to run. This is both with host-flex and target-flex.
- The FLEX_DISABLE_PROGRAM define in the makefile has been removed, as the only reference to bin_PROGRAMS is now just flex.
- The flex++ symlink is now only generated if the flex binary is installed. As such, FLEX_REMOVE_BROKEN_SYMLINK is no longer needed.
- Add FLEX_TOUCH_RPATH_CONF define in flex.mk. Autogen.sh fails if build-aux/config.rpath doesn't exist. Touching it fixes the problem.

- Removed 0001-prog-ar.patch, fixed upstream.
- Removed 0002-fix-CVE-2016-6354.patch, applied upstream.

0001-fix-cross-compiling-issues.patch:
- doc requires help2man which isn't supported, and documents aren't needed anyways.
- po doesn't have a makefile, and isn't needed for compiling.

---
 package/flex/0001-fix-cross-compiling-issues.patch | 49 ++++++++++++++++++++++
 package/flex/0001-prog-ar.patch                    | 11 -----
 package/flex/0002-fix-CVE-2016-6354.patch          | 25 -----------
 package/flex/flex.hash                             |  2 +-
 package/flex/flex.mk                               | 26 +++++-------
 5 files changed, 61 insertions(+), 52 deletions(-)
 create mode 100644 package/flex/0001-fix-cross-compiling-issues.patch
 delete mode 100644 package/flex/0001-prog-ar.patch
 delete mode 100644 package/flex/0002-fix-CVE-2016-6354.patch
package/flex/0001-fix-cross-compiling-issues.patch new file +49 -0
new file mode 100644
index 0000000..ef092c5
@@ -0,0 +1,49 @@
+From 31985a4183654c884240c3740f8a24212f8794c2 Mon Sep 17 00:00:00 2001
+From: Adam Duskett <[email protected]>
+Date: Tue, 9 May 2017 13:46:18 -0400
+Subject: [PATCH] fix cross compiling issues
+
+the po directory doesn't have a makefile.
+doc wants help2man that isn't supported by buildroot.
+
+Remove both of these references.
+
+Signed-off-by: Adam Duskett <[email protected]>
+---
+ Makefile.am  | 2 --
+ configure.ac | 2 --
+ 2 files changed, 4 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 638c549..8b7fbc4 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -43,9 +43,7 @@ EXTRA_DIST = \
+ 
+ SUBDIRS = \
+ 	src \
+-	doc \
+ 	examples \
+-	po \
+ 	tests \
+ 	tools
+ 
+diff --git a/configure.ac b/configure.ac
+index 55e774b..6c56c36 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -171,11 +171,9 @@ reallocarray dnl  OpenBSD function. We have replacement if not available.
+ 
+ AC_CONFIG_FILES(
+ Makefile
+-doc/Makefile
+ examples/Makefile
+ examples/fastwc/Makefile
+ examples/manual/Makefile
+-po/Makefile.in
+ src/Makefile
+ tools/Makefile
+ tests/Makefile
+-- 
+2.9.3
+
package/flex/0001-prog-ar.patch deleted +0 -11
deleted file mode 100644
index e0626ff..0000000
@@ -1,11 +0,0 @@
-diff -rup flex-2.5.33.orig/Makefile.in flex-2.5.33/Makefile.in
---- flex-2.5.33.orig/Makefile.in	2007-01-18 17:29:25.000000000 +0100
-+++ flex-2.5.33/Makefile.in	2007-01-18 18:28:22.000000000 +0100
-@@ -105,7 +105,6 @@ am__installdirs = "$(DESTDIR)$(libdir)"
- 	"$(DESTDIR)$(includedir)"
- libLIBRARIES_INSTALL = $(INSTALL_DATA)
- LIBRARIES = $(lib_LIBRARIES)
--AR = ar
- ARFLAGS = cru
- libfl_a_AR = $(AR) $(ARFLAGS)
- libfl_a_LIBADD =
package/flex/0002-fix-CVE-2016-6354.patch deleted +0 -25
deleted file mode 100644
index b0c780b..0000000
@@ -1,25 +0,0 @@
-From a5cbe929ac3255d371e698f62dc256afe7006466 Mon Sep 17 00:00:00 2001
-From: Will Estes <[email protected]>
-Date: Sat, 27 Feb 2016 11:56:05 -0500
-Subject: [PATCH] Fixed incorrect integer type
-
-Signed-off-by: Gustavo Zacarias <[email protected]>
----
-Status: upstream
-
- flex.skl | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/flex.skl b/src/flex.skl
-index 36a526a..64f853d 100644
---- a/flex.skl
-+++ b/flex.skl
-@@ -1703,7 +1703,7 @@ int yyFlexLexer::yy_get_next_buffer()
- 
- 	else
- 		{
--			yy_size_t num_to_read =
-+			int num_to_read =
- 			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
- 
- 		while ( num_to_read <= 0 )
package/flex/flex.hash +1 -1
index b91ab57..fc0463d 100644
@@ -1,2 +1,2 @@
 # Locally computed:
-sha256  bf693433a3effe6b1f42e44abd787491e4e213984b1859545b92267a86088dd3  flex-2.5.37.tar.gz
+sha256  4df278468142e457a9e5f6492a7d39fdb34bd7e7d42ec21b3c382889b34cfefe  flex-v2.6.4.tar.gz
package/flex/flex.mk +11 -15
index 9a3f840..0613c89 100644
@@ -4,27 +4,23 @@
 #
 ################################################################################
 
-FLEX_VERSION = 2.5.37
-FLEX_SITE = http://download.sourceforge.net/project/flex
+FLEX_VERSION = v2.6.4
+FLEX_SITE = $(call github,westes,flex,$(FLEX_VERSION))
 FLEX_INSTALL_STAGING = YES
 FLEX_LICENSE = FLEX
 FLEX_LICENSE_FILES = COPYING
-FLEX_DEPENDENCIES = \
-	$(if $(BR2_PACKAGE_GETTEXT_IF_LOCALE),gettext) host-m4
-FLEX_CONF_ENV = ac_cv_path_M4=/usr/bin/m4
-# we don't have a host-gettext/libintl
-HOST_FLEX_DEPENDENCIES = host-m4
+FLEX_DEPENDENCIES = host-m4 host-gettext
+FLEX_AUTORECONF = YES
+HOST_FLEX_DEPENDENCIES = host-gettext host-m4
 
-define FLEX_DISABLE_PROGRAM
-	$(SED) 's/^bin_PROGRAMS.*//' $(@D)/Makefile.in
+# build-aux/config.rpath is needed but not auto-generated.
+define FLEX_TOUCH_RPATH_CONF
+	mkdir -p $(@D)/build-aux
+	touch $(@D)/build-aux/config.rpath
 endef
-FLEX_POST_PATCH_HOOKS += FLEX_DISABLE_PROGRAM
 
-# flex++ symlink is broken when flex binary is not installed
-define FLEX_REMOVE_BROKEN_SYMLINK
-	rm -f $(TARGET_DIR)/usr/bin/flex++
-endef
-FLEX_POST_INSTALL_TARGET_HOOKS += FLEX_REMOVE_BROKEN_SYMLINK
+FLEX_PRE_CONFIGURE_HOOKS += FLEX_TOUCH_RPATH_CONF
+HOST_FLEX_PRE_CONFIGURE_HOOKS += FLEX_TOUCH_RPATH_CONF
 
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
Signature · 1 line
2.9.3
#1 lore raw

PATCH 1/1 flex: bump to version v2.6.4

Hi Adam,

Quoted 7 lines · Adam Duskett
package/flex/0001-fix-cross-compiling-issues.patch new file +0 -0
new file mode 100644
index 0000000..ef092c5

package/flex/0001-fix-cross-compiling-issues.patch line 7

Quoted 7 lines
package/flex/0001-fix-cross-compiling-issues.patch new file +7 -0
@@ -0,0 +1,49 @@
+From 31985a4183654c884240c3740f8a24212f8794c2 Mon Sep 17 00:00:00 2001
+From: Adam Duskett <[email protected]>
+Date: Tue, 9 May 2017 13:46:18 -0400
+Subject: [PATCH] fix cross compiling issues
+
+the po directory doesn't have a makefile.
+doc wants help2man that isn't supported by buildroot.

The problem with help2man is that it is inherently incompatible with cross compilation. help2man relies on the ability to run the built binary.

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#2 lore raw

PATCH 1/1 flex: bump to version v2.6.4

In reply to Adam Duskett

Hello Adam,

I already sent a patch to bump flex to 2.6.4 a couple of days ago. Could you please review my patch instead?

http://patchwork.ozlabs.org/patch/759619/

Thanks,

Vincent

Quoted 187 lines · Adam Duskett

flex.mk:
- The package is now hosted on github not sourceforge.
- autogen.sh is now used, set FLEX_AUTORECONF to YES.
- host-gettext is now required. Without it autoconf fails to run. This is both with host-flex and target-flex.
- The FLEX_DISABLE_PROGRAM define in the makefile has been removed, as the only reference to bin_PROGRAMS is now just flex.
- The flex++ symlink is now only generated if the flex binary is installed. As such, FLEX_REMOVE_BROKEN_SYMLINK is no longer needed.
- Add FLEX_TOUCH_RPATH_CONF define in flex.mk. Autogen.sh fails if build-aux/config.rpath doesn't exist. Touching it fixes the problem.

- Removed 0001-prog-ar.patch, fixed upstream.
- Removed 0002-fix-CVE-2016-6354.patch, applied upstream.

0001-fix-cross-compiling-issues.patch:
- doc requires help2man which isn't supported, and documents aren't needed anyways.
- po doesn't have a makefile, and isn't needed for compiling.

---
 package/flex/0001-fix-cross-compiling-issues.patch | 49 ++++++++++++++++++++++
 package/flex/0001-prog-ar.patch                    | 11 -----
 package/flex/0002-fix-CVE-2016-6354.patch          | 25 -----------
 package/flex/flex.hash                             |  2 +-
 package/flex/flex.mk                               | 26 +++++-------
 5 files changed, 61 insertions(+), 52 deletions(-)
 create mode 100644 package/flex/0001-fix-cross-compiling-issues.patch
 delete mode 100644 package/flex/0001-prog-ar.patch
 delete mode 100644 package/flex/0002-fix-CVE-2016-6354.patch
package/flex/0001-fix-cross-compiling-issues.patch new file +49 -0
new file mode 100644
index 0000000..ef092c5
@@ -0,0 +1,49 @@
+From 31985a4183654c884240c3740f8a24212f8794c2 Mon Sep 17 00:00:00 2001
+From: Adam Duskett <[email protected]>
+Date: Tue, 9 May 2017 13:46:18 -0400
+Subject: [PATCH] fix cross compiling issues
+
+the po directory doesn't have a makefile.
+doc wants help2man that isn't supported by buildroot.
+
+Remove both of these references.
+
+Signed-off-by: Adam Duskett <[email protected]>
+---
+ Makefile.am  | 2 --
+ configure.ac | 2 --
+ 2 files changed, 4 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 638c549..8b7fbc4 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -43,9 +43,7 @@ EXTRA_DIST = \
+ 
+ SUBDIRS = \
+ 	src \
+-	doc \
+ 	examples \
+-	po \
+ 	tests \
+ 	tools
+ 
+diff --git a/configure.ac b/configure.ac
+index 55e774b..6c56c36 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -171,11 +171,9 @@ reallocarray dnl  OpenBSD function. We have replacement if not available.
+ 
+ AC_CONFIG_FILES(
+ Makefile
+-doc/Makefile
+ examples/Makefile
+ examples/fastwc/Makefile
+ examples/manual/Makefile
+-po/Makefile.in
+ src/Makefile
+ tools/Makefile
+ tests/Makefile
+-- 
+2.9.3
+
package/flex/0001-prog-ar.patch deleted +0 -11
deleted file mode 100644
index e0626ff..0000000
@@ -1,11 +0,0 @@
-diff -rup flex-2.5.33.orig/Makefile.in flex-2.5.33/Makefile.in
---- flex-2.5.33.orig/Makefile.in	2007-01-18 17:29:25.000000000 +0100
-+++ flex-2.5.33/Makefile.in	2007-01-18 18:28:22.000000000 +0100
-@@ -105,7 +105,6 @@ am__installdirs = "$(DESTDIR)$(libdir)"
- 	"$(DESTDIR)$(includedir)"
- libLIBRARIES_INSTALL = $(INSTALL_DATA)
- LIBRARIES = $(lib_LIBRARIES)
--AR = ar
- ARFLAGS = cru
- libfl_a_AR = $(AR) $(ARFLAGS)
- libfl_a_LIBADD =
package/flex/0002-fix-CVE-2016-6354.patch deleted +0 -25
deleted file mode 100644
index b0c780b..0000000
@@ -1,25 +0,0 @@
-From a5cbe929ac3255d371e698f62dc256afe7006466 Mon Sep 17 00:00:00 2001
-From: Will Estes <[email protected]>
-Date: Sat, 27 Feb 2016 11:56:05 -0500
-Subject: [PATCH] Fixed incorrect integer type
-
-Signed-off-by: Gustavo Zacarias <[email protected]>
----
-Status: upstream
-
- flex.skl | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/flex.skl b/src/flex.skl
-index 36a526a..64f853d 100644
---- a/flex.skl
-+++ b/flex.skl
-@@ -1703,7 +1703,7 @@ int yyFlexLexer::yy_get_next_buffer()
- 
- 	else
- 		{
--			yy_size_t num_to_read =
-+			int num_to_read =
- 			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
- 
- 		while ( num_to_read <= 0 )
package/flex/flex.hash +1 -1
index b91ab57..fc0463d 100644
@@ -1,2 +1,2 @@
 # Locally computed:
-sha256  bf693433a3effe6b1f42e44abd787491e4e213984b1859545b92267a86088dd3  flex-2.5.37.tar.gz
+sha256  4df278468142e457a9e5f6492a7d39fdb34bd7e7d42ec21b3c382889b34cfefe  flex-v2.6.4.tar.gz
package/flex/flex.mk +11 -15
index 9a3f840..0613c89 100644
@@ -4,27 +4,23 @@
 #
 ################################################################################
 
-FLEX_VERSION = 2.5.37
-FLEX_SITE = http://download.sourceforge.net/project/flex
+FLEX_VERSION = v2.6.4
+FLEX_SITE = $(call github,westes,flex,$(FLEX_VERSION))
 FLEX_INSTALL_STAGING = YES
 FLEX_LICENSE = FLEX
 FLEX_LICENSE_FILES = COPYING
-FLEX_DEPENDENCIES = \
-	$(if $(BR2_PACKAGE_GETTEXT_IF_LOCALE),gettext) host-m4
-FLEX_CONF_ENV = ac_cv_path_M4=/usr/bin/m4
-# we don't have a host-gettext/libintl
-HOST_FLEX_DEPENDENCIES = host-m4
+FLEX_DEPENDENCIES = host-m4 host-gettext
+FLEX_AUTORECONF = YES
+HOST_FLEX_DEPENDENCIES = host-gettext host-m4
 
-define FLEX_DISABLE_PROGRAM
-	$(SED) 's/^bin_PROGRAMS.*//' $(@D)/Makefile.in
+# build-aux/config.rpath is needed but not auto-generated.
+define FLEX_TOUCH_RPATH_CONF
+	mkdir -p $(@D)/build-aux
+	touch $(@D)/build-aux/config.rpath
 endef
-FLEX_POST_PATCH_HOOKS += FLEX_DISABLE_PROGRAM
 
-# flex++ symlink is broken when flex binary is not installed
-define FLEX_REMOVE_BROKEN_SYMLINK
-	rm -f $(TARGET_DIR)/usr/bin/flex++
-endef
-FLEX_POST_INSTALL_TARGET_HOOKS += FLEX_REMOVE_BROKEN_SYMLINK
+FLEX_PRE_CONFIGURE_HOOKS += FLEX_TOUCH_RPATH_CONF
+HOST_FLEX_PRE_CONFIGURE_HOOKS += FLEX_TOUCH_RPATH_CONF
 
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

PATCH 1/1 flex: bump to version v2.6.4

Hi Adam,

Quoted 9 lines · Adam Duskett

Hey Vicente;

Quoted 6 lines · Vicente Olivert Riera

Hello Adam,

I already sent a patch to bump flex to 2.6.4 a couple of days ago. Could
you please review my patch instead?

Quoted 6 lines
Quoted 2 lines

http://patchwork.ozlabs.org/patch/759619/

Sure can!

A quick check indicates that adding BR2_PACKAGE_FLEX_BINARY triggers a legacy build option failure: "flex binary in target option removed"

Uhm..., true, it looks they don't want a flex binary on target. Not even give the opportunity to the user to decide that. I'll send a v2 without that part.

Thanks!

Vincent

Quoted 216 lines

Other than that, it looks to work better than my patch.

Adam

Quoted 212 lines

Thanks,

Vincent

Quoted 207 lines · Adam Duskett

flex.mk:
- The package is now hosted on github not sourceforge.
- autogen.sh is now used, set FLEX_AUTORECONF to YES.
- host-gettext is now required. Without it autoconf fails to run. This is both with host-flex and target-flex.
- The FLEX_DISABLE_PROGRAM define in the makefile has been
removed,
as the only reference to bin_PROGRAMS is now just flex.
- The flex++ symlink is now only generated if the flex binary is installed. As such, FLEX_REMOVE_BROKEN_SYMLINK is no longer
needed.
- Add FLEX_TOUCH_RPATH_CONF define in flex.mk. Autogen.sh fails
if
build-aux/config.rpath doesn't exist. Touching it fixes the
problem.

- Removed 0001-prog-ar.patch, fixed upstream.
- Removed 0002-fix-CVE-2016-6354.patch, applied upstream.

0001-fix-cross-compiling-issues.patch:
- doc requires help2man which isn't supported, and documents
aren't
needed anyways.
- po doesn't have a makefile, and isn't needed for compiling.

---
 package/flex/0001-fix-cross-compiling-issues.patch | 49
++++++++++++++++++++++
 package/flex/0001-prog-ar.patch                    | 11 -----
 package/flex/0002-fix-CVE-2016-6354.patch          | 25 ----------
-
 package/flex/flex.hash                             |  2 +-
 package/flex/flex.mk                               | 26 +++++-----
--
 5 files changed, 61 insertions(+), 52 deletions(-)
 create mode 100644 package/flex/0001-fix-cross-compiling-
issues.patch
 delete mode 100644 package/flex/0001-prog-ar.patch
 delete mode 100644 package/flex/0002-fix-CVE-2016-6354.patch
package/flex/0001-fix-cross-compiling-issues.patch new file +1 -0
new file mode 100644
index 0000000..ef092c5
@@ -0,0 +1,49 @@
+From 31985a4183654c884240c3740f8a24212f8794c2 Mon Sep 17 00:00:00

2001

package/flex/0001-fix-cross-compiling-issues.patch new file +34 -0
+From: Adam Duskett <[email protected]>
+Date: Tue, 9 May 2017 13:46:18 -0400
+Subject: [PATCH] fix cross compiling issues
+
+the po directory doesn't have a makefile.
+doc wants help2man that isn't supported by buildroot.
+
+Remove both of these references.
+
+Signed-off-by: Adam Duskett <[email protected]>
+---
+ Makefile.am  | 2 --
+ configure.ac | 2 --
+ 2 files changed, 4 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 638c549..8b7fbc4 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -43,9 +43,7 @@ EXTRA_DIST = \
+ 
+ SUBDIRS = \
+ 	src \
+-	doc \
+ 	examples \
+-	po \
+ 	tests \
+ 	tools
+ 
+diff --git a/configure.ac b/configure.ac
+index 55e774b..6c56c36 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -171,11 +171,9 @@ reallocarray dnl  OpenBSD function. We have

replacement if not available.
+
+ AC_CONFIG_FILES(
+ Makefile
+-doc/Makefile
+ examples/Makefile
+ examples/fastwc/Makefile
+ examples/manual/Makefile
+-po/Makefile.in
+ src/Makefile
+ tools/Makefile
+ tests/Makefile
+--
+2.9.3

package/flex/0001-fix-cross-compiling-issues.patch new file +1 -0
+
package/flex/0001- renamed from package/flex/0001-prog-ar.patch +0 -0

prog-ar.patch
deleted file mode 100644
index e0626ff..0000000

package/flex/0001-prog-ar.patch deleted +0 -2
@@ -1,11 +0,0 @@
-diff -rup flex-2.5.33.orig/Makefile.in flex-2.5.33/Makefile.in
---- flex-2.5.33.orig/Makefile.in	2007-01-18

17:29:25.000000000 +0100
-+++ flex-2.5.33/Makefile.in 2007-01-18 18:28:22.000000000
+0100
-@@ -105,7 +105,6 @@ am__installdirs = "$(DESTDIR)$(libdir)"

package/flex/0001-prog-ar.patch deleted +0 -7
- 	"$(DESTDIR)$(includedir)"
- libLIBRARIES_INSTALL = $(INSTALL_DATA)
- LIBRARIES = $(lib_LIBRARIES)
--AR = ar
- ARFLAGS = cru
- libfl_a_AR = $(AR) $(ARFLAGS)
- libfl_a_LIBADD =
package/flex/0002-fix-CVE-2016-6354.patch deleted +0 -1
deleted file mode 100644
index b0c780b..0000000
@@ -1,25 +0,0 @@
-From a5cbe929ac3255d371e698f62dc256afe7006466 Mon Sep 17 00:00:00

2001

package/flex/0002-fix-CVE-2016-6354.patch deleted +0 -22
-From: Will Estes <[email protected]>
-Date: Sat, 27 Feb 2016 11:56:05 -0500
-Subject: [PATCH] Fixed incorrect integer type
-
-Signed-off-by: Gustavo Zacarias <[email protected]>
----
-Status: upstream
-
- flex.skl | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/flex.skl b/src/flex.skl
-index 36a526a..64f853d 100644
---- a/flex.skl
-+++ b/flex.skl
-@@ -1703,7 +1703,7 @@ int yyFlexLexer::yy_get_next_buffer()
- 
- 	else
- 		{
--			yy_size_t num_to_read =
-+			int num_to_read =
- 			YY_CURRENT_BUFFER_LVALUE->yy_buf_size -

number_to_move - 1;
-

package/flex/0002-fix-CVE-2016-6354.patch deleted +0 -1
- 		while ( num_to_read <= 0 )
package/flex/flex.hash +0 -1
index b91ab57..fc0463d 100644
@@ -1,2 +1,2 @@
 # Locally computed:
-sha256  bf693433a3effe6b1f42e44abd787491e4e213984b1859545b92267a86

088dd3 flex-2.5.37.tar.gz
+sha256 4df278468142e457a9e5f6492a7d39fdb34bd7e7d42ec21b3c382889b3 4cfefe flex-v2.6.4.tar.gz

package/flex/flex.mk +11 -15
index 9a3f840..0613c89 100644
@@ -4,27 +4,23 @@
 #
 ##################################################################
 ##############
 
-FLEX_VERSION = 2.5.37
-FLEX_SITE = http://download.sourceforge.net/project/flex
+FLEX_VERSION = v2.6.4
+FLEX_SITE = $(call github,westes,flex,$(FLEX_VERSION))
 FLEX_INSTALL_STAGING = YES
 FLEX_LICENSE = FLEX
 FLEX_LICENSE_FILES = COPYING
-FLEX_DEPENDENCIES = \
-	$(if $(BR2_PACKAGE_GETTEXT_IF_LOCALE),gettext) host-m4
-FLEX_CONF_ENV = ac_cv_path_M4=/usr/bin/m4
-# we don't have a host-gettext/libintl
-HOST_FLEX_DEPENDENCIES = host-m4
+FLEX_DEPENDENCIES = host-m4 host-gettext
+FLEX_AUTORECONF = YES
+HOST_FLEX_DEPENDENCIES = host-gettext host-m4
 
-define FLEX_DISABLE_PROGRAM
-	$(SED) 's/^bin_PROGRAMS.*//' $(@D)/Makefile.in
+# build-aux/config.rpath is needed but not auto-generated.
+define FLEX_TOUCH_RPATH_CONF
+	mkdir -p $(@D)/build-aux
+	touch $(@D)/build-aux/config.rpath
 endef
-FLEX_POST_PATCH_HOOKS += FLEX_DISABLE_PROGRAM
 
-# flex++ symlink is broken when flex binary is not installed
-define FLEX_REMOVE_BROKEN_SYMLINK
-	rm -f $(TARGET_DIR)/usr/bin/flex++
-endef
-FLEX_POST_INSTALL_TARGET_HOOKS += FLEX_REMOVE_BROKEN_SYMLINK
+FLEX_PRE_CONFIGURE_HOOKS += FLEX_TOUCH_RPATH_CONF
+HOST_FLEX_PRE_CONFIGURE_HOOKS += FLEX_TOUCH_RPATH_CONF
 
 $(eval $(autotools-package))

$(eval $(host-autotools-package))