summaryrefslogtreecommitdiff
path: root/source3/configure.in
diff options
context:
space:
mode:
authorJames Peach <jpeach@samba.org>2006-05-29 02:25:36 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:17:13 -0500
commit5f8eb1165154abc5bbb56edd27157176e5092cff (patch)
treeb524fea74192015cfce6d854177b1dea44f945d3 /source3/configure.in
parent4c411c9bb96adb664d81b32ada68bc92e2f2df59 (diff)
downloadsamba-5f8eb1165154abc5bbb56edd27157176e5092cff.tar.gz
samba-5f8eb1165154abc5bbb56edd27157176e5092cff.tar.bz2
samba-5f8eb1165154abc5bbb56edd27157176e5092cff.zip
r15928: When we search for clock_gettime, we might find it in librt, but librt
might pull in libpthread. This is quite bad, firstly because it can cause oplock signals on Linux to go wonky, and secondly because merely linking with pthreads can cause performance degradations due to implicit locking requirements. The solution is to only search for clock_gettime if --with-profiling-data was specified. If we do end up searching for it, then we test whether linking with librt pulled in libpthread, and we only allow the definition for clock_gettime to succeed if libpthread was NOT linked in. Problem reported by Thomas Bork and diagnosed by Volker Lendecke. (This used to be commit 5712644fcc00939b9101b2e3143674d2cbdf1e12)
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