summaryrefslogtreecommitdiff
blob: 2e2a325989bb72760f44e779e4d79d5cea310cb6 (plain)
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
71
72
--- a/configure.in	2010-12-21 17:50:08.000000000 +0100
+++ b/configure.in	2011-06-10 00:24:06.000000000 +0200
@@ -423,10 +423,8 @@ 
 )
 
 dnl Checking if interprocess posix semaphores works....
-POSIX_SEMAPHORES="0"
-AC_MSG_CHECKING(if posix 1003.1b interprocess semaphores works)
-AC_TRY_RUN(
-[
+AC_CACHE_CHECK([if posix 1003.1b interprocess semaphores works], ac_cv_10031b_ipc_sem,
+[AC_TRY_RUN([
 #include <semaphore.h>
 #include <sys/wait.h>
 
@@ -452,18 +450,24 @@ 
       exit(0);
 }
 ],
-AC_DEFINE(HAVE_POSIX_SEMAPHORES,1,[Define HAVE_POSIX_SEMAPHORES if posix 1003.1b semaphores works])
-POSIX_SEMAPHORES="1"
-AC_MSG_RESULT(yes),
-AC_MSG_RESULT(no)
+ac_cv_10031b_ipc_sem=yes,
+ac_cv_10031b_ipc_sem=no,
+[AC_MSG_ERROR([cross-compiling,
+	presetting ac_cv_10031b_ipc_sem=(yes|no) will help])]
 )
+])
+AS_IF(
+ [test $ac_cv_10031b_ipc_sem = yes],
+ [AC_DEFINE(HAVE_POSIX_SEMAPHORES,1,[Define HAVE_POSIX_SEMAPHORES if posix 1003.1b semaphores works])
+  POSIX_SEMAPHORES="1"
+ ],[
+  POSIX_SEMAPHORES="0"
+ ])
 AC_SUBST(POSIX_SEMAPHORES)
 
 dnl Checking for file locking
-POSIX_FILE_LOCK="0"
-AC_MSG_CHECKING(if fcntl file locking works)	
-AC_TRY_RUN(
-[
+AC_CACHE_CHECK([if fcntl file locking works], ac_cv_fcntl,
+[AC_TRY_RUN([
 #include <unistd.h>
 #include <fcntl.h>
 
@@ -487,11 +491,19 @@ 
      return 0;
 }
 ],
-AC_DEFINE(HAVE_POSIX_FILE_LOCK,1,[Define HAVE_POSIX_FILE_LOCK if posix fcntl file locking works])
-POSIX_FILE_LOCK="1"
-AC_MSG_RESULT(yes),
-AC_MSG_RESULT(no)
+ac_cv_fcntl=yes,
+ac_cv_fcntl=no,
+[AC_MSG_ERROR([cross-compiling,
+	presetting ac_cv_fcntl=(yes|no) will help])]
 )
+])
+AS_IF(
+ [test $ac_cv_fcntl = yes],
+ [AC_DEFINE(HAVE_POSIX_FILE_LOCK,1,[Define HAVE_POSIX_FILE_LOCK if posix fcntl file locking works])
+  POSIX_FILE_LOCK="1"
+ ],[
+  POSIX_FILE_LOCK="0"
+ ])
 AC_SUBST(POSIX_FILE_LOCK)
 
 #pthread_rwlock