telephony/net/asterisk-16.x/patches/001-disable-semaphores-on-u...

29 lines
872 B
Diff

--- a/configure.ac
+++ b/configure.ac
@@ -1033,15 +1033,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"