Add obstack-printf and obstack-printf-posix modules.
[gnulib.git] / m4 / obstack-printf.m4
1 # obstack-printf.m4 serial 1
2 dnl Copyright (C) 2008 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.
6
7 dnl From Eric Blake.
8 dnl Test whether obstack_printf() exists.  For now, we assume that
9 dnl obstack_vprintf behaves identically, so we only test for one.
10
11 AC_DEFUN([gl_FUNC_OBSTACK_PRINTF],
12 [
13   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
14   AC_CHECK_FUNCS_ONCE([obstack_printf])
15   if test $ac_cv_func_obstack_printf = no ; then
16     gl_REPLACE_OBSTACK_PRINTF
17   fi
18
19   AC_CHECK_DECLS_ONCE([obstack_printf])
20   if test $ac_cv_have_decl_obstack_printf = no; then
21     HAVE_DECL_OBSTACK_PRINTF=0
22   fi
23 ])
24
25 AC_DEFUN([gl_REPLACE_OBSTACK_PRINTF],
26 [
27   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
28   AC_LIBOBJ([obstack_printf])
29   if test $ac_cv_func_obstack_printf = yes; then
30     REPLACE_OBSTACK_PRINTF=1
31   fi
32 ])