-# This macro must be invoked before any tests that run the compiler.
-AC_DEFUN(jm_CHECK_ALL_TYPES,
+# These tests must be run before any use of AC_CHECK_TYPE,
+# because that macro compiles code that tests e.g., HAVE_UNISTD_H.
+# See the definition of ac_includes_default in `configure'.
+AC_DEFUN([jm_CHECK_ALL_HEADERS],