fix compile errors
[oweals/gnunet.git] / acinclude.m4
1 # See: http://gcc.gnu.org/ml/gcc/2000-05/msg01141.html
2 AC_DEFUN([CHECK_PTHREAD],
3 [
4         AC_CHECK_LIB(pthread,pthread_create,
5         [
6                 PTHREAD_CPPFLAGS=
7                 PTHREAD_LDFLAGS=
8                 PTHREAD_LIBS=-lpthread
9         ],[
10                 AC_MSG_CHECKING(if compiler supports -pthread)
11                 save_CPPFLAGS="$CPPFLAGS"
12                 CPPFLAGS="$CPPFLAGS -pthread"
13                 AC_TRY_LINK(
14                 [
15                         #include <pthread.h>
16                 ],[
17                         pthread_create(0,0,0,0);
18                 ],[
19                         AC_MSG_RESULT(yes)
20                         PTHREAD_CPPFLAGS=-pthread
21                         PTHREAD_LDFLAGS=-pthread
22                         PTHREAD_LIBS=
23                 ],[
24                         AC_MSG_RESULT(no)
25                         AC_MSG_CHECKING(if compiler supports -pthreads)
26                         save_CPPFLAGS="$CPPFLAGS"
27                         CPPFLAGS="$save_CPPFLAGS -pthreads"
28                         AC_TRY_LINK(
29                         [
30                                 #include <pthread.h>
31                         ],[
32                                 pthread_create(0,0,0,0);
33                         ],[
34                                 AC_MSG_RESULT(yes)
35                                 PTHREAD_CPPFLAGS=-pthreads
36                                 PTHREAD_LDFLAGS=-pthreads
37                                 PTHREAD_LIBS=
38                         ],[
39                                 AC_MSG_RESULT(no)
40                                 AC_MSG_CHECKING(if compiler supports -threads)
41                                 save_CPPFLAGS="$CPPFLAGS"
42                                 CPPFLAGS="$save_CPPFLAGS -threads"
43                                 AC_TRY_LINK(
44                                 [
45                                         #include <pthread.h>
46                                 ],[
47                                         pthread_create(0,0,0,0);
48                                 ],[
49                                         AC_MSG_RESULT(yes)
50                                         PTHREAD_CPPFLAGS=-threads
51                                         PTHREAD_LDFLAGS=-threads
52                                         PTHREAD_LIBS=
53                                 ],[
54                                         AC_MSG_ERROR([Your system is not supporting pthreads!])
55                                 ])
56                         ])
57                 ])
58                 CPPFLAGS="$save_CPPFLAGS"
59         ])
60 ])
61
62 dnl Checks for all prerequisites of the intl subdirectory,
63 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
64 dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
65     AC_DEFUN([AM_INTL_SUBDIR], [])