Hi,

in Gentoo Linux we are carrying the following patch for quite some time
to make perl dependency which is required for examples optional.

Any chance to get this applied upstream?


-- 
Regards,
Thomas Deutschmann / Gentoo Linux Developer
C4DD 695F A713 8F24 2AA1 5638 5849 7EE5 1D5D 74A5
From 8fcea58bfb3e45cb19ce8a29d0ce10188d866555 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vap...@gentoo.org>
Date: Thu, 12 Dec 2019 08:47:20 +0100
Subject: [PATCH] make perl & examples optional

The normal bison program does not require perl to build or run.
We make the examples logic depend on perl.

* configure.ac: Add an --enable-examples flag.
* Makefile.am: Only include examples/local.mk when ENABLE_EXAMPLES.
---
 Makefile.am  |  2 ++
 configure.ac | 19 +++++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index eeb348e4..934fda65 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -68,7 +68,9 @@ include build-aux/local.mk
 include data/local.mk
 include doc/local.mk
 include etc/local.mk
+if ENABLE_EXAMPLES
 include examples/local.mk
+endif
 include lib/local.mk
 include src/local.mk
 include tests/local.mk
diff --git a/configure.ac b/configure.ac
index 7a80eac1..84fec006 100644
--- a/configure.ac
+++ b/configure.ac
@@ -244,6 +244,25 @@ AM_MISSING_PROG([HELP2MAN], [help2man])
 AC_PATH_PROG([XSLTPROC], [xsltproc])
 AC_SUBST([XSLTPROC])
 
+AC_ARG_ENABLE([examples],
+  [AC_HELP_STRING([--disable-examples],
+    [do not build and install examples])])
+# Enable the examles by default if perl is available.
+case $enable_examples in
+no) ;;
+yes)
+  if test -z "$PERL"; then
+    AC_MSG_ERROR([perl required for the examples])
+  fi
+  ;;
+*)
+  if test -n "$PERL"; then
+    enable_examples=yes
+  fi
+  ;;
+esac
+AM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" = xyes])
+
 # Checks for header files.
 AC_CHECK_HEADERS_ONCE([locale.h])
 
-- 
2.24.1

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to