automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.12.3-57-


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.12.3-57-g0494881
Date: Wed, 31 Oct 2012 12:42:39 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=0494881b53d6a125c1e4feeb03101de351085a1b

The branch, maint has been updated
       via  0494881b53d6a125c1e4feeb03101de351085a1b (commit)
       via  040b69aea1c3ea7fdfd7d832cf07a2ae4ea019da (commit)
       via  88c20167092e716ddf51affdd0d632c014ec009c (commit)
       via  f1c6ce7b7496af767b9fb45d897ed942a682cc57 (commit)
       via  aecd1be61c2d27618a594842501b58bd4ddd8991 (commit)
       via  3f20803ca180b8d2994f9dce3665ea87fe43c67c (commit)
       via  0e3d9b3e3ca9bf308c6f10b3ff3189955e208b66 (commit)
       via  1b187099d61143733e35ff58bfc6a0cedd2e2322 (commit)
       via  9fe696bc9d6654a972d99f524c14a22fdc429e79 (commit)
       via  6ecb0a537da242b2b6e3c42b139f4dc27b121faa (commit)
       via  2ff17a8e6e8a8b9a852dfd792720c6d652183ca4 (commit)
       via  df6303ec01ceffb74eaf1f201c6d575efa99bff6 (commit)
       via  df202a3e6412b530a052e0a1f6de6307faae19a0 (commit)
      from  bf016cee0efa2dd3594513791f588b47fa5c456f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 .gitignore                                         |    1 +
 Makefile.am                                        |   26 +++++-
 NEWS                                               |   24 ++++
 THANKS                                             |    2 +
 doc/automake.texi                                  |   26 +++--
 m4/vala.m4                                         |   34 ++++--
 t/ax/shell-no-trail-bslash.in                      |   76 +++++++++++++
 t/list-of-tests.mk                                 |    2 +-
 t/parallel-tests-trailing-bslash.sh                |  113 --------------------
 t/per-target-flags.sh                              |    2 +-
 ...kdir.sh => self-check-shell-no-trail-bslash.sh} |   34 ++++--
 t/vala-headers.sh                                  |    2 +-
 t/vala-libs.sh                                     |    2 +-
 t/vala-mix.sh                                      |    2 +-
 t/vala-mix2.sh                                     |    2 +-
 t/vala-parallel.sh                                 |    2 +-
 t/vala-vapi.sh                                     |    2 +-
 t/vala-vpath.sh                                    |    2 +-
 t/vala.sh                                          |    2 +-
 t/vala2.sh                                         |    2 +-
 t/vala3.sh                                         |    2 +-
 t/vala4.sh                                         |   97 +++++++++++++----
 t/vala5.sh                                         |    2 +-
 23 files changed, 277 insertions(+), 182 deletions(-)
 create mode 100644 t/ax/shell-no-trail-bslash.in
 delete mode 100755 t/parallel-tests-trailing-bslash.sh
 copy t/{aclocal-no-install-no-mkdir.sh => self-check-shell-no-trail-bslash.sh} 
(51%)

diff --git a/.gitignore b/.gitignore
index c3e83f9..3bcdc9d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,6 +37,7 @@
 /t/wrap/aclocal-1.*
 /t/wrap/automake-1.*
 /t/ax/test-defs.sh
+/t/ax/shell-no-trail-bslash
 /t/testsuite-part.am
 /t/*-w.tap
 /t/*-w.sh
diff --git a/Makefile.am b/Makefile.am
index a48ab82..45bf2fc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -423,6 +423,19 @@ EXTRA_DIST += t/ax/test-defs.in
 CLEANFILES += t/ax/test-defs.sh
 nodist_noinst_DATA = t/ax/test-defs.sh
 
+noinst_SCRIPTS = # Will be updated soon.
+
+t/ax/shell-no-trail-bslash: t/ax/shell-no-trail-bslash.in Makefile
+       $(AM_V_at)rm -f $@ address@hidden
+       $(AM_V_GEN)in=t/ax/shell-no-trail-bslash.in \
+         && $(MKDIR_P) t/ax \
+         && $(do_subst) <$(srcdir)/$$in >address@hidden \
+         && chmod a+x address@hidden
+       $(generated_file_finalize)
+EXTRA_DIST += t/ax/shell-no-trail-bslash.in
+CLEANFILES += t/ax/shell-no-trail-bslash
+noinst_SCRIPTS += t/ax/shell-no-trail-bslash
+
 runtest: runtest.in Makefile
        $(AM_V_at)rm -f $@ address@hidden
        $(AM_V_GEN)in=runtest.in \
@@ -432,7 +445,7 @@ runtest: runtest.in Makefile
        $(generated_file_finalize)
 EXTRA_DIST += runtest.in
 CLEANFILES += runtest
-noinst_SCRIPTS = runtest
+noinst_SCRIPTS += runtest
 
 # If two test scripts have the same basename, they will end up sharing
 # the same log file, leading to all sort of undefined and undesired
@@ -484,6 +497,17 @@ check-tests-syntax:
 check-local: check-tests-syntax
 .PHONY: check-tests-syntax
 
+# Recipes with a trailing backslash character (possibly followed by
+# blank characters only) can cause spurious syntax errors with at
+# least older bash versions (e.g., bash 2.05b), and can be potentially
+# be unportable to other weaker shells.  Run the testsuite in a way
+# that helps catching such problems in Automake-generated recipes.
+# See automake bug#10436.
+check-no-trailing-backslash-in-recipes:
+       $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) check \
+         CONFIG_SHELL='$(abs_top_builddir)/t/ax/shell-no-trail-bslash'
+.PHONY: check-no-trailing-backslash-in-recipes
+
 ## Checking the list of tests.
 test_subdirs = t t/pm
 include $(srcdir)/t/CheckListOfTests.am
diff --git a/NEWS b/NEWS
index 1c8c401..6377234 100644
--- a/NEWS
+++ b/NEWS
@@ -61,6 +61,30 @@ New in 1.12.5:
     giving more useful warnings than a bare "command not found" from a
     make recipe would.
 
+* Vala support:
+
+  - The AM_PROG_VALAC macro has been enhanced to takes two further
+    optional arguments; it's signature now being
+
+        AM_PROG_VALAC([MINIMUM-VERSION], [ACTION-IF-FOUND],
+                      [ACTION-IF-NOT-FOUND])
+
+  - By default, AM_PROG_VALAC no longer aborts the configure invocation
+    if the Vala compiler found is too old, but simply prints a warning
+    messages (as it did when the Vala compiler was not found).  This
+    should avoid unnecessary difficulties for end users that just want
+    to compile the unmodified, distributed Vala-generated C sources,
+    but happens to have an old Vala compiler in their PATH.  This fixes
+    automake bug#12688.
+
+  - If no proper Vala compiler is found at configure runtime, AM_PROG_VALAC
+    will set the AC_SUBST'd variable 'VALAC' to 'valac' rather than to ':'.
+    This is a better default, because with it a triggered makefile rule
+    invoking a Vala compilation will clearly fail with an informative error
+    message like "valac: command not found", rather than silently, with
+    the error possibly going unnoticed or triggering harder-to-diagnose
+    fallout failures in later steps.
+
 Bugs fixed in 1.12.5:
 
 * Long-standing bugs:
diff --git a/THANKS b/THANKS
index 88f539c..1ff7c08 100644
--- a/THANKS
+++ b/THANKS
@@ -247,6 +247,7 @@ Matthew D. Langston             address@hidden
 Matthias Andree                 address@hidden
 Matthias Clasen                 address@hidden
 Matthias Klose                  address@hidden
+Matthieu Baerts                 address@hidden
 Max Horn                        address@hidden
 Maxim Sinev                     address@hidden
 Maynard Johnson                 address@hidden
@@ -348,6 +349,7 @@ Sam Steingold                   address@hidden
 Sander Niemeijer                address@hidden
 Santiago Vila                   address@hidden
 Scott James Remnant             address@hidden
+Sébastien Wilmet                address@hidden
 Sergey Poznyakoff               address@hidden
 Sergey Vlasov                   address@hidden
 Seth Alves                      address@hidden
diff --git a/doc/automake.texi b/doc/automake.texi
index 914c1e8..7289d85 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -6876,28 +6876,32 @@ foo_SOURCES = foo.vala bar.vala zardoc.c
 @end example
 
 Any @file{.vala} file listed in a @code{_SOURCES} variable will be
-compiled into C code by the Vala compiler. The generated @file{.c} files are
-distributed. The end user does not need to have a Vala compiler installed.
+compiled into C code by the Vala compiler. The generated @file{.c} files
+are distributed. The end user does not need to have a Vala compiler installed.
 
 Automake ships with an Autoconf macro called @code{AM_PROG_VALAC}
 that will locate the Vala compiler and optionally check its version
 number.
 
address@hidden AM_PROG_VALAC (@ovar{minimum-version})
-Try to find a Vala compiler in @env{PATH}. If it is found, the variable
address@hidden is set. Optionally a minimum release number of the compiler
-can be requested:
-
address@hidden
-AM_PROG_VALAC([0.7.0])
address@hidden example
address@hidden AM_PROG_VALAC (@ovar{minimum-version}, @ovar{action-if-found},
+  @ovar{action-if-not-found})
+Search for a Vala compiler in @env{PATH}.  If it is found, the variable
address@hidden is set to point to it (see below for more details).  This
+macro takes three optional arguments.  The first argument, if present,
+is the minimum version of the Vala compiler required to compile this
+package.  If a compiler is found and satisfies @var{minimum-version},
+then @var{action-if-found} is run (this defaults to do nothing).
+Otherwise, @var{action-if-not-found} is run.  If @var{action-if-not-found}
+is not specified, the default value is to print a warning in case no
+compiler is found, or if a too-old version of the compiler is found.
 @end defmac
 
 There are a few variables that are used when compiling Vala sources:
 
 @vtable @code
 @item VALAC
-Path to the Vala compiler.
+Absolute path to the Vala compiler, or simply @samp{valac} if no
+suitable compiler Vala could be found at configure runtime.
 
 @item VALAFLAGS
 Additional arguments for the Vala compiler.
diff --git a/m4/vala.m4 b/m4/vala.m4
index 5dad452..2355c85 100644
--- a/m4/vala.m4
+++ b/m4/vala.m4
@@ -6,22 +6,32 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# Check whether the Vala compiler exists in $PATH. If it is found, the
-# variable VALAC is set. Optionally a minimum release number of the
-# compiler can be requested.
+# Check whether the Vala compiler exists in $PATH.  If it is found, the
+# variable VALAC is set pointing to its absolute path.  Otherwise, it is
+# simply set to 'valac'.
+# Optionally a minimum release number of the compiler can be requested.
+# If the ACTION-IF-FOUND parameter is given, it will be run if a proper
+# Vala compiler is found.
+# Similarly, if the ACTION-IF-FOUND is given, it will be run if no proper
+# Vala compiler is found.  It defaults to simply print a warning about the
+# situation, but otherwise proceeding with the configuration.
 #
-# AM_PROG_VALAC([MINIMUM-VERSION])
-# --------------------------------
+# AM_PROG_VALAC([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# --------------------------------------------------------------------------
 AC_DEFUN([AM_PROG_VALAC],
-[AC_PATH_PROG([VALAC], [valac], [])
- AS_IF([test -z "$VALAC"],
-   [AC_MSG_WARN([No Vala compiler found.  You will not be able to compile 
.vala source files.])],
-   [AS_IF([test -n "$1"],
-      [AC_MSG_CHECKING([$VALAC is at least version $1])
+  [AC_PATH_PROG([VALAC], [valac], [valac])
+   AS_IF([test "$VALAC" != valac && test -n "$1"],
+      [AC_MSG_CHECKING([whether $VALAC is at least version $1])
        am__vala_version=`$VALAC --version | sed 's/Vala  *//'`
        AS_VERSION_COMPARE([$1], ["$am__vala_version"],
          [AC_MSG_RESULT([yes])],
          [AC_MSG_RESULT([yes])],
          [AC_MSG_RESULT([no])
-          AC_MSG_ERROR([Vala $1 not found.], [77])])])])
-])
+          VALAC=valac])])
+    if test "$VALAC" = valac; then
+      m4_default([$3],
+        [AC_MSG_WARN([no proper vala compiler found])
+         AC_MSG_WARN([you will not be able to compile vala source files])])
+    else
+      m4_default([$2], [:])
+    fi])
diff --git a/t/ax/shell-no-trail-bslash.in b/t/ax/shell-no-trail-bslash.in
new file mode 100644
index 0000000..3475398
--- /dev/null
+++ b/t/ax/shell-no-trail-bslash.in
@@ -0,0 +1,76 @@
+#! @AM_TEST_RUNNER_SHELL@
+# Copyright (C) 2012 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 Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# A "shell" that chokes on '-c' commands having a trailing '\' character
+# (possibly followed by whitespace only).  This is to emulate problems
+# seen in older bash versions (e.g., bash 2.05b).
+# See also automake bug#10436.
+
+set -e
+set -u
+
+am_SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'}
+
+tab='  '
+nl='
+'
+am_shell_flags=
+am_shell_command=; unset am_shell_command
+while test $# -gt 0; do
+  case $1 in
+    # If the shell is invoked by make e.g. as "sh -ec" (seen on
+    # GNU make in POSIX mode) or "sh -ce" (seen on Solaris make).
+    -*c*)
+        am_flg=$(printf '%s\n' "$1" | sed -e 's/^-//' -e 's/c//g')
+        if test x"$am_flg" != x; then
+          am_shell_flags="$am_shell_flags -$am_flg"
+        fi
+        am_shell_command=$2
+        shift;;
+    -?*)
+        am_shell_flags="$am_shell_flags $1";;
+      *)
+        break;;
+  esac
+  shift
+done
+
+if test x${am_shell_command+"set"} != x"set"; then
+  # Some make implementations, like *BSD's, pass the recipes to the shell
+  # through its standard input.  Trying to run our extra checks in this
+  # case would be too tricky, so we just skip them.
+  exec $am_SHELL $am_shell_flags ${1+"$@"}
+fi
+
+case $am_shell_command in
+  *" "|*"$tab"|*"$nl")
+    am_tweaked_shell_command=$(printf '%s\n' "$am_shell_command" \
+                                 | tr -d " $tab$nl");;
+  *)
+    am_tweaked_shell_command=$am_shell_command;;
+esac
+
+case $am_tweaked_shell_command in
+  *\\)
+    printf '%s\n' "$0: recipe ends with backslash character" >&2
+    printf '%s\n' "=== BEGIN recipe" >&2
+    printf '%s\n' "${am_shell_command-}" >&2
+    printf '%s\n' "=== END recipe" >&2
+    exit 1
+    ;;
+esac
+
+exec $am_SHELL $am_shell_flags -c "$am_shell_command" ${1+"$@"}
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index e38e7ff..4d84940 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -789,7 +789,6 @@ t/parallel-tests-no-spurious-summary.sh \
 t/parallel-tests-exit-statuses.sh \
 t/parallel-tests-console-output.sh \
 t/parallel-tests-once.sh \
-t/parallel-tests-trailing-bslash.sh \
 t/tests-environment.sh \
 t/am-tests-environment.sh \
 t/tests-environment-backcompat.sh \
@@ -958,6 +957,7 @@ t/self-check-is_newest.tap \
 t/self-check-me.tap \
 t/self-check-report.sh \
 t/self-check-seq.tap \
+t/self-check-shell-no-trail-bslash.sh \
 t/self-check-is-blocked-signal.tap \
 t/self-check-unindent.tap \
 t/sanity.sh \
diff --git a/t/parallel-tests-trailing-bslash.sh 
b/t/parallel-tests-trailing-bslash.sh
deleted file mode 100755
index dadc874..0000000
--- a/t/parallel-tests-trailing-bslash.sh
+++ /dev/null
@@ -1,113 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2012 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 Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Check that the new testsuite harness do not generate recipes that can
-# have a trailing '\', since that can cause spurious syntax errors with
-# older bash versions (e.g., bash 2.05b).
-# See automake bug#10436.
-
-. ./defs || exit 1
-
-echo AC_OUTPUT >> configure.ac
-
-cat > Makefile.am <<'END'
-TESTS = foo.test
-EXTRA_DIST = $(TESTS)
-am__backslash = \\ # foo
-.PHONY: bad-recipe
-bad-recipe:
-       @printf '%s\n' $(am__backslash)
-END
-
-cat > foo.test <<'END'
-#!/bin/sh
-exit 0
-END
-chmod +x foo.test
-
-am__SHELL=$SHELL; export am__SHELL
-am__PERL=$PERL; export am__PERL
-
-cat > my-shell <<'END'
-#!/bin/sh -e
-set -u
-tab='  '
-nl='
-'
-am__shell_flags=
-am__shell_command=; unset am__shell_command
-while test $# -gt 0; do
-  case $1 in
-    # If the shell is invoked by make e.g. as "sh -ec" (seen on
-    # GNU make in POSIX mode) or "sh -ce" (seen on Solaris make).
-    -*c*)
-        flg=`echo x"$1" | sed -e 's/^x-//' -e 's/c//g'`
-        if test x"$flg" != x; then
-          am__shell_flags="$am__shell_flags -$flg"
-        fi
-        am__shell_command=$2
-        shift
-        ;;
-    -?*)
-        am__shell_flags="$am__shell_flags $1"
-        ;;
-      *)
-        break
-        ;;
-  esac
-  shift
-done
-if test x${am__shell_command+"set"} != x"set"; then
-  # Some make implementations, like *BSD's, pass the recipes to the shell
-  # through its standard input.  Trying to run our extra checks in this
-  # case would be too tricky, so we just skip them.
-  exec $am__SHELL $am__shell_flags ${1+"$@"}
-else
-  am__tweaked_shell_command=`printf '%s\n' "$am__shell_command" \
-    | tr -d " $tab$nl"`
-  case ${am__tweaked_shell_command-} in
-    *\\)
-      echo "my-shell: recipe ends with backslash character" >&2
-      printf '%s\n' "=== BEGIN recipe" >&2
-      printf '%s\n' "${am__shell_command-}" >&2
-      printf '%s\n' "=== END recipe" >&2
-      exit 99
-      ;;
-  esac
-  exec $am__SHELL $am__shell_flags -c "$am__shell_command" ${1+"$@"}
-fi
-END
-chmod a+x my-shell
-
-cat my-shell
-
-CONFIG_SHELL=$(pwd)/my-shell; export CONFIG_SHELL
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
-
-./configure CONFIG_SHELL="$CONFIG_SHELL"
-
-st=0
-$MAKE bad-recipe 2>stderr && st=1
-cat stderr >&2
-$FGREP "my-shell: recipe ends with backslash character" stderr || st=1
-test $st -eq 0 || skip_ "can't catch trailing backslashes in make recipes"
-
-$MAKE check
-
-:
diff --git a/t/per-target-flags.sh b/t/per-target-flags.sh
index e5278fb..4114079 100755
--- a/t/per-target-flags.sh
+++ b/t/per-target-flags.sh
@@ -17,7 +17,7 @@
 # Test executable-specific and library-specific flags, both with
 # and without dependency tracking.
 
-. ./defs || Exit 1
+. test-init.sh
 
 makefiles='Makefile libMakefile Makefile2 libMakefile2'
 
diff --git a/t/aclocal-no-install-no-mkdir.sh 
b/t/self-check-shell-no-trail-bslash.sh
similarity index 51%
copy from t/aclocal-no-install-no-mkdir.sh
copy to t/self-check-shell-no-trail-bslash.sh
index 5b47768..48cfb7f 100755
--- a/t/aclocal-no-install-no-mkdir.sh
+++ b/t/self-check-shell-no-trail-bslash.sh
@@ -14,23 +14,33 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Check that aclocal does not create a non-existent local m4 directory
-# if the '--install' option is not given.
+# Check that our fake "shell" used to guard against use of trailing
+# backslashes in recipes actually complains when those are used.
 
+# Our hack doesn't work with some make implementations (see comments
+# in 't/ax/shell-no-trail-bslash.in' for more details).
+required=GNUmake
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
-cat > configure.ac <<END
-AC_INIT([$me], [1.0])
-MY_MACRO
+cat >> Makefile <<'END'
+am__backslash = \\ # foo
+.PHONY: good bad
+good:
+       @printf '%s\n' OK
+.PHONY: bad
+bad:
+       @echo $(am__backslash)
 END
 
-mkdir sys-acdir
-cat > sys-acdir/my-defs.m4 <<END
-AC_DEFUN([MY_MACRO], [:])
-END
+SHELL=$am_testauxdir/shell-no-trail-bslash
+$SHELL -c 'exit 0'
+test "$($SHELL -c 'echo is  o\k')" = "is ok"
+
+$MAKE good
 
-$ACLOCAL -I foo --system-acdir=sys-acdir && exit 1
-test ! -e foo
+$MAKE bad SHELL="$SHELL" 2>stderr && { cat stderr >&2; exit 1; }
+cat stderr >&2
+$FGREP "recipe ends with backslash character" stderr
 
 :
diff --git a/t/vala-headers.sh b/t/vala-headers.sh
index 48dbf81..79a7b27 100755
--- a/t/vala-headers.sh
+++ b/t/vala-headers.sh
@@ -17,7 +17,7 @@
 # Test to make sure compiling Vala code really works with recursive make.
 
 required="pkg-config valac gcc GNUmake"
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/vala-libs.sh b/t/vala-libs.sh
index f6a7ba9..c38740f 100755
--- a/t/vala-libs.sh
+++ b/t/vala-libs.sh
@@ -18,7 +18,7 @@
 # And use of vapi files to call C code from Vala.
 
 required="valac cc pkg-config libtoolize GNUmake"
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/vala-mix.sh b/t/vala-mix.sh
index 2580bd0..5e2e7ce 100755
--- a/t/vala-mix.sh
+++ b/t/vala-mix.sh
@@ -17,7 +17,7 @@
 # Vala sources and C sources in the same program.  Functional test.
 
 required='valac cc GNUmake'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_PROG_CC
diff --git a/t/vala-mix2.sh b/t/vala-mix2.sh
index e1dbb5d..9b2402d 100755
--- a/t/vala-mix2.sh
+++ b/t/vala-mix2.sh
@@ -18,7 +18,7 @@
 # program.  Functional test.  See automake bug#10894.
 
 required='valac cc c++ GNUmake'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_PROG_CC
diff --git a/t/vala-parallel.sh b/t/vala-parallel.sh
index d03080d..c71420a 100755
--- a/t/vala-parallel.sh
+++ b/t/vala-parallel.sh
@@ -17,7 +17,7 @@
 # Vala support with parallel make.
 
 required='valac cc GNUmake'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_PROG_CC
diff --git a/t/vala-vapi.sh b/t/vala-vapi.sh
index 2f332da..f006832 100755
--- a/t/vala-vapi.sh
+++ b/t/vala-vapi.sh
@@ -17,7 +17,7 @@
 # Test and that vapi files are correctly handled by Vala support.
 
 required='valac cc GNUmake'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_PROG_CC
diff --git a/t/vala-vpath.sh b/t/vala-vpath.sh
index 9874f68..7428b97 100755
--- a/t/vala-vpath.sh
+++ b/t/vala-vpath.sh
@@ -18,7 +18,7 @@
 # See automake bug#8753.
 
 required="cc valac GNUmake"
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_SRCDIR([hello.vala])
diff --git a/t/vala.sh b/t/vala.sh
index 9e48549..4869a61 100755
--- a/t/vala.sh
+++ b/t/vala.sh
@@ -16,7 +16,7 @@
 
 # Basic "grepping" test on vala support.
 
-. ./defs || exit 1
+. test-init.sh
 
 # So that we won't require libtool macros.
 cat > acinclude.m4 <<'END'
diff --git a/t/vala2.sh b/t/vala2.sh
index 1c5bdb9..2543c78 100755
--- a/t/vala2.sh
+++ b/t/vala2.sh
@@ -17,7 +17,7 @@
 # Test to make sure compiling Vala code really works with recursive make.
 
 required="pkg-config valac gcc GNUmake"
-. ./defs || exit 1
+. test-init.sh
 
 mkdir src
 
diff --git a/t/vala3.sh b/t/vala3.sh
index d9ecdea..96135d3 100755
--- a/t/vala3.sh
+++ b/t/vala3.sh
@@ -17,7 +17,7 @@
 # Test to make sure compiling Vala code really works with non-recursive make.
 
 required="pkg-config valac gcc GNUmake"
-. ./defs || exit 1
+. test-init.sh
 
 mkdir src
 
diff --git a/t/vala4.sh b/t/vala4.sh
index a727ec5..91d96bb 100755
--- a/t/vala4.sh
+++ b/t/vala4.sh
@@ -16,46 +16,103 @@
 
 # Test AM_PROG_VALAC.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
-AM_PROG_VALAC([0.0.1])
+AM_PROG_VALAC([1.2.3])
 AC_OUTPUT
 END
 
-: > Makefile.am
+cat > Makefile.am << 'END'
+has-valac:
+       case '$(VALAC)' in */bin/valac) exit 0;; *) exit 1;; esac
+no-valac:
+       test x'$(VALAC)' = x'valac'
+END
+
+mkdir bin
+cat > bin/valac << 'END'
+#! /bin/sh
+if test "x$1" = x--version; then
+  echo "${vala_version-1.2.3}"
+fi
+exit 0
+END
+chmod +x bin/valac
 
-cat > valac << 'END'
+cat > bin/valac.old << 'END'
 #! /bin/sh
 if test "x$1" = x--version; then
-  echo 1.2.3
+  echo 0.1
 fi
 exit 0
 END
-chmod +x valac
+chmod +x bin/valac.old
+
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH; export PATH
 
-cwd=$(pwd) || fatal_ "getting current working directory"
+# Avoid interferences from the environment.
+VALAC= vala_version=; unset VALAC vala_version
 
 $ACLOCAL
 $AUTOMAKE -a
 $AUTOCONF
 
-# The "|| exit 1" is required here even if 'set -e' is active,
-# because ./configure might exit with status 77, and in that case
-# we want to FAIL, not to SKIP.
-./configure "VALAC=$cwd/valac" || exit 1
+st=0; ./configure 2>stderr || st=$?
+cat stderr >&2
+grep 'WARNING.*vala' stderr && exit 1
+test $st -eq 0
+$MAKE has-valac
 
-sed 's/AM_PROG_VALAC.*/AM_PROG_VALAC([9999.9])/' < configure.ac >t
-mv -f t configure.ac
-$AUTOCONF --force
-st=0; ./configure "VALAC=$cwd/valac" || st=$?
-test $st -eq 77 || exit 1
+st=0; vala_version=99.9 ./configure 2>stderr || st=$?
+cat stderr >&2
+grep 'WARNING.*vala' stderr && exit 1
+test $st -eq 0
+$MAKE has-valac
+
+st=0; vala_version=0.1.2 ./configure 2>stderr || st=$?
+cat stderr >&2
+test $st -eq 0
+grep '^configure: WARNING: no proper vala compiler found' stderr
+$MAKE no-valac
 
-sed 's/AM_PROG_VALAC.*/AM_PROG_VALAC([1.2.3])/' < configure.ac >t
+st=0; ./configure VALAC="$(pwd)/bin/valac.old" 2>stderr || st=$?
+cat stderr >&2
+test $st -eq 0 || exit 1
+grep '^configure: WARNING: no proper vala compiler found' stderr
+$MAKE no-valac
+
+sed 's/^\(AM_PROG_VALAC\).*/\1([1], [: > ok], [: > ko])/' <configure.ac >t
 mv -f t configure.ac
-$AUTOCONF --force
-# See comments above for why "|| exit 1" is needed.
-./configure "VALAC=$cwd/valac" || exit 1
+rm -rf autom4te*.cache
+$ACLOCAL
+$AUTOCONF
+
+st=0; ./configure 2>stderr || st=$?
+cat stderr >&2
+grep 'WARNING.*vala' stderr && exit 1
+test -f ok
+test ! -e ko
+$MAKE has-valac
+rm -f ok ko
+
+st=0; vala_version=0.1.2 ./configure 2>stderr || st=$?
+cat stderr >&2
+grep 'WARNING.*vala' stderr && exit 1
+test $st -eq 0
+test ! -e ok
+test -f ko
+$MAKE no-valac
+rm -f ok ko
+
+st=0; ./configure VALAC="$(pwd)/bin/valac.old" 2>stderr || st=$?
+cat stderr >&2
+grep 'WARNING.*vala' stderr && exit 1
+test $st -eq 0
+test ! -e ok
+test -f ko
+$MAKE no-valac
+rm -f ok ko
 
 :
diff --git a/t/vala5.sh b/t/vala5.sh
index bc29346..9cd57f8 100755
--- a/t/vala5.sh
+++ b/t/vala5.sh
@@ -17,7 +17,7 @@
 # Test per-target flags.
 
 required="pkg-config valac gcc GNUmake"
-. ./defs || exit 1
+. test-init.sh
 
 mkdir src
 


hooks/post-receive
-- 
GNU Automake



reply via email to

[Prev in Thread] Current Thread [Next in Thread]