[configure] Change so we enable/disable websockets based on libwebsockets >= 2.0.2 presence

This commit is contained in:
ejurgensen 2017-09-16 00:05:50 +02:00
parent 546362980b
commit f8c442ba38
3 changed files with 10 additions and 14 deletions

View File

@ -262,6 +262,7 @@ FORK_ARG_WITH_CHECK([FORKED_OPTS], [libcurl support], [libcurl], [LIBCURL],
dnl Build with libwebsockets
FORK_ARG_WITH_CHECK([FORKED_OPTS], [libwebsockets support], [libwebsockets], [LIBWEBSOCKETS],
[libwebsockets >= 2.0.2])
AM_CONDITIONAL([COND_LIBWEBSOCKETS], [[test "x$with_libwebsockets" = "xyes"]])
dnl Build with libsodium
FORK_ARG_WITH_CHECK([FORKED_OPTS], [libsodium support], [libsodium], [LIBSODIUM],
@ -319,7 +320,8 @@ AM_CONDITIONAL([COND_SPOTIFY], [[test "x$enable_spotify" = "xyes"]])
dnl LastFM support with libcurl
FORK_ARG_ENABLE([LastFM support], [lastfm], [LASTFM],
[AS_IF([[test "x$with_libcurl" = "xno"]],
[AC_MSG_ERROR([[LastFM support requires libcurl]])])])
[AC_MSG_ERROR([[LastFM support requires libcurl]])])
])
AM_CONDITIONAL([COND_LASTFM], [[test "x$enable_lastfm" = "xyes"]])
dnl ChromeCast support with libprotobuf-c
@ -344,12 +346,6 @@ FORK_ARG_ENABLE([Chromecast support], [chromecast], [CHROMECAST],
AM_CONDITIONAL([COND_CHROMECAST], [[test "x$enable_chromecast" = "xyes"]])
AM_CONDITIONAL([COND_PROTOBUF_OLD], [[test "x$protobuf_old" = "xyes"]])
dnl Websocket support with libwebsockets
FORK_ARG_DISABLE([Websocket support], [websocket], [WEBSOCKET],
[AS_IF([[test "x$with_libwebsockets" = "xno"]],
[AC_MSG_ERROR([[Websocket support requires libwebsockets]])])])
AM_CONDITIONAL([COND_WEBSOCKET], [[test "x$enable_websocket" = "xyes"]])
dnl iTunes playlists with libplist
FORK_ARG_DISABLE([iTunes Music Library XML support], [itunes], [ITUNES],
[AS_IF([[test "x$with_libplist" = "xno"]],

View File

@ -43,8 +43,8 @@ else
MDNS_SRC=mdns_dnssd.c
endif
if COND_WEBSOCKET
WEBSOCKET_SRC=websocket.c websocket.h
if COND_LIBWEBSOCKETS
LIBWEBSOCKETS_SRC=websocket.c websocket.h
endif
if COND_FFMPEG_LEGACY
@ -137,7 +137,7 @@ forked_daapd_SOURCES = main.c \
listener.c listener.h \
commands.c commands.h \
mxml-compat.h \
$(WEBSOCKET_SRC) \
$(LIBWEBSOCKETS_SRC) \
$(GPERF_SRC) \
$(ANTLR_SRC)

View File

@ -68,7 +68,7 @@
#ifdef HAVE_SPOTIFY_H
# include "spotify.h"
#endif
#ifdef WEBSOCKET
#ifdef HAVE_LIBWEBSOCKETS
# include "websocket.h"
#endif
@ -1526,7 +1526,7 @@ httpd_init(void)
goto jsonapi_fail;
}
#ifdef WEBSOCKET
#ifdef HAVE_LIBWEBSOCKETS
ret = websocket_init();
if (ret < 0)
{
@ -1647,7 +1647,7 @@ httpd_init(void)
#endif
pipe_fail:
streaming_deinit();
#ifdef WEBSOCKET
#ifdef HAVE_LIBWEBSOCKETS
websocket_deinit();
#endif
websocket_fail:
@ -1699,7 +1699,7 @@ httpd_deinit(void)
}
streaming_deinit();
#ifdef WEBSOCKET
#ifdef HAVE_LIBWEBSOCKETS
websocket_deinit();
#endif
jsonapi_deinit();