asterisk/third-party/pjproject/patches/0001-ioqueue-Enable-epoll-i...

81 lines
2.3 KiB
Diff

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