am-ft: make the environment available earlier
[platform/upstream/automake.git] / t / ccnoco.sh
index be9be37..d00b6f9 100644 (file)
@@ -22,7 +22,8 @@ required=gcc # For cc-no-c-o.
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
-$CC --version; $CC -v; # For debugging.
+$CC --version || exit 1
+$CC -v || exit 1
 AC_OUTPUT
 END
 
@@ -42,11 +43,11 @@ int main ()
 }
 END
 
-# Make sure the compiler doesn't understand '-c -o'
+# Make sure the compiler doesn't understand '-c -o'.
 CC=$am_testaux_builddir/cc-no-c-o; export CC
 
 $ACLOCAL
-$AUTOCONF
+$AUTOCONF -Wall -Werror
 $AUTOMAKE --copy --add-missing
 
 for vpath in : false; do
@@ -57,9 +58,15 @@ for vpath in : false; do
   else
     srcdir=.
   fi
-  $srcdir/configure
+  $srcdir/configure >stdout || { cat stdout; exit 1; }
+  cat stdout
+  $EGREP 'understands? -c and -o together.* no$' stdout
+  # No repeated checks please.
+  test $(grep -c ".*-c['\" ].*-o['\" ]" stdout) -eq 1
   $MAKE
   cd $srcdir
 done
 
+$MAKE distcheck
+
 :