summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1998-08-16 03:55:36 +0000
committerJim Meyering <jim@meyering.net>1998-08-16 03:55:36 +0000
commit919b80538057b7aae8af23f64380005697b216de (patch)
treeec8330b5895d0b72067dea06aaedeff188b95a1d /m4
parent0e48a577b549c96d6dd53706a9248832cb2d47a5 (diff)
downloadcoreutils-919b80538057b7aae8af23f64380005697b216de.tar.xz
.
Diffstat (limited to 'm4')
-rw-r--r--m4/check-type.m428
1 files changed, 28 insertions, 0 deletions
diff --git a/m4/check-type.m4 b/m4/check-type.m4
new file mode 100644
index 000000000..3eb9dbb23
--- /dev/null
+++ b/m4/check-type.m4
@@ -0,0 +1,28 @@
+#serial 1
+
+dnl Just like AC_CHECK_TYPE from autoconf-2.12, but also checks in unistd.h
+dnl on systems that have it. Fujitsu UXP/V needs this for ssize_t.
+
+undefine([AC_CHECK_TYPE])
+dnl AC_CHECK_TYPE(TYPE, DEFAULT)
+AC_DEFUN(AC_CHECK_TYPE,
+[AC_REQUIRE([AC_HEADER_STDC])dnl
+AC_CHECK_HEADERS(unistd.h)
+AC_MSG_CHECKING(for $1)
+AC_CACHE_VAL(ac_cv_type_$1,
+[AC_EGREP_CPP(dnl
+changequote(<<,>>)dnl
+<<$1[^a-zA-Z_0-9]>>dnl
+changequote([,]), [#include <sys/types.h>
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl
+AC_MSG_RESULT($ac_cv_type_$1)
+if test $ac_cv_type_$1 = no; then
+ AC_DEFINE($1, $2)
+fi
+])