svn commit: samba r16057 - branches/SAMBA_3_0/source branches/SAMBA_3_0/source/smbd trunk/source trunk/source/smbd

jpeach at samba.org jpeach at samba.org
Tue Jun 6 07:43:18 GMT 2006


Author: jpeach
Date: 2006-06-06 07:43:17 +0000 (Tue, 06 Jun 2006)
New Revision: 16057

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

Log:
Coalesce the DMAPI configure tests into a single macro. Add
a more specific probe to try and eliminate old, incompatible
DMAPI implementations provided by IRIX 6.4 and AIX 4.3.

Modified:
   branches/SAMBA_3_0/source/aclocal.m4
   branches/SAMBA_3_0/source/configure.in
   branches/SAMBA_3_0/source/smbd/dmapi.c
   trunk/source/aclocal.m4
   trunk/source/configure.in
   trunk/source/smbd/dmapi.c


Changeset:
Modified: branches/SAMBA_3_0/source/aclocal.m4
===================================================================
--- branches/SAMBA_3_0/source/aclocal.m4	2006-06-06 04:50:14 UTC (rev 16056)
+++ branches/SAMBA_3_0/source/aclocal.m4	2006-06-06 07:43:17 UTC (rev 16057)
@@ -852,3 +852,94 @@
     LIBS=`echo $LIBS | sed -es/-l$1//g`
 ])
 
+dnl SMB_CHECK_DMAPI([actions if true], [actions if false])
+dnl Check whether DMAPI is available and is a version that we know
+dnl how to deal with. The default truth action is to set samba_dmapi_libs
+dnl to the list of necessary libraries, and to define USE_DMAPI.
+AC_DEFUN([SMB_CHECK_DMAPI],
+[
+    samba_dmapi_libs=""
+
+    if test x"$samba_dmapi_libs" = x"" ; then
+	AC_CHECK_LIB(dm, dm_get_eventlist,
+		[ samba_dmapi_libs="-ldm"], [])
+    fi
+
+    if test x"$samba_dmapi_libs" = x"" ; then
+	AC_CHECK_LIB(jfsdm, dm_get_eventlist,
+		[samba_dmapi_libs="-ljfsdm"], [])
+    fi
+
+    if test x"$samba_dmapi_libs" = x"" ; then
+	AC_CHECK_LIB(xdsm, dm_get_eventlist,
+		[samba_dmapi_libs="-lxdsm"], [])
+    fi
+
+    # Only bother to test ehaders if we have a candidate DMAPI library
+    if test x"$samba_dmapi_libs" != x"" ; then
+	AC_CHECK_HEADERS(sys/dmi.h xfs/dmapi.h sys/jfsdmapi.h sys/dmapi.h)
+    fi
+
+    if test x"$samba_dmapi_libs" != x"" ; then
+	samba_dmapi_save_LIBS="$LIBS"
+	LIBS="$LIBS $samba_dmapi_libs"
+	AC_TRY_LINK(
+		[
+#ifdef HAVE_XFS_DMAPI_H
+#include <xfs/dmapi.h>
+#elif defined(HAVE_SYS_DMI_H)
+#include <sys/dmi.h>
+#elif defined(HAVE_SYS_JFSDMAPI_H)
+#include <sys/jfsdmapi.h>
+#elif defined(HAVE_SYS_DMAPI_H)
+#include <sys/dmapi.h>
+#endif
+		],
+		[
+/* This link test is designed to fail on IRI 6.4, but should
+ * succeed on Linux, IRIX 6.5 and AIX.
+ */
+void main(void) {
+	char * version;
+	dm_eventset_t events;
+	/* This doesn't take an argument on IRIX 6.4. */
+	dm_init_service(&version);
+	/* IRIX 6.4 expects events to be a pointer. */
+	DMEV_ISSET(DM_EVENT_READ, events);
+}
+		],
+		[
+		    true # DMAPI link test succeeded
+		],
+		[
+		    # DMAPI link failure
+		    samba_dmapi_libs=
+		])
+	LIBS="$samba_dmapi_save_LIBS"
+    fi
+
+    if test x"$samba_dmapi_libs" = x"" ; then
+	# DMAPI detection failure actions begin
+	ifelse($2, [],
+	    [
+		AC_ERROR(Failed to detect a supported DMAPI implementation)
+	    ],
+	    [
+		$2
+	    ])
+	# DMAPI detection failure actions end
+    else
+	# DMAPI detection success actions start
+	ifelse($1, [],
+	    [
+		AC_DEFINE(USE_DMAPI, 1,
+		    [Whether we should build DMAPI integration components])
+		AC_MSG_NOTICE(Found DMAPI support in $samba_dmapi_libs)
+	    ],
+	    [
+		$1
+	    ])
+	# DMAPI detection success actions end
+    fi
+
+])

Modified: branches/SAMBA_3_0/source/configure.in
===================================================================
--- branches/SAMBA_3_0/source/configure.in	2006-06-06 04:50:14 UTC (rev 16056)
+++ branches/SAMBA_3_0/source/configure.in	2006-06-06 07:43:17 UTC (rev 16057)
@@ -849,7 +849,6 @@
 AC_CHECK_HEADERS(sys/sysmacros.h security/_pam_macros.h dlfcn.h)
 AC_CHECK_HEADERS(sys/syslog.h syslog.h)
 AC_CHECK_HEADERS(langinfo.h locale.h)
-AC_CHECK_HEADERS(sys/dmi.h xfs/dmapi.h sys/jfsdmapi.h sys/dmapi.h)
 
 AC_CHECK_HEADERS(rpcsvc/yp_prot.h,,,[[
 #if HAVE_RPC_RPC_H
@@ -2473,30 +2472,8 @@
 #################################################
 # Check for DMAPI interfaces in libdm/libjfsdm/libxsdm
 
-AC_CHECK_LIB(dm, dm_get_eventlist,
-	[samba_cv_HAVE_LIBDM=yes; samba_dmapi_libs="-ldm"],
-	[samba_cv_HAVE_LIBDM=no])
+SMB_CHECK_DMAPI([], AC_MSG_NOTICE(DMAPI support not present) )
 
-if test x"$samba_cv_HAVE_LIBDM" = x"yes" ; then
-	AC_DEFINE(HAVE_LIBDM, 1, [Whether dmapi libdm is available])
-fi
-
-AC_CHECK_LIB(jfsdm, dm_get_eventlist,
-	[samba_cv_HAVE_LIBJFSDM=yes; samba_dmapi_libs="-ljfsdm"],
-	[samba_cv_HAVE_LIBJFSDM=no])
-
-if test x"$samba_cv_HAVE_LIBJFSDM" = x"yes" ; then
-	AC_DEFINE(HAVE_LIBJFSDM, 1, [Whether dmapi libjfsdm is available])
-fi
-
-AC_CHECK_LIB(xdsm, dm_get_eventlist,
-	[samba_cv_HAVE_LIBXDSM=yes; samba_dmapi_libs="-lxdsm"],
-	[samba_cv_HAVE_LIBXDSM=no])
-
-if test x"$samba_cv_HAVE_LIBXDSM" = x"yes" ; then
-	AC_DEFINE(HAVE_LIBXDSM, 1, [Whether dmapi libxdsm is available])
-fi
-
 AC_CACHE_CHECK([for kernel share modes],samba_cv_HAVE_KERNEL_SHARE_MODES,[
 AC_TRY_RUN([
 #include <sys/types.h>

Modified: branches/SAMBA_3_0/source/smbd/dmapi.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/dmapi.c	2006-06-06 04:50:14 UTC (rev 16056)
+++ branches/SAMBA_3_0/source/smbd/dmapi.c	2006-06-06 07:43:17 UTC (rev 16057)
@@ -24,12 +24,6 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_DMAPI
 
-#if defined(HAVE_LIBDM) || defined(HAVE_LIBJFSDM) || defined(HAVE_LIBXDSM)
-#if defined(HAVE_XFS_DMAPI_H) || defined(HAVE_SYS_DMI_H) || defined(HAVE_SYS_JFSDMAPI_H) || defined(HAVE_SYS_DMAPI_H)
-#define USE_DMAPI 1
-#endif
-#endif
-
 #ifndef USE_DMAPI
 
 int dmapi_init_session(void) { return -1; }

Modified: trunk/source/aclocal.m4
===================================================================
--- trunk/source/aclocal.m4	2006-06-06 04:50:14 UTC (rev 16056)
+++ trunk/source/aclocal.m4	2006-06-06 07:43:17 UTC (rev 16057)
@@ -852,3 +852,94 @@
     LIBS=`echo $LIBS | sed -es/-l$1//g`
 ])
 
+dnl SMB_CHECK_DMAPI([actions if true], [actions if false])
+dnl Check whether DMAPI is available and is a version that we know
+dnl how to deal with. The default truth action is to set samba_dmapi_libs
+dnl to the list of necessary libraries, and to define USE_DMAPI.
+AC_DEFUN([SMB_CHECK_DMAPI],
+[
+    samba_dmapi_libs=""
+
+    if test x"$samba_dmapi_libs" = x"" ; then
+	AC_CHECK_LIB(dm, dm_get_eventlist,
+		[ samba_dmapi_libs="-ldm"], [])
+    fi
+
+    if test x"$samba_dmapi_libs" = x"" ; then
+	AC_CHECK_LIB(jfsdm, dm_get_eventlist,
+		[samba_dmapi_libs="-ljfsdm"], [])
+    fi
+
+    if test x"$samba_dmapi_libs" = x"" ; then
+	AC_CHECK_LIB(xdsm, dm_get_eventlist,
+		[samba_dmapi_libs="-lxdsm"], [])
+    fi
+
+    # Only bother to test ehaders if we have a candidate DMAPI library
+    if test x"$samba_dmapi_libs" != x"" ; then
+	AC_CHECK_HEADERS(sys/dmi.h xfs/dmapi.h sys/jfsdmapi.h sys/dmapi.h)
+    fi
+
+    if test x"$samba_dmapi_libs" != x"" ; then
+	samba_dmapi_save_LIBS="$LIBS"
+	LIBS="$LIBS $samba_dmapi_libs"
+	AC_TRY_LINK(
+		[
+#ifdef HAVE_XFS_DMAPI_H
+#include <xfs/dmapi.h>
+#elif defined(HAVE_SYS_DMI_H)
+#include <sys/dmi.h>
+#elif defined(HAVE_SYS_JFSDMAPI_H)
+#include <sys/jfsdmapi.h>
+#elif defined(HAVE_SYS_DMAPI_H)
+#include <sys/dmapi.h>
+#endif
+		],
+		[
+/* This link test is designed to fail on IRI 6.4, but should
+ * succeed on Linux, IRIX 6.5 and AIX.
+ */
+void main(void) {
+	char * version;
+	dm_eventset_t events;
+	/* This doesn't take an argument on IRIX 6.4. */
+	dm_init_service(&version);
+	/* IRIX 6.4 expects events to be a pointer. */
+	DMEV_ISSET(DM_EVENT_READ, events);
+}
+		],
+		[
+		    true # DMAPI link test succeeded
+		],
+		[
+		    # DMAPI link failure
+		    samba_dmapi_libs=
+		])
+	LIBS="$samba_dmapi_save_LIBS"
+    fi
+
+    if test x"$samba_dmapi_libs" = x"" ; then
+	# DMAPI detection failure actions begin
+	ifelse($2, [],
+	    [
+		AC_ERROR(Failed to detect a supported DMAPI implementation)
+	    ],
+	    [
+		$2
+	    ])
+	# DMAPI detection failure actions end
+    else
+	# DMAPI detection success actions start
+	ifelse($1, [],
+	    [
+		AC_DEFINE(USE_DMAPI, 1,
+		    [Whether we should build DMAPI integration components])
+		AC_MSG_NOTICE(Found DMAPI support in $samba_dmapi_libs)
+	    ],
+	    [
+		$1
+	    ])
+	# DMAPI detection success actions end
+    fi
+
+])

Modified: trunk/source/configure.in
===================================================================
--- trunk/source/configure.in	2006-06-06 04:50:14 UTC (rev 16056)
+++ trunk/source/configure.in	2006-06-06 07:43:17 UTC (rev 16057)
@@ -849,7 +849,6 @@
 AC_CHECK_HEADERS(sys/sysmacros.h security/_pam_macros.h dlfcn.h)
 AC_CHECK_HEADERS(sys/syslog.h syslog.h)
 AC_CHECK_HEADERS(langinfo.h locale.h)
-AC_CHECK_HEADERS(sys/dmi.h xfs/dmapi.h sys/jfsdmapi.h sys/dmapi.h)
 
 AC_CHECK_HEADERS(rpcsvc/yp_prot.h,,,[[
 #if HAVE_RPC_RPC_H
@@ -2473,30 +2472,8 @@
 #################################################
 # Check for DMAPI interfaces in libdm/libjfsdm/libxsdm
 
-AC_CHECK_LIB(dm, dm_get_eventlist,
-	[samba_cv_HAVE_LIBDM=yes; samba_dmapi_libs="-ldm"],
-	[samba_cv_HAVE_LIBDM=no])
+SMB_CHECK_DMAPI([], AC_MSG_NOTICE(DMAPI support not present) )
 
-if test x"$samba_cv_HAVE_LIBDM" = x"yes" ; then
-	AC_DEFINE(HAVE_LIBDM, 1, [Whether dmapi libdm is available])
-fi
-
-AC_CHECK_LIB(jfsdm, dm_get_eventlist,
-	[samba_cv_HAVE_LIBJFSDM=yes; samba_dmapi_libs="-ljfsdm"],
-	[samba_cv_HAVE_LIBJFSDM=no])
-
-if test x"$samba_cv_HAVE_LIBJFSDM" = x"yes" ; then
-	AC_DEFINE(HAVE_LIBJFSDM, 1, [Whether dmapi libjfsdm is available])
-fi
-
-AC_CHECK_LIB(xdsm, dm_get_eventlist,
-	[samba_cv_HAVE_LIBXDSM=yes; samba_dmapi_libs="-lxdsm"],
-	[samba_cv_HAVE_LIBXDSM=no])
-
-if test x"$samba_cv_HAVE_LIBXDSM" = x"yes" ; then
-	AC_DEFINE(HAVE_LIBXDSM, 1, [Whether dmapi libxdsm is available])
-fi
-
 AC_CACHE_CHECK([for kernel share modes],samba_cv_HAVE_KERNEL_SHARE_MODES,[
 AC_TRY_RUN([
 #include <sys/types.h>

Modified: trunk/source/smbd/dmapi.c
===================================================================
--- trunk/source/smbd/dmapi.c	2006-06-06 04:50:14 UTC (rev 16056)
+++ trunk/source/smbd/dmapi.c	2006-06-06 07:43:17 UTC (rev 16057)
@@ -24,12 +24,6 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_DMAPI
 
-#if defined(HAVE_LIBDM) || defined(HAVE_LIBJFSDM) || defined(HAVE_LIBXDSM)
-#if defined(HAVE_XFS_DMAPI_H) || defined(HAVE_SYS_DMI_H) || defined(HAVE_SYS_JFSDMAPI_H) || defined(HAVE_SYS_DMAPI_H)
-#define USE_DMAPI 1
-#endif
-#endif
-
 #ifndef USE_DMAPI
 
 int dmapi_init_session(void) { return -1; }



More information about the samba-cvs mailing list