summaryrefslogtreecommitdiffstats
path: root/source/aclocal.m4
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2006-06-08 20:07:34 +0000
committerGerald Carter <jerry@samba.org>2006-06-08 20:07:34 +0000
commit3a5cc58fde0d53d83d46e37f80670ad6bd67f892 (patch)
treeaf90a90140ba6578e973247176d40c6af54a167a /source/aclocal.m4
parenta1b3f2f9bac039395fa20f0be779367f7e23400a (diff)
downloadsamba-3a5cc58fde0d53d83d46e37f80670ad6bd67f892.tar.gz
samba-3a5cc58fde0d53d83d46e37f80670ad6bd67f892.tar.xz
samba-3a5cc58fde0d53d83d46e37f80670ad6bd67f892.zip
r16104: Set version to 3.0.23rc2
Bring release tree up to current 3.0 tree (svn merge -r15845:16103 $SVNURL/branches/SAMBA_3_0)
Diffstat (limited to 'source/aclocal.m4')
-rw-r--r--source/aclocal.m4167
1 files changed, 155 insertions, 12 deletions
diff --git a/source/aclocal.m4 b/source/aclocal.m4
index 459e4d5c7a0..8abecd216f0 100644
--- a/source/aclocal.m4
+++ b/source/aclocal.m4
@@ -104,31 +104,64 @@ AC_DEFUN(AC_HAVE_DECL,
])
+dnl AC_LIBTESTFUNC(lib, function, [actions if found], [actions if not found])
dnl Check for a function in a library, but don't keep adding the same library
dnl to the LIBS variable. Check whether the function is available in the
dnl current LIBS before adding the library which prevents us spuriously
-dnl adding libraries for symbols that are in libc. On success, this ensures that
-dnl HAVE_FOO is defined.
-AC_LIBTESTFUNC(lib,func)
-AC_DEFUN(AC_LIBTESTFUNC,
+dnl adding libraries for symbols that are in libc.
+dnl
+dnl On success, the default actions ensure that HAVE_FOO is defined. The lib
+dnl is always added to $LIBS if it was found to be necessary. The caller
+dnl can use SMB_LIB_REMOVE to strp this if necessary.
+AC_DEFUN([AC_LIBTESTFUNC],
[
AC_CHECK_FUNCS($2,
[
# $2 was found in libc or existing $LIBS
- AC_DEFINE(translit([HAVE_$2], [a-z], [A-Z]), 1,
- [Whether $2 is available])
+ ifelse($3, [],
+ [
+ AC_DEFINE(translit([HAVE_$2], [a-z], [A-Z]), 1,
+ [Whether $2 is available])
+ ],
+ [
+ $3
+ ])
],
[
# $2 was not found, try adding lib$1
case " $LIBS " in
- *\ -l$1\ *) ;;
- *) AC_CHECK_LIB($1, $2,
+ *\ -l$1\ *)
+ ifelse($4, [],
+ [
+ # $2 was not found and we already had lib$1
+ # nothing to do here by default
+ true
+ ],
+ [ $4 ])
+ ;;
+ *)
+ # $2 was not found, try adding lib$1
+ AC_CHECK_LIB($1, $2,
[
- AC_DEFINE(translit([HAVE_$2], [a-z], [A-Z]), 1,
- [Whether $2 is available])
- LIBS="-l$1 $LIBS"
+ LIBS="-l$1 $LIBS"
+ ifelse($3, [],
+ [
+ AC_DEFINE(translit([HAVE_$2], [a-z], [A-Z]), 1,
+ [Whether $2 is available])
+ ],
+ [
+ $3
+ ])
],
- [])
+ [
+ ifelse($4, [],
+ [
+ # $2 was not found in lib$1
+ # nothing to do here by default
+ true
+ ],
+ [ $4 ])
+ ])
;;
esac
])
@@ -800,3 +833,113 @@ AC_DEFUN([SMB_CHECK_SYSCONF],
AC_DEFINE(SYSCONF$1, 1, [Whether sysconf($1) is available])
fi
])
+
+dnl SMB_IS_LIBPTHREAD_LINKED([actions if true], [actions if false])
+dnl Test whether the current LIBS results in libpthread being present.
+dnl Execute the corresponding user action list.
+AC_DEFUN([SMB_IS_LIBPTHREAD_LINKED],
+[
+ AC_TRY_LINK([],
+ [return pthread_create(0, 0, 0, 0);],
+ [$1],
+ [$2])
+])
+
+dnl SMB_REMOVE_LIB(lib)
+dnl Remove the given library from $LIBS
+AC_DEFUN([SMB_REMOVELIB],
+[
+ 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
+
+])