Skip to content

Commit

Permalink
[main] Make libevent_pthreads non-optional
Browse files Browse the repository at this point in the history
  • Loading branch information
ejurgensen committed Mar 7, 2023
1 parent e77cb3f commit 7841e33
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
10 changes: 4 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ OWNTONE_MODULES_CHECK([COMMON], [SQLITE3], [sqlite3 >= 3.5.0],
[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
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
Expand Down Expand Up @@ -263,11 +266,6 @@ OWNTONE_ARG_WITH_CHECK([OWNTONE_OPTS], [libwebsockets support], [libwebsockets],
[libwebsockets >= 2.0.2])
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)
OWNTONE_ARG_WITH_CHECK([OWNTONE_OPTS], [Avahi mDNS], [avahi], [AVAHI],
[avahi-client >= 0.6.24], [avahi_client_new], [avahi-client/client.h])
Expand Down
6 changes: 1 addition & 5 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@

#include <getopt.h>
#include <event2/event.h>
#ifdef HAVE_LIBEVENT_PTHREADS
# include <event2/thread.h>
#endif
#include <event2/thread.h>
#include <libavutil/avutil.h>
#include <libavutil/log.h>
#include <libavformat/avformat.h>
Expand Down Expand Up @@ -730,9 +728,7 @@ main(int argc, char **argv)
/* Initialize event base (after forking) */
CHECK_NULL(L_MAIN, evbase_main = event_base_new());

#ifdef HAVE_LIBEVENT_PTHREADS
CHECK_ERR(L_MAIN, evthread_use_pthreads());
#endif

DPRINTF(E_LOG, L_MAIN, "mDNS init\n");
ret = mdns_init();
Expand Down

0 comments on commit 7841e33

Please sign in to comment.