diff options
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/configure.in b/configure.in index 5d08f261..2e323155 100644 --- a/configure.in +++ b/configure.in @@ -293,6 +293,82 @@ AC_SUBST(DBUS_HAVE_INT64) ## byte order AC_C_BIGENDIAN + +dnl ********************************** +dnl *** va_copy checks (from GLib) *** +dnl ********************************** +dnl we currently check for all three va_copy possibilities, so we get +dnl all results in config.log for bug reports. +AC_CACHE_CHECK([for an implementation of va_copy()],dbus_cv_va_copy,[ + AC_LINK_IFELSE([#include <stdarg.h> + void f (int i, ...) { + va_list args1, args2; + va_start (args1, i); + va_copy (args2, args1); + if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42) + exit (1); + va_end (args1); va_end (args2); + } + int main() { + f (0, 42); + return 0; + }], + [dbus_cv_va_copy=yes], + [dbus_cv_va_copy=no]) +]) +AC_CACHE_CHECK([for an implementation of __va_copy()],dbus_cv___va_copy,[ + AC_LINK_IFELSE([#include <stdarg.h> + void f (int i, ...) { + va_list args1, args2; + va_start (args1, i); + __va_copy (args2, args1); + if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42) + exit (1); + va_end (args1); va_end (args2); + } + int main() { + f (0, 42); + return 0; + }], + [dbus_cv___va_copy=yes], + [dbus_cv___va_copy=no]) +]) + +if test "x$dbus_cv_va_copy" = "xyes"; then + dbus_va_copy_func=va_copy +else if test "x$dbus_cv___va_copy" = "xyes"; then + dbus_va_copy_func=__va_copy +fi +fi + +if test -n "$dbus_va_copy_func"; then + AC_DEFINE_UNQUOTED(DBUS_VA_COPY,$dbus_va_copy_func,[A 'va_copy' style function]) +fi + +AC_CACHE_CHECK([whether va_lists can be copied by value],dbus_cv_va_val_copy,[ + AC_TRY_RUN([#include <stdarg.h> + void f (int i, ...) { + va_list args1, args2; + va_start (args1, i); + args2 = args1; + if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42) + exit (1); + va_end (args1); va_end (args2); + } + int main() { + f (0, 42); + return 0; + }], + [dbus_cv_va_val_copy=yes], + [dbus_cv_va_val_copy=no], + [dbus_cv_va_val_copy=yes]) +]) + +if test "x$dbus_cv_va_val_copy" = "xno"; then + AC_DEFINE(DBUS_VA_COPY_AS_ARRAY,1, ['va_lists' cannot be copies as values]) +fi + + #### Atomic integers (checks by Sebastian Wilhelmi for GLib) AC_MSG_CHECKING([whether to use inline assembler routines for atomic integers]) have_atomic_inc=no |