1 # obstack-printf.m4 serial 2
2 dnl Copyright (C) 2008, 2009 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
8 dnl Test whether obstack_printf() exists. For now, we assume that
9 dnl obstack_vprintf behaves identically, so we only test for one.
11 AC_DEFUN([gl_FUNC_OBSTACK_PRINTF],
13 dnl Persuade glibc <stdio.h> to declare obstack_printf(), obstack_vprintf().
14 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
16 AC_REQUIRE([gl_STDIO_H_DEFAULTS])
17 AC_CHECK_FUNCS_ONCE([obstack_printf])
18 if test $ac_cv_func_obstack_printf = no ; then
19 gl_REPLACE_OBSTACK_PRINTF
22 AC_CHECK_DECLS_ONCE([obstack_printf])
23 if test $ac_cv_have_decl_obstack_printf = no; then
24 HAVE_DECL_OBSTACK_PRINTF=0
28 AC_DEFUN([gl_REPLACE_OBSTACK_PRINTF],
30 AC_REQUIRE([gl_STDIO_H_DEFAULTS])
31 AC_LIBOBJ([obstack_printf])
32 if test $ac_cv_func_obstack_printf = yes; then
33 REPLACE_OBSTACK_PRINTF=1