[main] Make libevent_pthreads non-optional
This commit is contained in:
parent
e77cb3f94e
commit
7841e336b3
10
configure.ac
10
configure.ac
|
@ -148,7 +148,10 @@ OWNTONE_MODULES_CHECK([COMMON], [SQLITE3], [sqlite3 >= 3.5.0],
|
||||||
[AC_MSG_RESULT([[runtime will tell]])])
|
[AC_MSG_RESULT([[runtime will tell]])])
|
||||||
])
|
])
|
||||||
|
|
||||||
OWNTONE_MODULES_CHECK([OWNTONE], [LIBEVENT], [libevent >= 2.1.4], [event_base_new], [event2/event.h])
|
OWNTONE_MODULES_CHECK([OWNTONE], [LIBEVENT], [libevent >= 2.1.4],
|
||||||
|
[event_base_new], [event2/event.h])
|
||||||
|
OWNTONE_MODULES_CHECK([OWNTONE], [LIBEVENT_PTHREADS], [libevent_pthreads],
|
||||||
|
[evthread_use_pthreads], [event2/thread.h])
|
||||||
|
|
||||||
dnl Check for evhttp_connection_get_peer() signature
|
dnl Check for evhttp_connection_get_peer() signature
|
||||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||||
|
@ -263,11 +266,6 @@ OWNTONE_ARG_WITH_CHECK([OWNTONE_OPTS], [libwebsockets support], [libwebsockets],
|
||||||
[libwebsockets >= 2.0.2])
|
[libwebsockets >= 2.0.2])
|
||||||
AM_CONDITIONAL([COND_LIBWEBSOCKETS], [[test "x$with_libwebsockets" = "xyes"]])
|
AM_CONDITIONAL([COND_LIBWEBSOCKETS], [[test "x$with_libwebsockets" = "xyes"]])
|
||||||
|
|
||||||
dnl Build with libevent_pthreads
|
|
||||||
OWNTONE_ARG_WITH_CHECK([OWNTONE_OPTS], [libevent_pthreads support],
|
|
||||||
[libevent_pthreads], [LIBEVENT_PTHREADS], [libevent_pthreads],
|
|
||||||
[evthread_use_pthreads], [event2/thread.h])
|
|
||||||
|
|
||||||
dnl Build with Avahi (or Bonjour if not)
|
dnl Build with Avahi (or Bonjour if not)
|
||||||
OWNTONE_ARG_WITH_CHECK([OWNTONE_OPTS], [Avahi mDNS], [avahi], [AVAHI],
|
OWNTONE_ARG_WITH_CHECK([OWNTONE_OPTS], [Avahi mDNS], [avahi], [AVAHI],
|
||||||
[avahi-client >= 0.6.24], [avahi_client_new], [avahi-client/client.h])
|
[avahi-client >= 0.6.24], [avahi_client_new], [avahi-client/client.h])
|
||||||
|
|
|
@ -47,9 +47,7 @@
|
||||||
|
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <event2/event.h>
|
#include <event2/event.h>
|
||||||
#ifdef HAVE_LIBEVENT_PTHREADS
|
#include <event2/thread.h>
|
||||||
# include <event2/thread.h>
|
|
||||||
#endif
|
|
||||||
#include <libavutil/avutil.h>
|
#include <libavutil/avutil.h>
|
||||||
#include <libavutil/log.h>
|
#include <libavutil/log.h>
|
||||||
#include <libavformat/avformat.h>
|
#include <libavformat/avformat.h>
|
||||||
|
@ -730,9 +728,7 @@ main(int argc, char **argv)
|
||||||
/* Initialize event base (after forking) */
|
/* Initialize event base (after forking) */
|
||||||
CHECK_NULL(L_MAIN, evbase_main = event_base_new());
|
CHECK_NULL(L_MAIN, evbase_main = event_base_new());
|
||||||
|
|
||||||
#ifdef HAVE_LIBEVENT_PTHREADS
|
|
||||||
CHECK_ERR(L_MAIN, evthread_use_pthreads());
|
CHECK_ERR(L_MAIN, evthread_use_pthreads());
|
||||||
#endif
|
|
||||||
|
|
||||||
DPRINTF(E_LOG, L_MAIN, "mDNS init\n");
|
DPRINTF(E_LOG, L_MAIN, "mDNS init\n");
|
||||||
ret = mdns_init();
|
ret = mdns_init();
|
||||||
|
|
Loading…
Reference in New Issue