build-system: Allow building with static pjproject
[asterisk/asterisk.git] / third-party / pjproject / patches / 0001-ioqueue-Enable-epoll-in-aconfigure.ac.patch
1 From b5c0bc905911f75e08987e6833075481fe16dab2 Mon Sep 17 00:00:00 2001
2 From: George Joseph <george.joseph@fairview5.com>
3 Date: Mon, 22 Feb 2016 13:05:59 -0700
4 Subject: [PATCH] ioqueue:  Enable epoll in aconfigure.ac
5
6 Although the --enable-epoll option was being accepted, the result
7 was always forced to select.  This patch updates aconfigure.ac
8 to properly set the value of ac_linux_poll if --enable-epoll is
9 specified.
10 ---
11  README.txt                           |  1 +
12  aconfigure                           | 11 +++++++----
13  aconfigure.ac                        |  7 +++++--
14  pjlib/include/pj/compat/os_auto.h.in |  3 +++
15  4 files changed, 16 insertions(+), 6 deletions(-)
16
17 diff --git a/README.txt b/README.txt
18 index bc45da8..48415fd 100644
19 --- a/README.txt
20 +++ b/README.txt
21 @@ -463,6 +463,7 @@ Using Default Settings
22     $ ./configure --help
23     ...
24     Optional Features:
25 +   --enable-epoll           Use epoll on Linux instead of select
26     --disable-floating-point    Disable floating point where possible
27     --disable-sound             Exclude sound (i.e. use null sound)
28     --disable-small-filter      Exclude small filter in resampling
29 diff --git a/aconfigure.ac b/aconfigure.ac
30 index 2f71abb..3e88124 100644
31 --- a/aconfigure.ac
32 +++ b/aconfigure.ac
33 @@ -410,6 +410,7 @@ dnl ######################
34  dnl # ioqueue selection
35  dnl # 
36  AC_SUBST(ac_os_objs)
37 +AC_SUBST(ac_linux_poll)
38  AC_MSG_CHECKING([ioqueue backend])
39  AC_ARG_ENABLE(epoll,
40               AC_HELP_STRING([--enable-epoll],
41 @@ -417,10 +418,13 @@ AC_ARG_ENABLE(epoll,
42               [
43                 ac_os_objs=ioqueue_epoll.o
44                 AC_MSG_RESULT([/dev/epoll])
45 +               AC_DEFINE(PJ_HAS_LINUX_EPOLL,1)
46 +               ac_linux_poll=epoll
47               ],
48               [
49                 ac_os_objs=ioqueue_select.o
50 -               AC_MSG_RESULT([select()]) 
51 +               AC_MSG_RESULT([select()])
52 +               ac_linux_poll=select
53               ])
54  
55  AC_SUBST(ac_shared_libraries)
56 @@ -1879,7 +1883,6 @@ esac
57  
58  
59  AC_SUBST(target)
60 -AC_SUBST(ac_linux_poll,select)
61  AC_SUBST(ac_host,unix)
62  AC_SUBST(ac_main_obj)
63  case $target in
64 diff --git a/pjlib/include/pj/compat/os_auto.h.in b/pjlib/include/pj/compat/os_auto.h.in
65 index 77980d3..c8e73b2 100644
66 --- a/pjlib/include/pj/compat/os_auto.h.in
67 +++ b/pjlib/include/pj/compat/os_auto.h.in
68 @@ -128,6 +128,9 @@
69   */
70  #undef PJ_SELECT_NEEDS_NFDS
71  
72 +/* Was Linux epoll support enabled */
73 +#undef PJ_HAS_LINUX_EPOLL
74 +
75  /* Is errno a good way to retrieve OS errors?
76   */
77  #undef PJ_HAS_ERRNO_VAR
78 -- 
79 2.5.0
80