make check: avoid an error when no .git dir present.
[gnulib.git] / gnulib-tool
index 407a96f..2ec7799 100755 (executable)
@@ -1493,7 +1493,7 @@ sed_extract_field_header='
 if $modcache; then
 
   # Note: The 'eval' silences stderr output in dash.
-  if declare -A x 2>/dev/null && { x[f/2]='foo'; x[f/3]='bar'; eval test '${x[f/2]}' = foo; }; then
+  if (declare -A x && { x[f/2]='foo'; x[f/3]='bar'; eval test '${x[f/2]}' = foo; }) 2>/dev/null; then
     # Zsh 4 and Bash 4 have associative arrays.
     have_associative=true
   else
@@ -2781,7 +2781,11 @@ func_emit_lib_Makefile_am ()
   done
   if test -z "$makefile_name"; then
     echo
-    echo "AM_CPPFLAGS ="
+    if $for_test; then
+      echo "AM_CPPFLAGS = -DGNULIB_STRICT_CHECKING=1"
+    else
+      echo "AM_CPPFLAGS ="
+    fi
     echo "AM_CFLAGS ="
   fi
   echo
@@ -3066,6 +3070,9 @@ func_emit_tests_Makefile_am ()
   done
   echo
   echo "AM_CPPFLAGS = \\"
+  if $for_test; then
+    echo "  -DGNULIB_STRICT_CHECKING=1 \\"
+  fi
   if test -n "${witness_macro}"; then
     echo "  -D@${witness_macro}@=1 \\"
   fi