[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] make perl & examples optional
From: |
Mike Frysinger |
Subject: |
[PATCH] make perl & examples optional |
Date: |
Fri, 3 Apr 2015 03:02:43 -0400 |
The normal bison program does not require perl to build or run, so lets
soften that requirement in the configure script. We now warn if its not
found, and we make the examples logic depend on that.
* configure.ac: Change AC_MSG_ERROR to AC_MSG_WARN for perl.
Add an --enable-examples flag.
* Makefile.am: Only include examples/local.mk when ENABLE_EXAMPLES.
---
Makefile.am | 2 ++
configure.ac | 21 ++++++++++++++++++++-
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index b6135cb..50ea0a0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -59,7 +59,9 @@ include data/local.mk
include djgpp/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 6f20040..e67249b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -179,12 +179,31 @@ AC_DEFINE_UNQUOTED([M4_GNU_OPTION], ["$M4_GNU"], [Define
to "-g" if GNU M4
supports -g, otherwise to "".])
AC_PATH_PROG([PERL], [perl])
if test -z "$PERL"; then
- AC_MSG_ERROR([perl not found])
+ AC_MSG_WARN([perl required for the testsuites])
fi
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 "xenable_examples" = xyes])
+
# Checks for header files.
AC_CHECK_HEADERS_ONCE([locale.h])
--
2.3.4
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] make perl & examples optional,
Mike Frysinger <=