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
