1AC_INIT([libpthread-stubs],
2        0.5,
3        [xcb@lists.freedesktop.org])
4AC_CONFIG_SRCDIR([pthread-stubs.pc.in])
5AM_INIT_AUTOMAKE([foreign dist-xz])
6
7dnl Check if the following functions have stubs.
8dnl See the README for specifics about the list.
9funclist="\
10pthread_condattr_destroy \
11pthread_condattr_init \
12pthread_cond_broadcast \
13pthread_cond_destroy \
14pthread_cond_init \
15pthread_cond_signal \
16pthread_cond_timedwait \
17pthread_cond_wait \
18pthread_equal \
19pthread_exit \
20pthread_mutex_destroy \
21pthread_mutex_init \
22pthread_mutex_lock \
23pthread_mutex_unlock \
24pthread_self"
25
26AC_CHECK_FUNCS($funclist, [], [HAVE_STUBS=no])
27
28
29if test "x$HAVE_STUBS" != xno; then
30    PKG_CONFIG_CFLAGS=
31    PKG_CONFIG_LIBS=
32else
33    dnl See the README why '-pthread' is deemed sufficient.
34    PKG_CONFIG_CFLAGS="-pthread"
35    PKG_CONFIG_LIBS="-pthread"
36fi
37
38AC_SUBST([PKG_CONFIG_CFLAGS])
39AC_SUBST([PKG_CONFIG_LIBS])
40
41AC_CONFIG_FILES([Makefile pthread-stubs.pc])
42AC_OUTPUT
43