[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-68-g50d5eec

Stefan Metzmacher metze at samba.org
Thu Oct 18 08:56:35 GMT 2007


The branch, v3-2-test has been updated
       via  50d5eec508bd5b98b81825b4e20c06f698029fdf (commit)
       via  1eefa0264bb1a304a30ec4c7c6e2392c627ee6a3 (commit)
      from  b4746009735bf66b2578b884973c505b0363a79d (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit 50d5eec508bd5b98b81825b4e20c06f698029fdf
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Oct 18 10:55:59 2007 +0200

    remove configure checks which are now in libreplace
    
    metze

commit 1eefa0264bb1a304a30ec4c7c6e2392c627ee6a3
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Oct 18 10:54:37 2007 +0200

    [libreplace] fix the standalone build of libreplace
    
    all configure results which are used in replace.h
    or any system/*.h should be in the in the libreplace
    *.m4 files!
    
    metze

-----------------------------------------------------------------------

Summary of changes:
 source/configure.in                     |   62 -------------------------------
 source/lib/replace/libreplace.m4        |   39 ++++++-------------
 source/lib/replace/libreplace_macros.m4 |   23 +++++++++++-
 3 files changed, 34 insertions(+), 90 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/configure.in b/source/configure.in
index d1a05d1..22989db 100644
--- a/source/configure.in
+++ b/source/configure.in
@@ -2939,40 +2939,6 @@ SMB_CHECK_SYSCONF(_SC_NPROCESSORS_ONLN)
 SMB_CHECK_SYSCONF(_SC_PAGESIZE)
 AC_CHECK_FUNCS(getpagesize)
 
-dnl test for socklen_t
-AC_CACHE_CHECK([for socklen_t],samba_cv_HAVE_SA_FAMILY_T,[
-AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <unistd.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-],
-[
-socklen_t foo;
-],
-samba_cv_HAVE_SOCKLEN_T=yes,samba_cv_HAVE_SOCKLEN_T=no)])
-if test x"$samba_cv_HAVE_SOCKLEN_T" = x"yes"; then
-    AC_DEFINE(HAVE_SOCKLEN_T,1,[Whether the system has socklen_t])
-fi
-
-dnl test for sa_family_t
-AC_CACHE_CHECK([for sa_family_t],samba_cv_HAVE_SA_FAMILY_T,[
-AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <unistd.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-],
-[
-sa_family_t foo;
-],
-samba_cv_HAVE_SA_FAMILY_T=yes,samba_cv_HAVE_SA_FAMILY_T=no)])
-if test x"$samba_cv_HAVE_SA_FAMILY_T" = x"yes"; then
-    AC_DEFINE(HAVE_SA_FAMILY_T,1,[Whether the system has sa_family_t])
-fi
-
 dnl test for getifaddrs and freeifaddrs
 AC_CACHE_CHECK([for getifaddrs and freeifaddrs],samba_cv_HAVE_GETIFADDRS,[
 AC_TRY_COMPILE([
@@ -3084,34 +3050,6 @@ if test x"$samba_cv_HAVE_IPV6" = x"yes"; then
     AC_DEFINE(HAVE_IPV6,1,[Whether the system has IPv6 support])
 fi
 
-dnl test for struct sockaddr_storage
-AC_CACHE_CHECK([for struct sockaddr_storage],samba_cv_HAVE_STRUCT_SOCKADDR_STORAGE,[
-AC_TRY_COMPILE([
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <netinet/in.h>],
-[
-struct sockaddr_storage sa_store;
-],
-samba_cv_HAVE_STRUCT_SOCKADDR_STORAGE=yes,samba_cv_HAVE_STRUCT_SOCKADDR_STORAGE=no)])
-if test x"$samba_cv_HAVE_STRUCT_SOCKADDR_STORAGE" = x"yes"; then
-    AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE,1,[Whether the system has struct sockaddr_storage])
-fi
-
-dnl test for struct struct sockaddr_in6
-AC_CACHE_CHECK([for struct sockaddr_in6],samba_cv_HAVE_STRUCT_SOCKADDR_IN6,[
-AC_TRY_COMPILE([
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <netinet/in.h>],
-[
-struct sockaddr_in6 sa6;
-],
-samba_cv_HAVE_STRUCT_SOCKADDR_IN6=yes,samba_cv_HAVE_STRUCT_SOCKADDR_IN6=no)])
-if test x"$samba_cv_HAVE_STRUCT_SOCKADDR_IN6" = x"yes"; then
-    AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6,1,[Whether the system has struct sockaddr_in6])
-fi
-
 ################################################
 # look for a method of setting the effective uid
 seteuid=no;
diff --git a/source/lib/replace/libreplace.m4 b/source/lib/replace/libreplace.m4
index 4bdbf3a..26b4c36 100644
--- a/source/lib/replace/libreplace.m4
+++ b/source/lib/replace/libreplace.m4
@@ -137,23 +137,20 @@ if test x"$samba_cv_REPLACE_INET_NTOA" = x"yes"; then
     AC_DEFINE(REPLACE_INET_NTOA,1,[Whether inet_ntoa should be replaced])
 fi
 
-dnl test for struct addrinfo
-AC_CACHE_CHECK([for struct addrinfo],samba_cv_HAVE_STRUCT_ADDRINFO,[
-AC_TRY_COMPILE([
+AC_HAVE_TYPE([socklen_t],[#include <sys/socket.h>])
+AC_HAVE_TYPE([sa_family_t],[#include <sys/socket.h>])
+AC_HAVE_TYPE([struct addrinfo], [#include <netdb.h>])
+AC_HAVE_TYPE([struct sockaddr], [#include <sys/socket.h>])
+AC_HAVE_TYPE([struct sockaddr_storage], [
+#include <sys/socket.h>
 #include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
+#include <netinet/in.h>
+])
+AC_HAVE_TYPE([struct sockaddr_in6], [
 #include <sys/socket.h>
-#include <netdb.h>],
-[
-struct addrinfo ai;
-],
-samba_cv_HAVE_STRUCT_ADDRINFO=yes,samba_cv_HAVE_STRUCT_ADDRINFO=no)])
-if test x"$samba_cv_HAVE_STRUCT_ADDRINFO" = x"yes"; then
-    AC_DEFINE(HAVE_STRUCT_ADDRINFO,1,[Whether the system has struct addrinfo])
-fi
+#include <sys/types.h>
+#include <netinet/in.h>
+])
 
 dnl test for getaddrinfo/getnameinfo
 AC_CACHE_CHECK([for getaddrinfo],samba_cv_HAVE_GETADDRINFO,[
@@ -185,18 +182,6 @@ if test x"$samba_cv_HAVE_GETADDRINFO" = x"yes"; then
     AC_DEFINE(HAVE_GAI_STRERROR,1,[Whether the system has gai_strerror])
 fi
 
-
-dnl Provided by replace.c:
-AC_TRY_COMPILE([
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-#include <sys/socket.h>], 
-[socklen_t foo;],,
-[AC_DEFINE(socklen_t, int,[Socket length type])])
-
 AC_CHECK_FUNCS(seteuid setresuid setegid setresgid chroot bzero strerror)
 AC_CHECK_FUNCS(vsyslog setlinebuf mktime ftruncate chsize rename)
 AC_CHECK_FUNCS(waitpid strlcpy strlcat initgroups memmove strdup)
diff --git a/source/lib/replace/libreplace_macros.m4 b/source/lib/replace/libreplace_macros.m4
index f262b9b..da46f67 100644
--- a/source/lib/replace/libreplace_macros.m4
+++ b/source/lib/replace/libreplace_macros.m4
@@ -314,4 +314,25 @@ AC_DEFUN(LIBREPLACE_PROVIDE_HEADER,
 	)
 ])
 
-
+dnl AC_HAVE_TYPE(TYPE,INCLUDES)
+AC_DEFUN([AC_HAVE_TYPE], [
+AC_REQUIRE([AC_HEADER_STDC])
+cv=`echo "$1" | sed 'y%./+- %__p__%'`
+AC_MSG_CHECKING(for $1)
+AC_CACHE_VAL([ac_cv_type_$cv],
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+AC_INCLUDES_DEFAULT
+$2]],
+[[$1 foo;]])],
+[eval "ac_cv_type_$cv=yes"],
+[eval "ac_cv_type_$cv=no"]))dnl
+ac_foo=`eval echo \\$ac_cv_type_$cv`
+AC_MSG_RESULT($ac_foo)
+if test "$ac_foo" = yes; then
+  ac_tr_hdr=HAVE_`echo $1 | sed 'y%abcdefghijklmnopqrstuvwxyz./- %ABCDEFGHIJKLMNOPQRSTUVWXYZ____%'`
+if false; then
+	AC_CHECK_TYPES($1)
+fi
+  AC_DEFINE_UNQUOTED($ac_tr_hdr, 1, [Define if you have type `$1'])
+fi
+])


-- 
Samba Shared Repository


More information about the samba-cvs mailing list