Index: autotools.eclass =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/autotools.eclass,v retrieving revision 1.161 diff -u -B -r1.161 autotools.eclass --- autotools.eclass 1 Mar 2014 11:51:08 -0000 1.161 +++ autotools.eclass 6 May 2014 17:00:37 -0000 @@ -353,7 +353,7 @@ done _automake_version() { - autotools_run_tool automake --version 2>/dev/null | sed -n -e '1{s:.*(GNU automake) ::p;q}' + autotools_run_tool --output automake --version 2>/dev/null | sed -n -e '/\(GNU automake\)/{s:.*(GNU automake) ::;s:-p[0-9]::p;q}' } if [[ -z ${makefile_name} ]] ; then @@ -435,19 +435,20 @@ } # @FUNCTION: autotools_run_tool -# @USAGE: [--at-no-fail] [--at-m4flags] [--at-missing] [tool-specific flags] +# @USAGE: [--at-no-fail] [--at-m4flags] [--at-missing] [--output] [tool-specific flags] # @INTERNAL # @DESCRIPTION: # Run the specified autotool helper, but do logging and error checking # around it in the process. autotools_run_tool() { # Process our own internal flags first - local autofail=true m4flags=false missing_ok=false + local autofail=true m4flags=false missing_ok=false return_output=false while [[ -n $1 ]] ; do case $1 in --at-no-fail) autofail=false;; --at-m4flags) m4flags=true;; --at-missing) missing_ok=true;; + --output) return_output=true;; # whatever is left goes to the actual tool *) break;; esac @@ -495,6 +496,8 @@ echo die "Failed Running $1 !" fi + if ! ${return_output} ; then return $? ; fi + cat "${STDERR_TARGET}" } # Internal function to check for support