r6804: Add config.h for talloc (and use it)
authorJelmer Vernooij <jelmer@samba.org>
Mon, 16 May 2005 01:57:27 +0000 (01:57 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:16:45 +0000 (13:16 -0500)
source/lib/talloc/autogen.sh
source/lib/talloc/config.m4
source/lib/talloc/configure.in
source/lib/talloc/talloc.c
source/lib/talloc/testsuite.c

index 94148edf698e8ef1e60f4a689ba8d5367d504d00..e118019a397242927cb7eba502e217adf62684d9 100755 (executable)
@@ -1,6 +1,7 @@
 #!/bin/sh
 
 autoconf || exit 1
+autoheader || exit 1
 
 echo "Now run ./configure and then make."
 exit 0
index 298c6691b9565c71cf19c6edb0b569262022fa08..5f653e65776e44bd6819db39c0ace0f2d4290e8f 100644 (file)
@@ -1,3 +1,12 @@
 if test x"$experimental" = x"yes"; then
        SMB_LIBRARY_ENABLE(libtalloc,YES)
 fi
+
+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
+
index 2dfb66a17ea1c4dae53dc375bc5f70526579e7d2..436fe365daeb6250ea28d7caaaa174cc4a164435 100644 (file)
@@ -8,5 +8,7 @@ fi
 AC_PROG_INSTALL
 AC_PATH_PROG(XSLTPROC,xsltproc)
 AC_PATH_PROG(GCOV,gcov)
+AC_CHECK_HEADERS(stdint.h stdarg.h)
+AC_CONFIG_HEADER(config.h)
 sinclude(config.m4)
 AC_OUTPUT(Makefile talloc.pc)
index 46abd89bac5e49c64ee05dc49abb8c8d8c59e294..ca2fd9a288c86409ea8cee875ebba07d52b7b0b7 100644 (file)
@@ -28,7 +28,6 @@
 
 
 #ifdef _SAMBA_BUILD_
-#include "includes.h"
 #if ((SAMBA_VERSION_MAJOR==3)&&(SAMBA_VERSION_MINOR<9))
 /* This is to circumvent SAMBA3's paranoid malloc checker. Here in this file
  * we trust ourselves... */
 #undef realloc
 #endif
 #endif
-#else
+#endif
+
+#include "config.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+
+#ifdef HAVE_STDARG_H
 #include <stdarg.h>
+#else
+#include <varargs.h>
+#endif
+
+#ifdef HAVE_STDINT_H
 #include <stdint.h>
-#include "talloc.h"
-/* assume a modern system */
-#define HAVE_VA_COPY
 #endif
 
+#include "talloc.h"
+
 /* use this to force every realloc to change the pointer, to stress test
    code that might not cope */
 #define ALWAYS_REALLOC 0
index 0447749abdeca0c6cd9b3e2e77c8689df29c719a..0e3d3343160639b96a74993562150d9955541e20 100644 (file)
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#ifdef _SAMBA_BUILD_
-#include "includes.h"
-#else
+#include "config.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+
+#ifdef HAVE_STDARG_H
 #include <stdarg.h>
+#endif
+
 #include <sys/time.h>
 #include <time.h>
+
 #include "talloc.h"
-#endif
 
 /* the test suite can be built standalone, or as part of Samba */
 #ifndef _SAMBA_BUILD_