+2001-11-05 Bruno Haible <haible@clisp.cons.org>
+
+ * stdint_h.m4: New file.
+ * Makefile.am (EXTRA_DIST): Add it.
+ * uintmax_t.m4 (jm_AC_TYPE_UINTMAX_T): Require also
+ jm_AC_HEADER_STDINT_H.
+ * mkdtemp.m4 (gt_FUNC_MKDTEMP): Call jm_AC_HEADER_INTTYPES_H instead
+ of testing for inttypes.h. Call jm_AC_HEADER_STDINT_H instead of
+ testing for stdint.h.
+
2001-11-01 Bruno Haible <haible@clisp.cons.org>
* javacomp.m4 (gt_JAVACOMP): Test for the existence of gcj, javac,
glibc21.m4 hostname.m4 iconv.m4 inttypes_h.m4 isc-posix.m4 javacomp.m4 \
javaexec.m4 lcmessage.m4 libtool.m4 mbrtowc.m4 mbstate_t.m4 mbswidth.m4 \
mkdtemp.m4 progtest.m4 setenv.m4 setlocale.m4 siginfo.m4 signalblocking.m4 \
-signed.m4 ssize_t.m4 stdbool.m4 tmpdir.m4 uintmax_t.m4 ulonglong.m4 \
-unionwait.m4
+signed.m4 ssize_t.m4 stdbool.m4 stdint_h.m4 tmpdir.m4 uintmax_t.m4 \
+ulonglong.m4 unionwait.m4
[
AC_REPLACE_FUNCS(mkdtemp)
AC_STAT_MACROS_BROKEN
- AC_CHECK_HEADERS(fcntl.h inttypes.h stdint.h sys/time.h time.h unistd.h)
+ jm_AC_HEADER_INTTYPES_H
+ jm_AC_HEADER_STDINT_H
+ AC_CHECK_HEADERS(fcntl.h sys/time.h time.h unistd.h)
AC_CHECK_FUNCS(gettimeofday)
])
--- /dev/null
+#serial 1
+
+dnl From Paul Eggert.
+
+# Define HAVE_STDINT_H if <stdint.h> exists,
+# doesn't clash with <sys/types.h>, and declares uintmax_t.
+
+AC_DEFUN([jm_AC_HEADER_STDINT_H],
+[
+ AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
+ [AC_TRY_COMPILE(
+ [#include <sys/types.h>
+#include <stdint.h>],
+ [uintmax_t i = (uintmax_t) -1;],
+ jm_ac_cv_header_stdint_h=yes,
+ jm_ac_cv_header_stdint_h=no)])
+ if test $jm_ac_cv_header_stdint_h = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_STDINT_H, 1,
+[Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
+ and declares uintmax_t. ])
+ fi
+])
-#serial 5
+#serial 6
dnl From Paul Eggert.
AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
[
AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
- if test $jm_ac_cv_header_inttypes_h = no; then
+ AC_REQUIRE([jm_AC_HEADER_STDINT_H])
+ if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
test $ac_cv_type_unsigned_long_long = yes \
&& ac_type='unsigned long long' \
|| ac_type='unsigned long'
AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
[Define to unsigned long or unsigned long long
- if <inttypes.h> doesn't define.])
+ if <inttypes.h> and <stdint.h> don't define.])
fi
])