summaryrefslogtreecommitdiff
path: root/aclocal.m4
diff options
context:
space:
mode:
authorwlemb <wlemb>2001-07-20 14:36:50 +0000
committerwlemb <wlemb>2001-07-20 14:36:50 +0000
commit0c2857af24a536366560a8a13c64fd6ea25f8408 (patch)
tree581239e098ec25f99e3939b5eca17f5054061dbc /aclocal.m4
parent8ec25476b88dc3138d74c285cf249a90200ae6ac (diff)
downloadgroff-0c2857af24a536366560a8a13c64fd6ea25f8408.tar.gz
* src/libs/libgroff/tmpname.cc: New file, defining get_tempname().
* src/libs/libgroff/mkstemp.cc: New file. * src/libs/libgroff/mksdir.cc: New file. * src/libs/libgroff/tmpfile.cc [HAVE_MKSTEMP_PROTO]: Removed. (xtmpfile) [!HAVE_MKSTEMP]: Removed. * src/libs/libgroff/Makefile.sub: Updated. * src/include/lib.h: Add mksdir() prototype. * src/include/posix.h: Define S_IXUSR if not yet defined. * src/preproc/html/pre-html.cc (MAX_RETRIES): Removed. (createAllPages): Use mksdir() instead of current code. * src/utils/indxbib/indxbib.cc [HAVE_MKSTEMP_PROTO]: Removed. (main): [!HAVE_MKSTEMP]: Removed. * aclocal.m4 (GROFF_MKSTEMP): Updated to use new mkstemp.cc file. (GROFF_INTTYPES_H, GROFF_UNSIGNED_LONG_LONG, GROFF_UINTMAX_T): New macros. * configure.ac: Add tests for stdint.h, sys/time.h, and gettimeofday(). Call new GROFF_xxx macros. * configure: Regenerated. * Makefile.in: Comments updated.
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m456
1 files changed, 48 insertions, 8 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 83a68398..bf2b2959 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -474,13 +474,53 @@ fi
AC_LANG_POP(C++)])dnl
dnl
dnl
-dnl Check for mkstemp() and its function prototype.
+dnl If mkstemp() isn't available, use our own mkstemp.cc file.
dnl
AC_DEFUN(GROFF_MKSTEMP,
-[AC_CHECK_FUNC(mkstemp,
-[AC_DEFINE(HAVE_MKSTEMP)
-AC_MSG_CHECKING([for mkstemp prototype in <stdlib.h>])
-AC_EGREP_CPP(mkstemp,
-[#include <stdlib.h>],
-AC_MSG_RESULT(yes);AC_DEFINE(HAVE_MKSTEMP_PROTO),
-AC_MSG_RESULT(no))])])
+[AC_LANG_PUSH(C++)
+AC_LIBSOURCE(mkstemp.cc)
+AC_CHECK_FUNC(mkstemp, , [_AC_LIBOBJ(mkstemp)])
+AC_LANG_POP(C++)])dnl
+dnl
+dnl
+dnl Test whether <inttypes.h> exists, doesn't clash with <sys/types.h>,
+dnl and declares uintmax_t. Taken from the fileutils package.
+dnl
+AC_DEFUN(GROFF_INTTYPES_H,
+[AC_LANG_PUSH(C++)
+AC_MSG_CHECKING([for inttypes.h])
+AC_TRY_COMPILE([#include <sys/types.h>
+#include <inttypes.h>],
+[uintmax_t i = (uintmax_t)-1;],
+groff_cv_header_inttypes_h=yes,
+groff_cv_header_inttypes_h=no)
+AC_MSG_RESULT($groff_cv_header_inttypes_h)
+AC_LANG_POP(C++)])dnl
+dnl
+dnl
+dnl Test for working `unsigned long long'. Taken from the fileutils package.
+dnl
+AC_DEFUN(GROFF_UNSIGNED_LONG_LONG,
+[AC_LANG_PUSH(C++)
+AC_MSG_CHECKING([for unsigned long long])
+AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
+[unsigned long long ullmax = (unsigned long long)-1;
+return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
+groff_cv_type_unsigned_long_long=yes,
+groff_cv_type_unsigned_long_long=no)
+AC_MSG_RESULT($groff_cv_type_unsigned_long_long)
+AC_LANG_POP(C++)])dnl
+dnl
+dnl
+dnl Define uintmax_t to `unsigned long' or `unsigned long long'
+dnl if <inttypes.h> does not exist. Taken from the fileutils package.
+dnl
+AC_DEFUN(GROFF_UINTMAX_T,
+[AC_REQUIRE([GROFF_INTTYPES_H])
+if test $groff_cv_header_inttypes_h = no; then
+ AC_REQUIRE([GROFF_UNSIGNED_LONG_LONG])
+ test $groff_cv_type_unsigned_long_long = yes \
+ && ac_type='unsigned long long' \
+ || ac_type='unsigned long'
+ AC_DEFINE_UNQUOTED(uintmax_t, $ac_type)
+fi])dnl