| 1 |
# vasprintf.m4 |
| 2 |
# serial 6 |
| 3 |
dnl Copyright (C) 2002-2003, 2006-2007, 2009-2024 Free Software Foundation, |
| 4 |
dnl Inc. |
| 5 |
dnl This file is free software; the Free Software Foundation |
| 6 |
dnl gives unlimited permission to copy and/or distribute it, |
| 7 |
dnl with or without modifications, as long as this notice is preserved. |
| 8 |
dnl This file is offered as-is, without any warranty. |
| 9 |
|
| 10 |
AC_DEFUN([gl_FUNC_VASPRINTF], |
| 11 |
[ |
| 12 |
AC_CHECK_FUNCS([vasprintf]) |
| 13 |
if test $ac_cv_func_vasprintf = no; then |
| 14 |
gl_REPLACE_VASPRINTF |
| 15 |
fi |
| 16 |
]) |
| 17 |
|
| 18 |
AC_DEFUN([gl_REPLACE_VASPRINTF], |
| 19 |
[ |
| 20 |
AC_LIBOBJ([vasprintf]) |
| 21 |
AC_LIBOBJ([asprintf]) |
| 22 |
AC_REQUIRE([gl_STDIO_H_DEFAULTS]) |
| 23 |
if test $ac_cv_func_vasprintf = yes; then |
| 24 |
REPLACE_VASPRINTF=1 |
| 25 |
else |
| 26 |
HAVE_VASPRINTF=0 |
| 27 |
fi |
| 28 |
gl_PREREQ_VASPRINTF_H |
| 29 |
gl_PREREQ_VASPRINTF |
| 30 |
gl_PREREQ_ASPRINTF |
| 31 |
]) |
| 32 |
|
| 33 |
# Prerequisites of the vasprintf portion of lib/stdio.h. |
| 34 |
AC_DEFUN([gl_PREREQ_VASPRINTF_H], |
| 35 |
[ |
| 36 |
dnl Persuade glibc <stdio.h> to declare asprintf() and vasprintf(). |
| 37 |
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) |
| 38 |
]) |
| 39 |
|
| 40 |
# Prerequisites of lib/vasprintf.c. |
| 41 |
AC_DEFUN([gl_PREREQ_VASPRINTF], |
| 42 |
[ |
| 43 |
]) |
| 44 |
|
| 45 |
# Prerequisites of lib/asprintf.c. |
| 46 |
AC_DEFUN([gl_PREREQ_ASPRINTF], |
| 47 |
[ |
| 48 |
]) |