0002-build-make-it-possible-to-disable-the-build-of-the-f.patch 2.2 KB

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