2011-01-22 Stefano Lattarini <stefano.lattarini@gmail.com>
+ configure: look for a yacc program to be used by the testsuite
+ Instead of forcing the user to manually export 'YACC' in the
+ testsuite to use a non-bison yacc, we now look for a yacc program
+ at configure time, and use that as the default in the testsuite.
+ * configure.ac: Look for a yacc program, using AC_CHECK_PROGS.
+ * tests/defs.in: Updated to use the value of $YACC precomputed by
+ configure, unless the user overrides that in the environment.
+
+2011-01-22 Stefano Lattarini <stefano.lattarini@gmail.com>
+
tests: more coverage on yacc/lex silent-rules, plus minor cleanups
* tests/silent-yacc-gcc.test: Add sanity checks verifying that the
generated Makefile.in files really contains the non-generic rules
STRIP = @STRIP@
TEX = @TEX@
VERSION = @VERSION@
+YACC = @YACC@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
MODIFICATION_DELAY
LN
HELP2MAN
+YACC
TEX
PERL_THREADS
PERL
+# The test suite will skip some tests if no yacc program is available.
+# We don't use AC_PROG_YACC because:
+# 1. we don't want bison to be preferred to system yacc;
+# 2. we don't want $YACC to be defined to 'yacc' by default;
+# 3. we prefer not to have the YFLAGS variable to be AC_SUBST'd,
+# 4. we prefer that the YACC variable is not reported in the
+# configure help screen.
+for ac_prog in yacc byacc 'bison -y'
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_YACC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$YACC"; then
+ ac_cv_prog_YACC="$YACC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_YACC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+YACC=$ac_cv_prog_YACC
+if test -n "$YACC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5
+$as_echo "$YACC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$YACC" && break
+done
+test -n "$YACC" || YACC="false"
+
+
# Generate man pages.
HELP2MAN=${HELP2MAN-"${am_missing_run}help2man"}
# Process this file with autoconf to produce a configure script.
# Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-# 2004, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# 2004, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
+# Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# The test suite will skip some tests if tex is absent.
AC_CHECK_PROG([TEX], [tex], [tex])
+# The test suite will skip some tests if no yacc program is available.
+# We don't use AC_PROG_YACC because:
+# 1. we don't want bison to be preferred to system yacc;
+# 2. we don't want $YACC to be defined to 'yacc' by default;
+# 3. we prefer not to have the YFLAGS variable to be AC_SUBST'd,
+# 4. we prefer that the YACC variable is not reported in the
+# configure help screen.
+AC_CHECK_PROGS([YACC], [yacc byacc 'bison -y'], [false])
+
# Generate man pages.
AM_MISSING_PROG([HELP2MAN], [help2man])
STRIP = @STRIP@
TEX = @TEX@
VERSION = @VERSION@
+YACC = @YACC@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
STRIP = @STRIP@
TEX = @TEX@
VERSION = @VERSION@
+YACC = @YACC@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
STRIP = @STRIP@
TEX = @TEX@
VERSION = @VERSION@
+YACC = @YACC@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
STRIP = @STRIP@
TEX = @TEX@
VERSION = @VERSION@
+YACC = @YACC@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
STRIP = @STRIP@
TEX = @TEX@
VERSION = @VERSION@
+YACC = @YACC@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
STRIP = @STRIP@
TEX = @TEX@
VERSION = @VERSION@
+YACC = @YACC@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
STRIP = @STRIP@
TEX = @TEX@
VERSION = @VERSION@
+YACC = @YACC@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
export SHELL
# User can override various tools used.
test -z "$PERL" && PERL='@PERL@'
+test -z "$YACC" && YACC='@YACC@'
test -z "$MAKE" && MAKE=make
test -z "$AUTOCONF" && AUTOCONF="@am_AUTOCONF@"
test -z "$AUTOHEADER" && AUTOHEADER="@am_AUTOHEADER@"
( texi2dvi -o /dev/null --version ) || exit 77
;;
yacc)
- if test x"$YACC" = x"no"; then
- # The user has explicitly told he doesn't want a yacc program
- # to be used.
- echo "$me: \$YACC is \"no\", skipping test" >&2
+ if test x"$YACC" = x"false"; then
+ # No yacc program was found at configure time, or the user has
+ # explicitly told he doesn't want a yacc program to be used.
+ echo "$me: \$YACC is \"false\", skipping test" >&2
exit 77
- elif test -z "$YACC"; then
- # The user hasn't explicitly specified any yacc program in the
- # environment, so we try to use bison, skipping the test if it's
- # not found.
- YACC='bison -y'
+ else
+ # Make YACC available to configure by exporting it.
export YACC
- echo "$me: running bison --version"
- bison --version || exit 77
fi
;;
# Generic case: the tool must support --version.