Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 86 lines (60 sloc) 1.716 kB
91549cf Move config code into separate file
Sascha Schumann authored
1
2 AC_DEFUN(TSRM_BASIC_CHECKS,[
3
4 AC_REQUIRE([AC_PROG_CC])dnl
5 dnl AC_REQUIRE([AM_PROG_CC_STDC])dnl
6 AC_REQUIRE([AC_PROG_CC_C_O])dnl
7 AC_REQUIRE([AC_PROG_RANLIB])dnl
8
9 AC_CHECK_HEADERS(stdarg.h)
10
11 ])
12
fa1f318 Enable TSRM to use Pth
Sascha Schumann authored
13
14 AC_DEFUN(TSRM_CHECK_PTH,[
15
16 AC_MSG_CHECKING(for GNU Pth)
17 PTH_PREFIX="`$1 --prefix`"
18 if test -z "$PTH_PREFIX"; then
19 AC_MSG_RESULT(Please check your Pth installation)
20 fi
21
22 CPPFLAGS="$CPPFLAGS `$1 --cflags`"
23 LDFLAGS="$LDFLAGS `$1 --ldflags`"
24 LIBS="$LIBS `$1 --libs`"
25
26 AC_DEFINE(GNUPTH, 1, [Whether you use GNU Pth])
27 AC_MSG_RESULT(yes - installed in $PTH_PREFIX)
28
29 ])
30
31
32 AC_DEFUN(TSRM_CHECK_PTHREADS,[
91549cf Move config code into separate file
Sascha Schumann authored
33
4fb1e27 Improve Pthreads check
Sascha Schumann authored
34 dnl Check for FreeBSD/Linux -pthread option
91549cf Move config code into separate file
Sascha Schumann authored
35
4fb1e27 Improve Pthreads check
Sascha Schumann authored
36 old_LDFLAGS="$LDFLAGS"
37 LDFLAGS="$LDFLAGS -pthread"
91549cf Move config code into separate file
Sascha Schumann authored
38 AC_CHECK_FUNCS(pthread_kill)
39
40 if test "$ac_cv_func_pthread_kill" != "yes"; then
4fb1e27 Improve Pthreads check
Sascha Schumann authored
41 LDFLAGS="$old_LDFLAGS"
42 dnl Fall back to the standard -lpthread
43 AC_CHECK_LIB(pthread, pthread_kill)
44 unset ac_cv_func_pthread_kill
45 AC_CHECK_FUNCS(pthread_kill)
46 if test "$ac_cv_func_pthread_kill" != "yes"; then
47 AC_MSG_ERROR(You need Pthreads to build TSRM on UNIX.)
48 fi
91549cf Move config code into separate file
Sascha Schumann authored
49 fi
4fb1e27 Improve Pthreads check
Sascha Schumann authored
50
91549cf Move config code into separate file
Sascha Schumann authored
51 AC_DEFINE(PTHREADS, [], Whether to use Pthreads)
fa1f318 Enable TSRM to use Pth
Sascha Schumann authored
52
53 AC_MSG_CHECKING(for POSIX threads)
54 AC_MSG_RESULT(yes)
55 ])
56
57
58 AC_DEFUN(TSRM_OTHER_CHECKS,[
59
60 dnl For the thread implementations, we always use --with-*
61 dnl to maintain consistency
62
63 AC_ARG_WITH(tsrm-pth,
64 [ --with-tsrm-pth[=pth-config] Use GNU Pth.],[
65 TSRM_PTH=$withval
66 ],[
67 TSRM_PTH=no
68 ])
69
70 AC_ARG_WITH(tsrm-pthreads,
71 [ --with-tsrm-pthreads Use POSIX threads (default)],[
72 TSRM_PTHREADS=$withval
73 ],[
74 TSRM_PTHREADS=yes
75 ])
76
77 test "$TSRM_PTH" = "yes" && TSRM_PTH=pth-config
78
79 if test "$TSRM_PTH" != "no"; then
80 TSRM_CHECK_PTH($TSRM_PTH)
81 elif test "$TSRM_PTHREADS" != "no"; then
82 TSRM_CHECK_PTHREADS
83 fi
84
91549cf Move config code into separate file
Sascha Schumann authored
85 ])
Something went wrong with that request. Please try again.