summaryrefslogtreecommitdiff
path: root/third-party/pjproject/patches/0001-ioqueue-Enable-epoll-in-aconfigure.ac.patch
blob: 36b6c651f12d4a3f87750e5eb7786138b9adec71 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
From b5c0bc905911f75e08987e6833075481fe16dab2 Mon Sep 17 00:00:00 2001
From: George Joseph <george.joseph@fairview5.com>
Date: Mon, 22 Feb 2016 13:05:59 -0700
Subject: [PATCH] ioqueue:  Enable epoll in aconfigure.ac

Although the --enable-epoll option was being accepted, the result
was always forced to select.  This patch updates aconfigure.ac
to properly set the value of ac_linux_poll if --enable-epoll is
specified.
---
 README.txt                           |  1 +
 aconfigure                           | 11 +++++++----
 aconfigure.ac                        |  7 +++++--
 pjlib/include/pj/compat/os_auto.h.in |  3 +++
 4 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/README.txt b/README.txt
index bc45da8..48415fd 100644
--- a/README.txt
+++ b/README.txt
@@ -463,6 +463,7 @@ Using Default Settings
    $ ./configure --help
    ...
    Optional Features:
+   --enable-epoll           Use epoll on Linux instead of select
    --disable-floating-point	Disable floating point where possible
    --disable-sound 		Exclude sound (i.e. use null sound)
    --disable-small-filter 	Exclude small filter in resampling
diff --git a/aconfigure.ac b/aconfigure.ac
index 2f71abb..3e88124 100644
--- a/aconfigure.ac
+++ b/aconfigure.ac
@@ -410,6 +410,7 @@ dnl ######################
 dnl # ioqueue selection
 dnl # 
 AC_SUBST(ac_os_objs)
+AC_SUBST(ac_linux_poll)
 AC_MSG_CHECKING([ioqueue backend])
 AC_ARG_ENABLE(epoll,
 	      AC_HELP_STRING([--enable-epoll],
@@ -417,10 +418,13 @@ AC_ARG_ENABLE(epoll,
 	      [
 		ac_os_objs=ioqueue_epoll.o
 		AC_MSG_RESULT([/dev/epoll])
+		AC_DEFINE(PJ_HAS_LINUX_EPOLL,1)
+		ac_linux_poll=epoll
 	      ],
 	      [
 		ac_os_objs=ioqueue_select.o
-	        AC_MSG_RESULT([select()]) 
+		AC_MSG_RESULT([select()])
+		ac_linux_poll=select
 	      ])
 
 AC_SUBST(ac_shared_libraries)
@@ -1879,7 +1883,6 @@ esac
 
 
 AC_SUBST(target)
-AC_SUBST(ac_linux_poll,select)
 AC_SUBST(ac_host,unix)
 AC_SUBST(ac_main_obj)
 case $target in
diff --git a/pjlib/include/pj/compat/os_auto.h.in b/pjlib/include/pj/compat/os_auto.h.in
index 77980d3..c8e73b2 100644
--- a/pjlib/include/pj/compat/os_auto.h.in
+++ b/pjlib/include/pj/compat/os_auto.h.in
@@ -128,6 +128,9 @@
  */
 #undef PJ_SELECT_NEEDS_NFDS
 
+/* Was Linux epoll support enabled */
+#undef PJ_HAS_LINUX_EPOLL
+
 /* Is errno a good way to retrieve OS errors?
  */
 #undef PJ_HAS_ERRNO_VAR
-- 
2.5.0