void-packages/srcpkgs/expect/patches/0002-cross-WNOHANG-requires-POSIX_SOURCE.patch
Đoàn Trần Công Danh 4459113b9d expect: cross compile
2020-04-07 14:48:09 +00:00

41 lines
844 B
Diff

From: Đoàn Trần Công Danh <congdanhqx@gmail.com>
---
configure.in | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git configure.in configure.in
index ad8db32..6570a07 100755
--- configure.in
+++ configure.in
@@ -469,21 +469,19 @@ memcpy(s1,s2,0);
# and if so that WNOHANG is not defined. The only place I've
# seen this is ISC.
AC_MSG_CHECKING([if WNOHANG requires _POSIX_SOURCE])
-AC_TRY_RUN([
+AC_COMPILE_IFELSE([
+AC_LANG_PROGRAM([[
#include <sys/wait.h>
-main() {
-#ifndef WNOHANG
- return 0;
-#else
- return 1;
+]],[[
+#ifdef WNOHANG
+ #error WNOHANG
#endif
-}],
+]])]
+,
AC_MSG_RESULT(yes)
AC_DEFINE(WNOHANG_REQUIRES_POSIX_SOURCE)
,
AC_MSG_RESULT(no)
-,
- AC_MSG_ERROR([Expect can't be cross compiled])
)
AC_MSG_CHECKING([if any value exists for WNOHANG])
--
2.26.0.292.g33ef6b2f38