summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in28
1 files changed, 28 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index f170d9317..1e11b76d9 100644
--- a/configure.in
+++ b/configure.in
@@ -220,6 +220,34 @@ AC_ARG_WITH(encryption, [ --with-encryption Use md5 database encryption], [
AC_DEFINE_UNQUOTED(ENCRYPT_MD5,,"Use md5")
])
+dnl Does this platform require array notation to assign to a va_list?
+dnl If cross-compiling, we assume va_list is "normal". If this breaks
+dnl you, set ac_cv_valistisarray=true and maybe define HAVE_VA_LIST_AS_ARRAY
+dnl also just to be sure.
+AC_MSG_CHECKING(whether va_list assignments need array notation)
+AC_CACHE_VAL(ac_cv_valistisarray,
+ [AC_TRY_RUN([#include <stdlib.h>
+ #include <stdarg.h>
+ void foo(int i, ...) {
+ va_list ap1, ap2;
+ va_start(ap1, i);
+ ap2 = ap1;
+ if (va_arg(ap2, int) != 123 || va_arg(ap1, int) != 123) { exit(1); }
+ va_end(ap1); va_end(ap2);
+ }
+ int main()
+ { foo(0, 123); return(0); }],
+ [ac_cv_valistisarray=false],
+ [ac_cv_valistisarray=true],
+ [ac_cv_valistisarray=false])])
+
+if test "$ac_cv_valistisarray" = true ; then
+ AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+
AC_CONFIG_FILES( \
Makefile \
src/bin/anoperc \