blob: 7d09f4382f63e50a8293919425161821b4b3b42f [file] [log] [blame]
Brad Bishop868407c2019-11-04 13:24:47 -05001Using AC_RUN_IFELSE prevent people from configuring package
2 for cross-compiling. Don't run code while configuring package.
Patrick Williamsb48b7b42016-08-17 15:04:38 -05003
4Upstream-Status: Pending
5Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
6
Brad Bishop868407c2019-11-04 13:24:47 -05007Update for 0.9.8.
8Signed-off-by: Zheng Ruoqin <zhengrq.fnst@cn.fujitsu.com>
9---
10 scripts/checks.m4 | 34 ----------------------------------
11 scripts/common.m4 | 28 ----------------------------
12 2 files changed, 62 deletions(-)
Patrick Williamsb48b7b42016-08-17 15:04:38 -050013
Brad Bishop868407c2019-11-04 13:24:47 -050014diff --git a/scripts/checks.m4 b/scripts/checks.m4
15index 83be846..1af80f5 100644
16--- a/scripts/checks.m4
17+++ b/scripts/checks.m4
18@@ -95,40 +95,6 @@ AC_DEFUN([TORRENT_CHECK_KQUEUE], [
19
Patrick Williamsb48b7b42016-08-17 15:04:38 -050020 AC_DEFUN([TORRENT_CHECK_KQUEUE_SOCKET_ONLY], [
21 AC_MSG_CHECKING(whether kqueue supports pipes and ptys)
22-
Brad Bishop868407c2019-11-04 13:24:47 -050023- AC_LINK_IFELSE([AC_LANG_SOURCE([
Patrick Williamsb48b7b42016-08-17 15:04:38 -050024- #include <fcntl.h>
25- #include <stdlib.h>
26- #include <unistd.h>
27- #include <sys/event.h>
28- #include <sys/time.h>
29- int main() {
30- struct kevent ev@<:@2@:>@, ev_out@<:@2@:>@;
31- struct timespec ts = { 0, 0 };
32- int pfd@<:@2@:>@, pty@<:@2@:>@, kfd, n;
33- char buffer@<:@9001@:>@;
34- if (pipe(pfd) == -1) return 1;
35- if (fcntl(pfd@<:@1@:>@, F_SETFL, O_NONBLOCK) == -1) return 2;
36- while ((n = write(pfd@<:@1@:>@, buffer, sizeof(buffer))) == sizeof(buffer));
37- if ((pty@<:@0@:>@=posix_openpt(O_RDWR | O_NOCTTY)) == -1) return 3;
38- if ((pty@<:@1@:>@=grantpt(pty@<:@0@:>@)) == -1) return 4;
39- EV_SET(ev+0, pfd@<:@1@:>@, EVFILT_WRITE, EV_ADD | EV_ENABLE, 0, 0, NULL);
40- EV_SET(ev+1, pty@<:@1@:>@, EVFILT_READ, EV_ADD | EV_ENABLE, 0, 0, NULL);
41- if ((kfd = kqueue()) == -1) return 5;
42- if ((n = kevent(kfd, ev, 2, NULL, 0, NULL)) == -1) return 6;
43- if (ev_out@<:@0@:>@.flags & EV_ERROR) return 7;
44- if (ev_out@<:@1@:>@.flags & EV_ERROR) return 8;
45- read(pfd@<:@0@:>@, buffer, sizeof(buffer));
46- if ((n = kevent(kfd, NULL, 0, ev_out, 2, &ts)) < 1) return 9;
47- return 0;
48- }
49- ])],
50- [
51- AC_MSG_RESULT(yes)
52- ], [
53- AC_DEFINE(KQUEUE_SOCKET_ONLY, 1, kqueue only supports sockets.)
54- AC_MSG_RESULT(no)
55- ])
56 ])
Brad Bishop868407c2019-11-04 13:24:47 -050057
Patrick Williamsb48b7b42016-08-17 15:04:38 -050058 AC_DEFUN([TORRENT_WITH_KQUEUE], [
Brad Bishop868407c2019-11-04 13:24:47 -050059diff --git a/scripts/common.m4 b/scripts/common.m4
60index aaf005e..42fb016 100644
61--- a/scripts/common.m4
62+++ b/scripts/common.m4
63@@ -152,38 +152,10 @@ dnl Need to fix this so that it uses the stuff defined by the system.
64
Patrick Williamsb48b7b42016-08-17 15:04:38 -050065 AC_DEFUN([TORRENT_CHECK_EXECINFO], [
66 AC_MSG_CHECKING(for execinfo.h)
67-
Brad Bishop868407c2019-11-04 13:24:47 -050068- AC_COMPILE_IFELSE([AC_LANG_SOURCE([
Patrick Williamsb48b7b42016-08-17 15:04:38 -050069- #include <execinfo.h>
70- int main() { backtrace((void**)0, 0); backtrace_symbols((char**)0, 0); return 0;}
71- ])],
72- [
73- AC_MSG_RESULT(yes)
74- AC_DEFINE(USE_EXECINFO, 1, Use execinfo.h)
75- ], [
76- AC_MSG_RESULT(no)
77- ])
78 ])
Brad Bishop868407c2019-11-04 13:24:47 -050079
Patrick Williamsb48b7b42016-08-17 15:04:38 -050080 AC_DEFUN([TORRENT_CHECK_ALIGNED], [
81 AC_MSG_CHECKING(the byte alignment)
82-
Brad Bishop868407c2019-11-04 13:24:47 -050083- AC_LINK_IFELSE([AC_LANG_SOURCE([
Patrick Williamsb48b7b42016-08-17 15:04:38 -050084- #include <inttypes.h>
85- int main() {
86- char buf@<:@8@:>@ = { 0, 0, 0, 0, 1, 0, 0, 0 };
87- int i;
88- for (i = 1; i < 4; ++i)
89- if (*(uint32_t*)(buf + i) == 0) return -1;
90- return 0;
91- }
92- ])],
93- [
94- AC_MSG_RESULT(none needed)
95- ], [
96- AC_DEFINE(USE_ALIGNED, 1, Require byte alignment)
97- AC_MSG_RESULT(required)
98- ])
99 ])
Brad Bishop868407c2019-11-04 13:24:47 -0500100
101
102--
1032.7.4
Patrick Williamsb48b7b42016-08-17 15:04:38 -0500104