annotate m4/timer_time.m4 @ 40196:e63f5d3edab5

relocatable-prog: Update documentation. * doc/relocatable-maint.texi (Supporting Relocation): Update to match the recent changes.
author Bruno Haible <bruno@clisp.org>
date Sun, 24 Feb 2019 01:49:15 +0100
parents b06060465f09
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17682
68b0a0f80871 pthread_sigmask, timer-time: use gl_THREADLIB only if needed
Paul Eggert <eggert@cs.ucla.edu>
parents: 17616
diff changeset
1 # timer_time.m4 serial 3
40057
b06060465f09 maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents: 19484
diff changeset
2 dnl Copyright (C) 2011-2019 Free Software Foundation, Inc.
15436
904d3cee5cc3 timer-time: A new module to check for timer_settime()
Pádraig Brady <P@draigBrady.com>
parents:
diff changeset
3 dnl This file is free software; the Free Software Foundation
904d3cee5cc3 timer-time: A new module to check for timer_settime()
Pádraig Brady <P@draigBrady.com>
parents:
diff changeset
4 dnl gives unlimited permission to copy and/or distribute it,
904d3cee5cc3 timer-time: A new module to check for timer_settime()
Pádraig Brady <P@draigBrady.com>
parents:
diff changeset
5 dnl with or without modifications, as long as this notice is preserved.
904d3cee5cc3 timer-time: A new module to check for timer_settime()
Pádraig Brady <P@draigBrady.com>
parents:
diff changeset
6
904d3cee5cc3 timer-time: A new module to check for timer_settime()
Pádraig Brady <P@draigBrady.com>
parents:
diff changeset
7 # Check for timer_settime, and set LIB_TIMER_TIME.
904d3cee5cc3 timer-time: A new module to check for timer_settime()
Pádraig Brady <P@draigBrady.com>
parents:
diff changeset
8
904d3cee5cc3 timer-time: A new module to check for timer_settime()
Pádraig Brady <P@draigBrady.com>
parents:
diff changeset
9 AC_DEFUN([gl_TIMER_TIME],
904d3cee5cc3 timer-time: A new module to check for timer_settime()
Pádraig Brady <P@draigBrady.com>
parents:
diff changeset
10 [
904d3cee5cc3 timer-time: A new module to check for timer_settime()
Pádraig Brady <P@draigBrady.com>
parents:
diff changeset
11 dnl Based on clock_time.m4. See details there.
904d3cee5cc3 timer-time: A new module to check for timer_settime()
Pádraig Brady <P@draigBrady.com>
parents:
diff changeset
12
904d3cee5cc3 timer-time: A new module to check for timer_settime()
Pádraig Brady <P@draigBrady.com>
parents:
diff changeset
13 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
17682
68b0a0f80871 pthread_sigmask, timer-time: use gl_THREADLIB only if needed
Paul Eggert <eggert@cs.ucla.edu>
parents: 17616
diff changeset
14
68b0a0f80871 pthread_sigmask, timer-time: use gl_THREADLIB only if needed
Paul Eggert <eggert@cs.ucla.edu>
parents: 17616
diff changeset
15 dnl Test whether the gnulib module 'threadlib' is in use.
68b0a0f80871 pthread_sigmask, timer-time: use gl_THREADLIB only if needed
Paul Eggert <eggert@cs.ucla.edu>
parents: 17616
diff changeset
16 dnl Some packages like Emacs use --avoid=threadlib.
68b0a0f80871 pthread_sigmask, timer-time: use gl_THREADLIB only if needed
Paul Eggert <eggert@cs.ucla.edu>
parents: 17616
diff changeset
17 dnl Write the symbol in such a way that it does not cause 'aclocal' to pick
68b0a0f80871 pthread_sigmask, timer-time: use gl_THREADLIB only if needed
Paul Eggert <eggert@cs.ucla.edu>
parents: 17616
diff changeset
18 dnl the threadlib.m4 file that is installed in $PREFIX/share/aclocal/.
68b0a0f80871 pthread_sigmask, timer-time: use gl_THREADLIB only if needed
Paul Eggert <eggert@cs.ucla.edu>
parents: 17616
diff changeset
19 m4_ifdef([gl_][THREADLIB], [AC_REQUIRE([gl_][THREADLIB])])
15436
904d3cee5cc3 timer-time: A new module to check for timer_settime()
Pádraig Brady <P@draigBrady.com>
parents:
diff changeset
20
904d3cee5cc3 timer-time: A new module to check for timer_settime()
Pádraig Brady <P@draigBrady.com>
parents:
diff changeset
21 LIB_TIMER_TIME=
904d3cee5cc3 timer-time: A new module to check for timer_settime()
Pádraig Brady <P@draigBrady.com>
parents:
diff changeset
22 AC_SUBST([LIB_TIMER_TIME])
904d3cee5cc3 timer-time: A new module to check for timer_settime()
Pádraig Brady <P@draigBrady.com>
parents:
diff changeset
23 gl_saved_libs=$LIBS
904d3cee5cc3 timer-time: A new module to check for timer_settime()
Pádraig Brady <P@draigBrady.com>
parents:
diff changeset
24 AC_SEARCH_LIBS([timer_settime], [rt posix4],
904d3cee5cc3 timer-time: A new module to check for timer_settime()
Pádraig Brady <P@draigBrady.com>
parents:
diff changeset
25 [test "$ac_cv_search_timer_settime" = "none required" ||
904d3cee5cc3 timer-time: A new module to check for timer_settime()
Pádraig Brady <P@draigBrady.com>
parents:
diff changeset
26 LIB_TIMER_TIME=$ac_cv_search_timer_settime])
17682
68b0a0f80871 pthread_sigmask, timer-time: use gl_THREADLIB only if needed
Paul Eggert <eggert@cs.ucla.edu>
parents: 17616
diff changeset
27 m4_ifdef([gl_][THREADLIB],
68b0a0f80871 pthread_sigmask, timer-time: use gl_THREADLIB only if needed
Paul Eggert <eggert@cs.ucla.edu>
parents: 17616
diff changeset
28 [dnl GLIBC uses threads to emulate posix timers when kernel support
68b0a0f80871 pthread_sigmask, timer-time: use gl_THREADLIB only if needed
Paul Eggert <eggert@cs.ucla.edu>
parents: 17616
diff changeset
29 dnl is not available (like Linux < 2.6 or when used with kFreeBSD)
68b0a0f80871 pthread_sigmask, timer-time: use gl_THREADLIB only if needed
Paul Eggert <eggert@cs.ucla.edu>
parents: 17616
diff changeset
30 dnl Now the pthread lib is linked automatically in the normal case,
68b0a0f80871 pthread_sigmask, timer-time: use gl_THREADLIB only if needed
Paul Eggert <eggert@cs.ucla.edu>
parents: 17616
diff changeset
31 dnl but when linking statically, it needs to be explicitly specified.
68b0a0f80871 pthread_sigmask, timer-time: use gl_THREADLIB only if needed
Paul Eggert <eggert@cs.ucla.edu>
parents: 17616
diff changeset
32 AC_EGREP_CPP([Thread],
68b0a0f80871 pthread_sigmask, timer-time: use gl_THREADLIB only if needed
Paul Eggert <eggert@cs.ucla.edu>
parents: 17616
diff changeset
33 [#include <features.h>
68b0a0f80871 pthread_sigmask, timer-time: use gl_THREADLIB only if needed
Paul Eggert <eggert@cs.ucla.edu>
parents: 17616
diff changeset
34 #ifdef __GNU_LIBRARY__
68b0a0f80871 pthread_sigmask, timer-time: use gl_THREADLIB only if needed
Paul Eggert <eggert@cs.ucla.edu>
parents: 17616
diff changeset
35 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || (__GLIBC__ > 2)) \
68b0a0f80871 pthread_sigmask, timer-time: use gl_THREADLIB only if needed
Paul Eggert <eggert@cs.ucla.edu>
parents: 17616
diff changeset
36 && !(__UCLIBC__ && __HAS_NO_THREADS__)
68b0a0f80871 pthread_sigmask, timer-time: use gl_THREADLIB only if needed
Paul Eggert <eggert@cs.ucla.edu>
parents: 17616
diff changeset
37 Thread emulation available
68b0a0f80871 pthread_sigmask, timer-time: use gl_THREADLIB only if needed
Paul Eggert <eggert@cs.ucla.edu>
parents: 17616
diff changeset
38 #endif
68b0a0f80871 pthread_sigmask, timer-time: use gl_THREADLIB only if needed
Paul Eggert <eggert@cs.ucla.edu>
parents: 17616
diff changeset
39 #endif
68b0a0f80871 pthread_sigmask, timer-time: use gl_THREADLIB only if needed
Paul Eggert <eggert@cs.ucla.edu>
parents: 17616
diff changeset
40 ],
68b0a0f80871 pthread_sigmask, timer-time: use gl_THREADLIB only if needed
Paul Eggert <eggert@cs.ucla.edu>
parents: 17616
diff changeset
41 [LIB_TIMER_TIME="$LIB_TIMER_TIME $LIBMULTITHREAD"])])
15436
904d3cee5cc3 timer-time: A new module to check for timer_settime()
Pádraig Brady <P@draigBrady.com>
parents:
diff changeset
42 AC_CHECK_FUNCS([timer_settime])
904d3cee5cc3 timer-time: A new module to check for timer_settime()
Pádraig Brady <P@draigBrady.com>
parents:
diff changeset
43 LIBS=$gl_saved_libs
904d3cee5cc3 timer-time: A new module to check for timer_settime()
Pádraig Brady <P@draigBrady.com>
parents:
diff changeset
44 ])