]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/flex/0002-build-make-it-possible-to-disable-the-build-of-the-f.patch
lrzsz: install symlinks for XMODEM and YMODEM
[coffee/buildroot.git] / package / flex / 0002-build-make-it-possible-to-disable-the-build-of-the-f.patch
1 From da21733178b34eea303964db5a05e8a3ee4095b4 Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Sat, 26 Aug 2017 15:17:06 +0200
4 Subject: [PATCH] build: make it possible to disable the build of the flex
5  program
6
7 The flex program uses fork(), which isn't available on noMMU
8 systems. However, the libfl library does not use fork(), and be used
9 by other programs/libraries.
10
11 Therefore, it makes sense to provide an option to disable the build of
12 the flex program.
13
14 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
15 Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
16
17 ---
18 Submitted-upstream: https://github.com/westes/flex/pull/256
19 Refused. We'll have to adapt when they do a new release...
20 ---
21  Makefile.am     | 2 ++
22  configure.ac    | 6 ++++++
23  doc/Makefile.am | 4 ++++
24  src/Makefile.am | 3 +++
25  4 files changed, 15 insertions(+)
26
27 diff --git a/Makefile.am b/Makefile.am
28 index e790e9d..8b57bc9 100644
29 --- a/Makefile.am
30 +++ b/Makefile.am
31 @@ -62,8 +62,10 @@ ChangeLog: $(srcdir)/tools/git2cl
32  indent:
33         cd src && $(MAKE) $(AM_MAKEFLAGS) indent
34  
35 +if ENABLE_PROGRAM
36  install-exec-hook:
37         cd $(DESTDIR)$(bindir) && \
38                 $(LN_S) -f flex$(EXEEXT) flex++$(EXEEXT)
39 +endif
40  
41  .PHONY: ChangeLog indent
42 diff --git a/configure.ac b/configure.ac
43 index 8882016..f49872b 100644
44 --- a/configure.ac
45 +++ b/configure.ac
46 @@ -75,6 +75,12 @@ AC_ARG_ENABLE([libfl],
47    [], [enable_libfl=yes])
48  AM_CONDITIONAL([ENABLE_LIBFL], [test "x$enable_libfl" = xyes])
49  
50 +AC_ARG_ENABLE([program],
51 +  [AS_HELP_STRING([--disable-program],
52 +                  [do not build the flex program, only the libfl library])],
53 +  [], [enable_program=yes])
54 +AM_CONDITIONAL([ENABLE_PROGRAM], [test "x$enable_program" = xyes])
55 +
56  # --disable-bootstrap is intended only to workaround problems with bootstrap
57  # (e.g. when cross-compiling flex or when bootstrapping has bugs).
58  # Ideally we should be able to bootstrap even when cross-compiling.
59 diff --git a/src/Makefile.am b/src/Makefile.am
60 index 0d13a5a..c73bc17 100644
61 --- a/src/Makefile.am
62 +++ b/src/Makefile.am
63 @@ -4,7 +4,10 @@ LIBS = @LIBS@
64  
65  m4 = @M4@
66  
67 +if ENABLE_PROGRAM
68  bin_PROGRAMS = flex
69 +endif
70 +
71  if ENABLE_BOOTSTRAP
72  noinst_PROGRAMS = stage1flex
73  endif
74 -- 
75 2.9.4
76