From: Stefano Lattarini Date: Fri, 26 Oct 2012 16:01:17 +0000 (+0200) Subject: vala: if no proper compiler found, set $(VALAC) to 'valac' X-Git-Tag: v1.12.5~11^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b187099d61143733e35ff58bfc6a0cedd2e2322;p=thirdparty%2Fautomake.git vala: if no proper compiler found, set $(VALAC) to 'valac' This is better than setting it to ':' (as is currently done), because a triggered makefile rule invoking a vala compilation will then 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. For a precedent of a similar behaviour, see the AC_PROG_YACC macro. * m4/valac.m4: Implement the new semantic. * doc/automake.texi (Vala Support): Document it. * t/vala4.sh: Adjust. Signed-off-by: Stefano Lattarini --- diff --git a/doc/automake.texi b/doc/automake.texi index ae3fd15ba..7289d8543 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -6900,8 +6900,8 @@ There are a few variables that are used when compiling Vala sources: @vtable @code @item VALAC -Absolute path to the Vala compiler, or @samp{:} if no suitable compiler -could be found. +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 0da8d67ac..715517617 100644 --- a/m4/vala.m4 +++ b/m4/vala.m4 @@ -13,21 +13,19 @@ # 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"], - [m4_default([$3], - [AC_MSG_WARN([no vala compiler found]) - AC_MSG_WARN([you will not be able to compile vala source files])])], - [AS_IF([test -n "$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]) - VALAC=:])]) - if test x"$VALAC" = x":"; then - m4_default([$3], [AC_MSG_WARN([no proper vala compiler found])]) + 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])]) + fi]) diff --git a/t/vala4.sh b/t/vala4.sh index 0684d3f5a..cf3e70eee 100755 --- a/t/vala4.sh +++ b/t/vala4.sh @@ -26,9 +26,9 @@ END cat > Makefile.am << 'END' has-valac: - case '$(VALAC)' in */valac) exit 0;; *) exit 1;; esac + case '$(VALAC)' in */bin/valac) exit 0;; *) exit 1;; esac no-valac: - test x'$(VALAC)' = x':' + test x'$(VALAC)' = x'valac' END mkdir bin