diff --git a/ChangeLog b/ChangeLog index 47ae65d8..3a4f2a3f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,11 @@ * gpgme.spec.in: Changed user name in Wojciech Polak's email address from ghostface to polak per request by himself. +2002-08-28 Werner Koch + + * acinclude.m4 (GNUPG_CHECK_VA_COPY): New. + * configure.ac: Use it. + 2002-08-23 Werner Koch * configure.ac (GPGME_CONFIG_CFLAGS): Renamed from GPGME_CFLAGS diff --git a/acinclude.m4 b/acinclude.m4 index b6f0a3a6..6a06343c 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -4143,3 +4143,38 @@ else fi AC_MSG_RESULT([$SED]) ]) + +dnl GNUPG_CHECK_VA_COPY() +dnl Do some check on how to implement va_copy. +dnl May define MUST_COPY_VA_BY_VAL. +dnl Actual test code taken from glib-1.1. +AC_DEFUN(GNUPG_CHECK_VA_COPY, +[ AC_MSG_CHECKING(whether va_lists must be copied by value) + AC_CACHE_VAL(gnupg_cv_must_copy_va_byval,[ + gnupg_cv_must_copy_va_byval=no + AC_TRY_RUN([ + #include + 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; + } + ],gnupg_cv_must_copy_va_byval=yes) + ]) + if test "$gnupg_cv_must_copy_va_byval" = yes; then + AC_DEFINE(MUST_COPY_VA_BYVAL,1,[used to implement the va_copy macro]) + fi + AC_MSG_RESULT($gnupg_cv_must_copy_va_byval) +]) + diff --git a/configure.ac b/configure.ac index 14823f82..1ba0f3f9 100644 --- a/configure.ac +++ b/configure.ac @@ -154,13 +154,19 @@ dnl AC_REPLACE_FUNCS(stpcpy) -# asprintf() is at least used in assuan AC_REPLACE_FUNCS(vasprintf) +if test "$ac_cv_func_vasprintf" != yes; then + GNUPG_CHECK_VA_COPY +fi + + + # Note: fopencokie is only a dummy stub and not used. # However some code in assuan/ links against it. AC_REPLACE_FUNCS(fopencookie) + dnl dnl Checks for system services dnl