]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
ar-lib: fix configure output for "unrecognized archiver interface"
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 5 Nov 2011 20:35:40 +0000 (21:35 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 5 Nov 2011 20:35:40 +0000 (21:35 +0100)
* m4/ar-lib.m4: Ensure that, even when an error is hit while trying
to determine the archiver interface kind, the "checking archiver
interface" message from configure is properly terminated before
an error message is printed, to avoid slightly garbled output.
* tests/ar4.test: Enhance.
* tests/ar5.test: Likewise.

ChangeLog
m4/ar-lib.m4
tests/ar4.test
tests/ar5.test

index d3e35025236172409c8d272b5505eee5adfda11d..6a861137ad1cd8bdb76cb652426376e1daa6a06d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-11-05  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       ar-lib: fix configure output for "unrecognized archiver interface"
+       * m4/ar-lib.m4: Ensure that, even when an error is hit while trying
+       to determine the archiver interface kind, the "checking archiver
+       interface" message from configure is properly terminated before
+       an error message is printed, to avoid slightly garbled output.
+       * tests/ar4.test: Enhance.
+       * tests/ar5.test: Likewise.
+
 2011-11-04  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        warnings: fix buglets for portability warnings
index 822ca60852d7961fe318519ebb141164a373f958..e45c558dd96e4b8d6e1409cf85d1415858f5bd78 100644 (file)
@@ -33,8 +33,7 @@ AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface],
         if test "$ac_status" -eq 0; then
           am_cv_ar_interface=lib
         else
-          m4_default([$1],
-            [AC_MSG_ERROR([could not determine $AR interface])])
+          am_cv_ar_interface=unknown
         fi
       fi
       rm -f conftest.lib libconftest.a
@@ -53,6 +52,10 @@ lib)
   # similar.
   AR="$am_aux_dir/ar-lib $AR"
   ;;
+unknown)
+  m4_default([$1],
+             [AC_MSG_ERROR([could not determine $AR interface])])
+  ;;
 esac
 AC_SUBST([AR])dnl
 ])
index ebd8c576f5d6011758d1e0e7dab07381fbabb168..bb181118b90716adfe42235c5c1ce0270121338c 100755 (executable)
@@ -27,9 +27,13 @@ END
 $ACLOCAL
 $AUTOCONF
 
-./configure AR=/bin/false 2>stderr && { cat stderr >&2; Exit 1; }
+st=0; ./configure AR=/bin/false >stdout 2>stderr || st=$?
+cat stdout
 cat stderr >&2
+test $st -eq 1
 
-grep 'configure: error: could not determine /bin/false interface' stderr
+grep '^checking.* archiver .*interface.*\.\.\. unknown' stdout
+grep '^configure: error: could not determine /bin/false interface' stderr
+ls *conftest* && Exit 1
 
 :
index d00f421bd3259fd677953356d13b3526d3d64bfc..865e0bf814379daf1c32abb2046fc92dac8c04ba 100755 (executable)
 set -e
 
 cat >> configure.in << 'END'
-AM_PROG_AR([echo spy > bad-archiver-interface-detected])
+AM_PROG_AR([
+  echo spy > bad-archiver-interface-detected
+  AC_MSG_CHECKING([for something else])
+  AC_MSG_RESULT([found it])
+  echo Grep This
+])
 END
 
 $ACLOCAL
 $AUTOCONF
 
-./configure AR=/bin/false
+./configure AR=/bin/false >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep '^checking.* archiver .*interface.*\.\.\. unknown$' stdout
+grep '^checking for something else\.\.\. found it$' stdout
+grep '^Grep This$' stdout
 test -f bad-archiver-interface-detected
 
 :