summaryrefslogtreecommitdiff
path: root/gcc/aclocal.m4
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>1998-02-07 13:21:36 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>1998-02-07 13:21:36 +0000
commit0a0a425efe501cb03ef246ca5b7aeafd3bb8a4af (patch)
tree6bdcb43666cef30b2f83a4a5fc6d613690298236 /gcc/aclocal.m4
parent8b482459308d062b5bc6a92af9313c67f5321329 (diff)
downloadgcc-0a0a425efe501cb03ef246ca5b7aeafd3bb8a4af.tar.gz
* aclocal.m4 (GCC_FUNC_PRINTF_PTR): New macro to test the printf
functions for whether they support the %p format specifier. * acconfig.h (HOST_PTR_PRINTF): Insert stub for autoconf. * configure.in (GCC_FUNC_PRINTF_PTR): Use it. * configure, config.in: Rebuild. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@17760 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/aclocal.m4')
-rw-r--r--gcc/aclocal.m421
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4
index 58dcaa62d75..601af11cec0 100644
--- a/gcc/aclocal.m4
+++ b/gcc/aclocal.m4
@@ -42,6 +42,27 @@ GCC_NEED_DECLARATION($ac_func)
done
])
+dnl See if the printf functions in libc support %p in format strings.
+AC_DEFUN(GCC_FUNC_PRINTF_PTR,
+[AC_CACHE_CHECK(whether the printf functions support %p,
+ gcc_cv_func_printf_ptr,
+[AC_TRY_RUN([#include <stdio.h>
+
+main()
+{
+ char buf[64];
+ char *p = buf, *q = NULL;
+ sprintf(buf, "%p", p);
+ sscanf(buf, "%p", &q);
+ exit (p != q);
+}], gcc_cv_func_printf_ptr=yes, gcc_cv_func_printf_ptr=no,
+ gcc_cv_func_printf_ptr=no)
+rm -f core core.* *.core])
+if test $gcc_cv_func_printf_ptr = yes ; then
+ AC_DEFINE(HOST_PTR_PRINTF, "%p")
+fi
+])
+
dnl See if symbolic links work and if not, try to substitute either hard links or simple copy.
AC_DEFUN(GCC_PROG_LN_S,
[AC_MSG_CHECKING(whether ln -s works)