summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorJoel Rosdahl <joel@rosdahl.net>2010-11-22 21:27:04 +0100
committerJoel Rosdahl <joel@rosdahl.net>2010-11-22 21:27:04 +0100
commit1d8ea36309d7244582e367c4d673e38646e5eb9c (patch)
tree553cb189594acb10843cc32c721550cff122de0f /configure.ac
parent3a0f8b73929317a88c77ad58ba48a78c397b5e20 (diff)
parent11584a854694a8c0a025fcde5f226c94c60c56c4 (diff)
downloadccache-1d8ea36309d7244582e367c4d673e38646e5eb9c.tar.gz
Merge branch 'maint'
* maint: portability: Disable support for long double in snprintf replacement portability: Handle system *sprintf functions with bad type signatures portability: Add Holger Weiß's improved snprintf replacement
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac38
1 files changed, 6 insertions, 32 deletions
diff --git a/configure.ac b/configure.ac
index 55141261..b97396b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,19 +38,15 @@ AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(ctype.h pwd.h stdlib.h string.h strings.h sys/time.h sys/mman.h)
AC_CHECK_HEADERS(termios.h)
-AC_CHECK_FUNCS(asprintf)
AC_CHECK_FUNCS(gethostname)
AC_CHECK_FUNCS(getopt_long)
AC_CHECK_FUNCS(getpwuid)
AC_CHECK_FUNCS(gettimeofday)
AC_CHECK_FUNCS(mkstemp)
AC_CHECK_FUNCS(realpath)
-AC_CHECK_FUNCS(snprintf)
AC_CHECK_FUNCS(strndup)
AC_CHECK_FUNCS(strtok_r)
AC_CHECK_FUNCS(utimes)
-AC_CHECK_FUNCS(vasprintf)
-AC_CHECK_FUNCS(vsnprintf)
AC_CACHE_CHECK([for compar_fn_t in stdlib.h],ccache_cv_COMPAR_FN_T, [
AC_TRY_COMPILE(
@@ -63,34 +59,12 @@ if test x"$ccache_cv_COMPAR_FN_T" = x"yes"; then
Define to 1 if you have the `__compar_fn_t' typedef.)
fi
-AC_CACHE_CHECK([for C99 vsnprintf],ccache_cv_HAVE_C99_VSNPRINTF,[
-AC_TRY_RUN([
-#include <sys/types.h>
-#include <stdarg.h>
-#include <stdio.h>
-void foo(const char *format, ...) {
- va_list ap;
- int len;
- char buf[5];
-
- va_start(ap, format);
- len = vsnprintf(0, 0, format, ap);
- va_end(ap);
- if (len != 5) exit(1);
-
- if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
-
- exit(0);
-}
-main() { foo("hello"); }
-],
-ccache_cv_HAVE_C99_VSNPRINTF=yes,
-ccache_cv_HAVE_C99_VSNPRINTF=no,
-ccache_cv_HAVE_C99_VSNPRINTF=cross)])
-if test x"$ccache_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
- AC_DEFINE(HAVE_C99_VSNPRINTF, 1,
- Define to 1 if you have the `vsnprintf' function.)
-fi
+dnl Replacements of snprintf and friends.
+m4_include(m4/snprintf.m4)
+HW_FUNC_VSNPRINTF
+HW_FUNC_SNPRINTF
+HW_FUNC_VASPRINTF
+HW_FUNC_ASPRINTF
dnl Check for zlib.
AC_CACHE_CHECK(