svn commit: samba r6804 - in branches/SAMBA_4_0/source/lib/talloc: .

jelmer at samba.org jelmer at samba.org
Mon May 16 01:57:28 GMT 2005


Author: jelmer
Date: 2005-05-16 01:57:27 +0000 (Mon, 16 May 2005)
New Revision: 6804

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=6804

Log:
Add config.h for talloc (and use it)

Modified:
   branches/SAMBA_4_0/source/lib/talloc/autogen.sh
   branches/SAMBA_4_0/source/lib/talloc/config.m4
   branches/SAMBA_4_0/source/lib/talloc/configure.in
   branches/SAMBA_4_0/source/lib/talloc/talloc.c
   branches/SAMBA_4_0/source/lib/talloc/testsuite.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/talloc/autogen.sh
===================================================================
--- branches/SAMBA_4_0/source/lib/talloc/autogen.sh	2005-05-16 01:31:22 UTC (rev 6803)
+++ branches/SAMBA_4_0/source/lib/talloc/autogen.sh	2005-05-16 01:57:27 UTC (rev 6804)
@@ -1,6 +1,7 @@
 #!/bin/sh
 
 autoconf || exit 1
+autoheader || exit 1
 
 echo "Now run ./configure and then make."
 exit 0

Modified: branches/SAMBA_4_0/source/lib/talloc/config.m4
===================================================================
--- branches/SAMBA_4_0/source/lib/talloc/config.m4	2005-05-16 01:31:22 UTC (rev 6803)
+++ branches/SAMBA_4_0/source/lib/talloc/config.m4	2005-05-16 01:57:27 UTC (rev 6804)
@@ -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
+

Modified: branches/SAMBA_4_0/source/lib/talloc/configure.in
===================================================================
--- branches/SAMBA_4_0/source/lib/talloc/configure.in	2005-05-16 01:31:22 UTC (rev 6803)
+++ branches/SAMBA_4_0/source/lib/talloc/configure.in	2005-05-16 01:57:27 UTC (rev 6804)
@@ -8,5 +8,7 @@
 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)

Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.c
===================================================================
--- branches/SAMBA_4_0/source/lib/talloc/talloc.c	2005-05-16 01:31:22 UTC (rev 6803)
+++ branches/SAMBA_4_0/source/lib/talloc/talloc.c	2005-05-16 01:57:27 UTC (rev 6804)
@@ -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... */
@@ -39,17 +38,26 @@
 #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

Modified: branches/SAMBA_4_0/source/lib/talloc/testsuite.c
===================================================================
--- branches/SAMBA_4_0/source/lib/talloc/testsuite.c	2005-05-16 01:31:22 UTC (rev 6803)
+++ branches/SAMBA_4_0/source/lib/talloc/testsuite.c	2005-05-16 01:57:27 UTC (rev 6804)
@@ -20,17 +20,19 @@
    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_



More information about the samba-cvs mailing list