summaryrefslogtreecommitdiff
path: root/source3/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'source3/configure.in')
-rw-r--r--source3/configure.in54
1 files changed, 35 insertions, 19 deletions
diff --git a/source3/configure.in b/source3/configure.in
index dabdca8756..17ca07fc18 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -412,6 +412,25 @@ then
LIBS="$LIBS -ldmalloc"
fi
+#################################################
+# check for a shared memory profiling support
+AC_MSG_CHECKING(whether to use profiling)
+AC_ARG_WITH(profiling-data,
+[ --with-profiling-data Include gathering source code profile information (default=no)],
+[ case "$withval" in
+ yes)
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(WITH_PROFILE,1,[Whether to use profiling])
+ samba_cv_WITH_PROFILE=yes
+ ;;
+ *)
+ AC_MSG_RESULT(no)
+ samba_cv_WITH_PROFILE=no
+ ;;
+ esac ],
+ AC_MSG_RESULT(no)
+)
+
dnl Checks for programs.
##
@@ -2024,7 +2043,22 @@ if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
AC_DEFINE(HAVE_GETTIMEOFDAY_TZ,1,[Whether gettimeofday() is available])
fi
-AC_LIBTESTFUNC(rt, clock_gettime)
+if test x"$samba_cv_WITH_PROFILE" = x"yes"; then
+
+ # On some systems (eg. Linux) librt can pull in libpthread. We
+ # don't want this to happen because libpthreads changes signal delivery
+ # semantics in ways we are not prepared for. This breaks Linux oplocks
+ # which rely on signals.
+
+ AC_LIBTESTFUNC(rt, clock_gettime,
+ [
+ SMB_IS_LIBPTHREAD_LINKED(
+ [ SMB_REMOVELIB(rt) ],
+ [ AC_DEFINE(HAVE_CLOCK_GETTIME, 1,
+ [Whether clock_gettime is available]) ])
+ ])
+
+fi
AC_CACHE_CHECK([for va_copy],samba_cv_HAVE_VA_COPY,[
AC_TRY_LINK([#include <stdarg.h>
@@ -3976,24 +4010,6 @@ AC_ARG_WITH(syslog,
)
#################################################
-# check for a shared memory profiling support
-AC_MSG_CHECKING(whether to use profiling)
-AC_ARG_WITH(profiling-data,
-[ --with-profiling-data Include gathering source code profile information (default=no)],
-[ case "$withval" in
- yes)
- AC_MSG_RESULT(yes)
- AC_DEFINE(WITH_PROFILE,1,[Whether to use profiling])
- ;;
- *)
- AC_MSG_RESULT(no)
- ;;
- esac ],
- AC_MSG_RESULT(no)
-)
-
-
-#################################################
# check for experimental disk-quotas support
samba_cv_WITH_QUOTAS=auto