flex: only prevent the flex binary to be built for target, not for host
authorVicente Olivert Riera <Vincent.Riera@imgtec.com>
Tue, 23 May 2017 10:22:01 +0000 (11:22 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 23 May 2017 13:48:02 +0000 (15:48 +0200)
We do want to build the flex binary when building host-flex since it's
needed as a build dependency for other packages.

Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/flex/0001-flex-disable-documentation.patch [new file with mode: 0644]
package/flex/0001-flex-disable-flex-binary-and-documentation.patch [deleted file]
package/flex/flex.mk

diff --git a/package/flex/0001-flex-disable-documentation.patch b/package/flex/0001-flex-disable-documentation.patch
new file mode 100644 (file)
index 0000000..68bec12
--- /dev/null
@@ -0,0 +1,23 @@
+flex: disable documentation
+
+Since we prevent the flex binary to be built, we also need to prevent
+the documentation to be built, otherwise it will fail like this:
+
+Making all in doc
+make[2]: Entering directory '/br/output/build/flex-2.6.4/doc'
+make[2]: *** No rule to make target '../src/flex', needed by 'flex.1'.
+Stop.
+
+Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
+
+diff -rup a/Makefile.in b/Makefile.in
+--- a/Makefile.in      2017-05-06 15:49:09.000000000 +0100
++++ b/Makefile.in      2017-05-10 14:35:20.152794902 +0100
+@@ -450,7 +450,6 @@ EXTRA_DIST = \
+ SUBDIRS = \
+       src \
+-      doc \
+       examples \
+       po \
+       tests \
diff --git a/package/flex/0001-flex-disable-flex-binary-and-documentation.patch b/package/flex/0001-flex-disable-flex-binary-and-documentation.patch
deleted file mode 100644 (file)
index d035ef4..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-flex: prevent flex binary to be built
-
-Since we prevent the flex binary to be built, we also need to prevent
-the documentation to be built, otherwise it will fail like this:
-
-Making all in doc
-make[2]: Entering directory '/br/output/build/flex-2.6.4/doc'
-make[2]: *** No rule to make target '../src/flex', needed by 'flex.1'.
-Stop.
-
-Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
-
-diff -rup a/Makefile.in b/Makefile.in
---- a/Makefile.in      2017-05-06 15:49:09.000000000 +0100
-+++ b/Makefile.in      2017-05-10 14:35:20.152794902 +0100
-@@ -450,7 +450,6 @@ EXTRA_DIST = \
- SUBDIRS = \
-       src \
--      doc \
-       examples \
-       po \
-       tests \
-diff -rup a/src/Makefile.in b/src/Makefile.in
---- a/src/Makefile.in  2017-05-06 15:49:09.000000000 +0100
-+++ b/src/Makefile.in  2017-05-10 14:35:01.918464036 +0100
-@@ -90,7 +90,7 @@ PRE_UNINSTALL = :
- POST_UNINSTALL = :
- build_triplet = @build@
- host_triplet = @host@
--bin_PROGRAMS = flex$(EXEEXT)
-+bin_PROGRAMS =
- @ENABLE_BOOTSTRAP_TRUE@noinst_PROGRAMS = stage1flex$(EXEEXT)
- @CROSS_TRUE@am__append_1 = \
- @CROSS_TRUE@                ../lib/malloc.c \
index 81cbdc1b727c5e6c8c23669892c12b5327859f83..aa6c026ee0ca76a5fbcc7cfaffb12c73da7d0b7f 100644 (file)
@@ -15,6 +15,11 @@ FLEX_CONF_ENV = ac_cv_path_M4=/usr/bin/m4
 # we don't have a host-gettext/libintl
 HOST_FLEX_DEPENDENCIES = host-m4
 
+define FLEX_DISABLE_PROGRAM
+       $(SED) 's/^bin_PROGRAMS.*//' $(@D)/src/Makefile.in
+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++