summaryrefslogtreecommitdiff
path: root/net/asterisk-16.x/patches/001-disable-semaphores-on-uclibc-otherwise-allow.patch
blob: 72a9f61f561abc5735b40787627ce3ba4b2951e7 (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
--- a/configure.ac
+++ b/configure.ac
@@ -1088,15 +1088,18 @@ AC_LINK_IFELSE(
 
 # Some platforms define sem_init(), but only support sem_open(). joyous.
 AC_MSG_CHECKING(for working unnamed semaphores)
-AC_RUN_IFELSE(
-	[AC_LANG_PROGRAM([#include <semaphore.h>],
-		[sem_t sem; return sem_init(&sem, 0, 0);])],
+AC_LINK_IFELSE(
+	[AC_LANG_PROGRAM(
+	  [#include <semaphore.h>],
+	  [#if defined(__UCLIBC__)
+	   i_dont_exist sem;
+	   #else
+	   sem_t sem;
+	   #endif
+	   return sem_init(&sem, 0, 0);])],
 	AC_MSG_RESULT(yes)
 	AC_DEFINE([HAS_WORKING_SEMAPHORE], 1, [Define to 1 if anonymous semaphores work.]),
-	AC_MSG_RESULT(no),
-	AC_MSG_RESULT(cross-compile)
-	AC_MSG_NOTICE([WARNING: result yes guessed because of cross compilation])
-	AC_DEFINE([HAS_WORKING_SEMAPHORE], 1, [Define to 1 if anonymous semaphores work.])
+	AC_MSG_RESULT(no)
 )
 
 LIBS="$save_LIBS"