Browse code

Update configure.in to provide "--disable-threading"

Ben Bolstad authored on 02/09/2017 03:40:30
Showing1 changed files

... ...
@@ -1,12 +1,6 @@
1 1
 dnl
2
-dnl Configuration things for affyR.
3
-dnl (http://www.cbs.dtu.dk/laurent/download/affyR/
4
-dnl What is below (and in the other configuration fiels 
5
-dnl was taken from different configuration scripts for R version 1.3.0.
2
+dnl Configuration things for preprocessCore
6 3
 dnl
7
-dnl Acknowledgments: The author(s) of the R configure scripts, Kurt Hornik for the tip with autoconf.
8
-dnl
9
-dnl Laurent 2001
10 4
 
11 5
 
12 6
 AC_INIT("DESCRIPTION")
... ...
@@ -29,6 +23,7 @@ AC_PROG_CC
29 23
 AC_PROG_CPP
30 24
 
31 25
 
26
+AC_LANG(C)
32 27
 
33 28
 
34 29
 
... ...
@@ -48,13 +43,13 @@ fi
48 43
 
49 44
 
50 45
 AC_MSG_CHECKING([if PTHREAD_STACK_MIN is defined])
51
-AC_COMPILE_IFELSE([
46
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([
52 47
 	#include <pthread.h>
53 48
 	#include <limits.h>
54 49
 
55 50
       int main () {size_t stacksize = PTHREAD_STACK_MIN + 0x4000;
56 51
 }     	  
57
-    ],[use_pthread_stack_min=yes], [use_pthread_stack_min=no])
52
+    ])],[use_pthread_stack_min=yes], [use_pthread_stack_min=no])
58 53
 AC_MSG_RESULT($use_pthread_stack_min)
59 54
 
60 55
 if test "x$use_pthread_stack_min" = xno; then
... ...
@@ -62,17 +57,28 @@ if test "x$use_pthread_stack_min" = xno; then
62 57
 fi
63 58
 
64 59
 
60
+AC_ARG_ENABLE([threading],
61
+	AS_HELP_STRING([--disable-threading],[Disable threading]))
65 62
 
66
-if test "x${use_pthreads}" = "xno"; then
67
-  echo "------------------------------------------"
68
-  echo " Unable to find pthreads on this system.  "
69
-  echo " Building a single-threaded version.      "
70
-  echo "------------------------------------------"
71
-fi
72 63
 
73
-if test "x${use_pthreads}" = "xyes"; then
74
-  AC_DEFINE(USE_PTHREADS, 1)
75
-fi
64
+AS_IF([test "x$enable_threading" != "xno" ],[
65
+	    if test "x${use_pthreads}" = "xno"; then
66
+	       AC_MSG_NOTICE(------------------------------------------)
67
+	       AC_MSG_NOTICE( Unable to find pthreads on this system.  )
68
+	       AC_MSG_NOTICE( Building a single-threaded version.      )
69
+	       AC_MSG_NOTICE(------------------------------------------)
70
+	    fi
71
+
72
+
73
+	    if test "x${use_pthreads}" = "xyes"; then
74
+  	       AC_MSG_NOTICE(Enabling threading for preprocessCore)
75
+  	       AC_DEFINE(USE_PTHREADS, 1)
76
+	    fi
77
+	    ],
78
+	    [
79
+	    AC_MSG_NOTICE("Disabling threading for\n preprocessCore")
80
+	    ])
81
+
76 82
 
77 83
 
78 84