mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-09 13:39:47 -05:00
[config] Many updates to configuration and feature checks
- Added custom checks for libraries and pkgconfig modules that test library presence with additional checks for use of headers and functions with given options. Also support correct additional feature library checks using provided flags. - Added custom enable/disable feature macros to simplify their use. - Use custom CFLAGS and LIBS variables for Makefiles to simplify maintenance. - Update many feature checks from platform to function. - Streamline many function checks. - Correctly check gnutls, gcrypt and gpg-error libraries. - Fix chromecast and spotify config and compile on FreeBSD - Added inotify, signalfd and kqueue, and byte swap checks. - Many clarifications of error messages. - Correct json-c checks to properly use supplied CFLAGS. - Correct many quoting inconsistencies - Use __DATE__ in place of BUILDDATE - Use full path for gperf and antlr3 - Remove unnecessary CFLAGS - Added tests for pthread_setname_np parameters - Added tests for clock_gettime and timer_settime - Added tests for time.h - Test if pthread, dl and rt libs are required/available. - Updated checks for libunistring
This commit is contained in:
@@ -30,18 +30,19 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <net/if.h>
|
||||
#include <netinet/in.h>
|
||||
#include <ifaddrs.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <endian.h>
|
||||
#ifdef HAVE_ENDIAN_H
|
||||
# include <endian.h>
|
||||
#elif defined(HAVE_SYS_ENDIAN_H)
|
||||
# include <sys/endian.h>
|
||||
#endif
|
||||
#include <gnutls/gnutls.h>
|
||||
#include <event2/event.h>
|
||||
|
||||
#ifdef HAVE_JSON_C_OLD
|
||||
# include <json/json.h>
|
||||
#else
|
||||
# include <json-c/json.h>
|
||||
#endif
|
||||
#include <json.h>
|
||||
|
||||
#include "conffile.h"
|
||||
#include "mdns.h"
|
||||
@@ -368,7 +369,11 @@ tcp_connect(const char *address, unsigned int port, int family)
|
||||
|
||||
// TODO Open non-block right away so we don't block the player while connecting
|
||||
// and during TLS handshake (we would probably need to introduce a deferredev)
|
||||
#ifdef SOCK_CLOEXEC
|
||||
fd = socket(family, SOCK_STREAM | SOCK_CLOEXEC, 0);
|
||||
#else
|
||||
fd = socket(family, SOCK_STREAM, 0);
|
||||
#endif
|
||||
if (fd < 0)
|
||||
{
|
||||
DPRINTF(E_LOG, L_CAST, "Could not create socket: %s\n", strerror(errno));
|
||||
|
||||
@@ -903,7 +903,7 @@ pulse_init(void)
|
||||
if (!(pulse.cmdbase = commands_base_new(evbase_player, NULL)))
|
||||
goto fail;
|
||||
|
||||
#ifdef HAVE_PULSE_MAINLOOP_SET_NAME
|
||||
#ifdef HAVE_PA_THREADED_MAINLOOP_SET_NAME
|
||||
pa_threaded_mainloop_set_name(pulse.mainloop, "pulseaudio");
|
||||
#endif
|
||||
|
||||
|
||||
@@ -47,10 +47,9 @@
|
||||
#include <fcntl.h>
|
||||
#include <time.h>
|
||||
|
||||
#if defined(__linux__) || defined(__GLIBC__)
|
||||
#ifdef HAVE_ENDIAN_H
|
||||
# include <endian.h>
|
||||
# include <byteswap.h>
|
||||
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
#elif defined(HAVE_SYS_ENDIAN_H)
|
||||
# include <sys/endian.h>
|
||||
#endif
|
||||
|
||||
@@ -2688,7 +2687,7 @@ raop_v2_timing_start_one(struct raop_service *svc, int family)
|
||||
int len;
|
||||
int ret;
|
||||
|
||||
#ifdef __linux__
|
||||
#ifdef SOCK_CLOEXEC
|
||||
svc->fd = socket(family, SOCK_DGRAM | SOCK_CLOEXEC, 0);
|
||||
#else
|
||||
svc->fd = socket(family, SOCK_DGRAM, 0);
|
||||
@@ -3020,7 +3019,7 @@ raop_v2_control_start_one(struct raop_service *svc, int family)
|
||||
int len;
|
||||
int ret;
|
||||
|
||||
#ifdef __linux__
|
||||
#ifdef SOCK_CLOEXEC
|
||||
svc->fd = socket(family, SOCK_DGRAM | SOCK_CLOEXEC, 0);
|
||||
#else
|
||||
svc->fd = socket(family, SOCK_DGRAM, 0);
|
||||
@@ -3418,7 +3417,7 @@ raop_v2_stream_open(struct raop_session *rs)
|
||||
int len;
|
||||
int ret;
|
||||
|
||||
#ifdef __linux__
|
||||
#ifdef SOCK_CLOEXEC
|
||||
rs->server_fd = socket(rs->sa.ss.ss_family, SOCK_DGRAM | SOCK_CLOEXEC, 0);
|
||||
#else
|
||||
rs->server_fd = socket(rs->sa.ss.ss_family, SOCK_DGRAM, 0);
|
||||
|
||||
Reference in New Issue
Block a user