* m4/include_next.m4 (gl_INCLUDE_NEXT): Define and AC_SUBST
[gnulib.git] / m4 / stdint.m4
index c12311d..e8016bd 100644 (file)
@@ -1,4 +1,4 @@
-# stdint.m4 serial 26
+# stdint.m4 serial 27
 dnl Copyright (C) 2001-2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -45,22 +45,15 @@ AC_DEFUN([gl_STDINT_H],
   fi
   AC_SUBST([HAVE_SYS_TYPES_H])
 
-  dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_stdint_h.
+  gl_CHECK_NEXT_HEADERS([stdint.h])
   if test $ac_cv_header_stdint_h = yes; then
-    gl_ABSOLUTE_HEADER([stdint.h])
-    ABSOLUTE_STDINT_H=\"$gl_cv_absolute_stdint_h\"
     HAVE_STDINT_H=1
   else
-    ABSOLUTE_STDINT_H=\"no/such/file/stdint.h\"
     HAVE_STDINT_H=0
   fi
-  AC_SUBST([ABSOLUTE_STDINT_H])
   AC_SUBST([HAVE_STDINT_H])
 
-  dnl Now see whether we need a substitute <stdint.h>.  Use
-  dnl ABSOLUTE_STDINT_H, not <stdint.h>, so that it also works during
-  dnl a "config.status --recheck" if a stdint.h has been
-  dnl created in the build directory.
+  dnl Now see whether we need a substitute <stdint.h>.
   if test $ac_cv_header_stdint_h = yes; then
     AC_CACHE_CHECK([whether stdint.h conforms to C99],
       [gl_cv_header_working_stdint_h],
@@ -70,7 +63,8 @@ AC_DEFUN([gl_STDINT_H],
          [
 #define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
 #define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */
-#include ABSOLUTE_STDINT_H
+#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
+#include <stdint.h>
 #ifdef INT8_MAX
 int8_t a1 = INT8_MAX;
 int8_t a1min = INT8_MIN;