blob: e8917e993500d6c92bd727175c6fc02c9005eb64 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001--- a/configure.ac
2+++ b/configure.ac
3@@ -1090,15 +1090,18 @@ AC_LINK_IFELSE(
4
5 # Some platforms define sem_init(), but only support sem_open(). joyous.
6 AC_MSG_CHECKING(for working unnamed semaphores)
7-AC_RUN_IFELSE(
8- [AC_LANG_PROGRAM([#include <semaphore.h>],
9- [sem_t sem; return sem_init(&sem, 0, 0);])],
10+AC_LINK_IFELSE(
11+ [AC_LANG_PROGRAM(
12+ [#include <semaphore.h>],
13+ [#if defined(__UCLIBC__)
14+ i_dont_exist sem;
15+ #else
16+ sem_t sem;
17+ #endif
18+ return sem_init(&sem, 0, 0);])],
19 AC_MSG_RESULT(yes)
20 AC_DEFINE([HAS_WORKING_SEMAPHORE], 1, [Define to 1 if anonymous semaphores work.]),
21- AC_MSG_RESULT(no),
22- AC_MSG_RESULT(cross-compile)
23- AC_MSG_NOTICE([WARNING: result yes guessed because of cross compilation])
24- AC_DEFINE([HAS_WORKING_SEMAPHORE], 1, [Define to 1 if anonymous semaphores work.])
25+ AC_MSG_RESULT(no)
26 )
27
28 LIBS="$save_LIBS"