Update m4.
[awesomized/libmemcached] / m4 / ax_pthread_timedjoin_np.m4
1 # ===========================================================================
2 # http://
3 # ===========================================================================
4 #
5 # SYNOPSIS
6 #
7 # AX_PTHREAD_TIMEDJOIN_NP()
8 #
9 # DESCRIPTION
10 #
11 # Check for pthread_timedjoin_np support.
12 #
13 # LICENSE
14 #
15 # Copyright (c) 2012 Brian Aker <brian@tangent.org>
16 #
17 # Copying and distribution of this file, with or without modification, are
18 # permitted in any medium without royalty provided the copyright notice
19 # and this notice are preserved. This file is offered as-is, without any
20 # warranty.
21
22 #serial 5
23
24 AC_DEFUN([AX_PTHREAD_TIMEDJOIN_NP], [
25 AC_REQUIRE([AX_PTHREAD])
26 AC_CACHE_CHECK([check for pthread_timedjoin_np], [ax_cv_pthread_timedjoin_np], [
27 AX_SAVE_FLAGS
28 CFLAGS="$PTHREAD_CFLAGS"
29 LIBS="$PTHREAD_LIBS"
30 AC_LANG_PUSH([C])
31 AC_LINK_IFELSE([
32 AC_LANG_PROGRAM([
33 #include <pthread.h>
34 #include <stdlib.h>
35 ], [
36 pthread_t thread;
37 pthread_timedjoin_np(thread, NULL, NULL);
38 ])],
39 [ax_cv_pthread_timedjoin_np=yes],
40 [])
41
42 AC_LANG_POP
43 AX_RESTORE_FLAGS
44 ])
45
46 AS_IF([test "$ax_cv_pthread_timedjoin_np" = yes],[
47 AC_DEFINE(HAVE_PTHREAD_TIMEDJOIN_NP,[1],[Define if pthread_timedjoin_np is present in pthread.h.])],[
48 AC_DEFINE(HAVE_PTHREAD_TIMEDJOIN_NP,[0],[Define if pthread_timedjoin_np is present in pthread.h.])
49 ])
50 ])
51