-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.in
executable file
·70 lines (42 loc) · 1.42 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
dnl
dnl Configuration things for affyio
dnl
AC_INIT("DESCRIPTION")
dnl
dnl Are things (still) the same ?
dnl (taken from the 'writing R extensions manual')
R_ZLIB
AC_LANG(C)
AC_CHECK_LIB(pthread, pthread_create)
AC_TRY_LINK_FUNC(pthread_create, [use_pthreads=yes], [use_pthreads=no])
AC_MSG_CHECKING([if we can use pthreads])
AC_MSG_RESULT($use_pthreads)
AC_MSG_CHECKING([if PTHREAD_STACK_MIN is defined])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#include <pthread.h>
#include <limits.h>
int main () {size_t stacksize = PTHREAD_STACK_MIN + 0x4000;
}
])],[use_pthread_stack_min=yes], [use_pthread_stack_min=no])
AC_MSG_RESULT($use_pthread_stack_min)
if test "x$use_pthread_stack_min" = xno; then
use_pthreads=no
fi
AC_ARG_ENABLE([threading],
AS_HELP_STRING([--disable-threading],[Disable threading]))
AS_IF([test "x$enable_threading" != "xno" ],[
if test "x${use_pthreads}" = "xno"; then
AC_MSG_NOTICE(------------------------------------------)
AC_MSG_NOTICE( Unable to find pthreads on this system. )
AC_MSG_NOTICE( Building a single-threaded version. )
AC_MSG_NOTICE(------------------------------------------)
fi
if test "x${use_pthreads}" = "xyes"; then
AC_MSG_NOTICE(Enabling threading for affyio)
AC_DEFINE(USE_PTHREADS, 1)
fi
],
[
AC_MSG_NOTICE(Disabling threading for affyio)
])
AC_OUTPUT(src/Makevars)