summaryrefslogtreecommitdiff
path: root/source3/aclocal.m4
diff options
context:
space:
mode:
authorJames Peach <jpeach@samba.org>2006-06-09 01:02:54 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:17:20 -0500
commit8882d08b6ba90c45f8107eef3d28614eb643dfb9 (patch)
tree132d98a983eb0cffb53cbc6adc5c3cfcbfb05366 /source3/aclocal.m4
parentb7eaff26dc71a4ecf54ab07674c9b4c4b0273544 (diff)
downloadsamba-8882d08b6ba90c45f8107eef3d28614eb643dfb9.tar.gz
samba-8882d08b6ba90c45f8107eef3d28614eb643dfb9.tar.bz2
samba-8882d08b6ba90c45f8107eef3d28614eb643dfb9.zip
r16111: Patch from Björn JACKE <samba@j3e.de>.
This fixes a problem where the clock definition for clock_gettime() is present at compile time, but is not available on the running system. In this case, we fall back to less-preferred clocks until we find one that we can use. (This used to be commit fc6ed6a1aa2225ccde04c4ecaf0777dc0de4f1cb)
Diffstat (limited to 'source3/aclocal.m4')
-rw-r--r--source3/aclocal.m442
1 files changed, 40 insertions, 2 deletions
diff --git a/source3/aclocal.m4 b/source3/aclocal.m4
index 8abecd216f..59bd26bd24 100644
--- a/source3/aclocal.m4
+++ b/source3/aclocal.m4
@@ -839,10 +839,17 @@ 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_MSG_CHECKING(if libpthread is linked)
AC_TRY_LINK([],
[return pthread_create(0, 0, 0, 0);],
- [$1],
- [$2])
+ [
+ AC_MSG_RESULT(yes)
+ $1
+ ],
+ [
+ AC_MSG_RESULT(no)
+ $2
+ ])
])
dnl SMB_REMOVE_LIB(lib)
@@ -943,3 +950,34 @@ void main(void) {
fi
])
+
+dnl SMB_CHECK_CLOCK_ID(clockid)
+dnl Test whether the specified clock_gettime clock ID is available. If it
+dnl is, we define HAVE_clockid
+AC_DEFUN([SMB_CHECK_CLOCK_ID],
+[
+ AC_MSG_CHECKING(for $1)
+ AC_TRY_LINK([
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+ ],
+ [
+clockid_t clk = $1;
+ ],
+ [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_$1, 1,
+ [Whether the clock_gettime clock ID $1 is available])
+ ],
+ [
+ AC_MSG_RESULT(no)
+ ])
+])