Some spelling mistakes in aclocal.m4 and the va_copy fixups in configure.in
authorRichard Sharpe <sharpe@samba.org>
Fri, 24 Oct 2003 16:08:03 +0000 (16:08 +0000)
committerRichard Sharpe <sharpe@samba.org>
Fri, 24 Oct 2003 16:08:03 +0000 (16:08 +0000)
and lib/snprintf. Check for va_copy first, and then look for __va_copy.
(This used to be commit 8b592740b6294555c461d7eee003e2bd5f4352a4)

source3/aclocal.m4
source3/configure.in
source3/lib/snprintf.c

index c7831c58caaac873822cae40a41f186b8b907ca0..5169eee41b4be91ed7aa6b0310b239bca3ed4350 100644 (file)
@@ -125,11 +125,11 @@ AC_DEFUN(AC_LIBTESTFUNC,
 # may have different results.
 #
 # Note that using directly AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$3])
-# is asking for troubles, since AC_CHECK_LIB($lib, fun) would give
+# is asking for trouble, since AC_CHECK_LIB($lib, fun) would give
 # ac_cv_lib_$lib_fun, which is definitely not what was meant.  Hence
 # the AS_LITERAL_IF indirection.
 #
-# FIXME: This macro is extremely suspicious.  It DEFINEs unconditionnally,
+# FIXME: This macro is extremely suspicious.  It DEFINEs unconditionally,
 # whatever the FUNCTION, in addition to not being a *S macro.  Note
 # that the cache does depend upon the function we are looking for.
 #
index 6946ab06b3e09103e8db089e88cf36a1608006e7..e270b1efffe4e111989492adf9190b31f5b73f19 100644 (file)
@@ -1391,12 +1391,21 @@ if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
     AC_DEFINE(HAVE_GETTIMEOFDAY_TZ,1,[Whether gettimeofday() is available])
 fi
 
-AC_CACHE_CHECK([for __va_copy],samba_cv_HAVE_VA_COPY,[
+AC_CACHE_CHECK([for va_copy],samba_cv_HAVE_VA_COPY,[
 AC_TRY_LINK([#include <stdarg.h>
-va_list ap1,ap2;], [__va_copy(ap1,ap2);],
+va_list ap1,ap2;], [va_copy(ap1,ap2);],
 samba_cv_HAVE_VA_COPY=yes,samba_cv_HAVE_VA_COPY=no)])
 if test x"$samba_cv_HAVE_VA_COPY" = x"yes"; then
-    AC_DEFINE(HAVE_VA_COPY,1,[Whether __va_copy() is available])
+    AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
+else
+    AC_CACHE_CHECK([for __va_copy],samba_cv_HAVE___VA_COPY,[
+    AC_TRY_LINK([#include <stdarg.h>
+    va_list ap1,ap2;], [__va_copy(ap1,ap2);],
+    samba_cv_HAVE___VA_COPY=yes,
+    samba_cv_HAVE___VA_COPY=no)])
+    if test x"$samba_cv_HAVE___VA_COPY" = x"yes"; then
+        AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
+    fi
 fi
 
 AC_CACHE_CHECK([for C99 vsnprintf],samba_cv_HAVE_C99_VSNPRINTF,[
@@ -1606,7 +1615,7 @@ dnl Try to find iconv(3)
     if test "$ICONV_FOUND" = yes; then
         LIB_ADD_DIR(LDFLAGS, "$i/lib")
         CFLAGS_ADD_DIR(CPPFLAGS, "$i/include")
-        LIBS="$save_LIBS $LIBS"
+        LIBS="$save_LIBS"
         ICONV_LOCATION=$i
         export LDFLAGS LIBS CPPFLAGS
 dnl Now, check for a working iconv ... we want to do it here because
@@ -1670,9 +1679,9 @@ dnl ])
 
         LIBS="$ic_save_LIBS"
         if test x"$samba_cv_HAVE_NATIVE_ICONV" = x"yes"; then
-               CPPFLAGS=$save_CPPFLAGS
-               CFLAGS_ADD_DIR(CPPFLAGS, "$i/include")
-               export CPPFLAGS
+          CPPFLAGS=$save_CPPFLAGS
+          CFLAGS_ADD_DIR(CPPFLAGS, "$i/include")
+          export CPPFLAGS
            AC_DEFINE(HAVE_NATIVE_ICONV,1,[Whether to use native iconv])
           AC_DEFINE_UNQUOTED(DEFAULT_DOS_CHARSET,$default_dos_charset,[Default dos charset name])
           AC_DEFINE_UNQUOTED(DEFAULT_DISPLAY_CHARSET,$default_display_charset,[Default display charset name])
index a2f9f592db3e04f93d24f2b25f6399b1f8f59caa..5b0cfa1ab337774fcc4c48bc0936a817dd574536 100644 (file)
 
 #ifndef VA_COPY
 #ifdef HAVE_VA_COPY
+#define VA_COPY(dest, src) va_copy(dest, src)
+#else
+#ifdef HAVE___VA_COPY
 #define VA_COPY(dest, src) __va_copy(dest, src)
 #else
 #define VA_COPY(dest, src) (dest) = (src)
 #endif
+#endif
 
 /*
  * dopr(): poor man's version of doprintf