Jim Meyering
2009-Aug-12 09:30 UTC
[Libguestfs] [PATCH libguestfs] build: enable automake's color-tests option
Only marginally useful, but some like it... This makes tests print "PASS" in green, and "FAIL" in red, when possible: The autogen.sh snippet ensures that this automake-1.11 feature is disabled when building-from-clone on a system with too-old automake. This *does* modify a source file (and a version-controlled one at that), but only when building from source on e.g. RHEL*>From 897dab226d5d4ad5f83026d8baa730b072b1f6cd Mon Sep 17 00:00:00 2001From: Jim Meyering <meyering at redhat.com> Date: Mon, 10 Aug 2009 14:08:57 +0200 Subject: [PATCH libguestfs] build: enable automake's color-tests option * configure.ac (AM_INIT_AUTOMAKE): Add color-tests. * daemon/configure.ac: Likewise. * autogen.sh: Detect a too-old version of automake, and if found, dumb-down our usage of AM_INIT_AUTOMAKE to exclude the offending option. --- autogen.sh | 9 +++++++++ configure.ac | 2 +- daemon/configure.ac | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/autogen.sh b/autogen.sh index 5179623..25cf94e 100755 --- a/autogen.sh +++ b/autogen.sh @@ -32,6 +32,15 @@ else ./bootstrap && echo "$t" > $curr_status fi +# In order to accommodate versions of automake that are older than 1.11 +# remove options that we find useful but that would otherwise not be recognized. +v=$(automake --version | { read ver && echo ${ver#*) }; }) +case $v in + 1.1[1-9]*|[2-9]*) ;; # Good! + *) perl -pi -e 's/(AM_INIT_AUTOMAKE\(\[.*?)\s*color-tests\s*(.*)/$1 $2/'\ + configure.ac daemon/configure.ac ;; +esac + mkdir -p daemon/m4 autoreconf -i diff --git a/configure.ac b/configure.ac index a78ca51..27e5be9 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ m4_define([libguestfs_extra], []) AC_INIT([libguestfs],libguestfs_major.libguestfs_minor.libguestfs_release[]libguestfs_extra) AC_CONFIG_AUX_DIR([build-aux]) -AM_INIT_AUTOMAKE([foreign]) +AM_INIT_AUTOMAKE([foreign color-tests]) m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])]) AM_SILENT_RULES([yes]) # make --enable-silent-rules the default. diff --git a/daemon/configure.ac b/daemon/configure.ac index 43e331b..cd31fa8 100644 --- a/daemon/configure.ac +++ b/daemon/configure.ac @@ -17,7 +17,7 @@ AC_INIT([libguestfs-daemon],[1.0.0]) AC_CONFIG_AUX_DIR([build-aux]) -AM_INIT_AUTOMAKE([foreign]) +AM_INIT_AUTOMAKE([foreign color-tests]) m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])]) AM_SILENT_RULES([yes]) # make --enable-silent-rules the default. -- 1.6.4.300.gc9df
Richard W.M. Jones
2009-Aug-12 10:59 UTC
[Libguestfs] [PATCH libguestfs] build: enable automake's color-tests option
On Wed, Aug 12, 2009 at 11:30:19AM +0200, Jim Meyering wrote:> +# In order to accommodate versions of automake that are older than 1.11 > +# remove options that we find useful but that would otherwise not be recognized. > +v=$(automake --version | { read ver && echo ${ver#*) }; }) > +case $v in > + 1.1[1-9]*|[2-9]*) ;; # Good! > + *) perl -pi -e 's/(AM_INIT_AUTOMAKE\(\[.*?)\s*color-tests\s*(.*)/$1 $2/'\ > + configure.ac daemon/configure.ac ;; > +esac > +Eeee yuk. Is there not some other way to do this? For example, could we redefine AM_INIT_AUTOMAKE macro so that it ignores options which aren't supported and passes the remaining ones to the real AM_INIT_AUTOMAKE? (I have no idea how to do this, so just a suggestion). Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://et.redhat.com/~rjones/libguestfs/ See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
Reasonably Related Threads
- [PATCH libguestfs] build: daemon/do_debug: parameters aren't always unused
- [PATCH] build: Only add 'serial-tests' for automake >= 1.12.
- [PATCH] build: Remove support for automake < 1.13.
- [PATCH] automake: Admit defeat and use 'subdir-objects'.
- PATCH: Don't force automake 1.11 AM_SILENT_RULES