From 18776f529d65ba3ab1abd05c2a0620fb3b39b6b0 Mon Sep 17 00:00:00 2001 From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Wed, 23 Dec 2020 17:40:18 +0000 Subject: [PATCH 1/9] Update RELEASENOTES-DEVELOPMENT.md --- RELEASENOTES-DEVELOPMENT.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RELEASENOTES-DEVELOPMENT.md b/RELEASENOTES-DEVELOPMENT.md index 064cc2c0..63422e8e 100644 --- a/RELEASENOTES-DEVELOPMENT.md +++ b/RELEASENOTES-DEVELOPMENT.md @@ -1,5 +1,7 @@ Version 3.3.8d3 ==== +**Enhancements** +* Documentation for the MQTT interface. Many thanks to [minix1234](https://github.com/minix1234)! **Bug Fixes** * Fix a bug that caused Shairport Sync to hang, but not actually crash, if an on-play or any on-*** script failed. From 72176a95a4ef8d043a06800243e09f3db103aed4 Mon Sep 17 00:00:00 2001 From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Sat, 26 Dec 2020 14:35:18 +0000 Subject: [PATCH 2/9] Fix up AC_ARG_WITH logic to work with --without-* properly. Also do some tidying up. Fixed --with-apple-alac, --with-pipe, --with-stdout, --with-dummy. More to do. --- configure.ac | 55 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 23 deletions(-) diff --git a/configure.ac b/configure.ac index adedf3fe..cde2ca71 100644 --- a/configure.ac +++ b/configure.ac @@ -41,8 +41,7 @@ AM_CONDITIONAL([BUILD_FOR_OPENBSD], [test "x${with_os}" = xopenbsd ]) ##### Some build systems are not fully using pkg-config, so we can use the flag ${with_pkg_config} on a case-by-case basis ##### to control how to deal with them -AC_ARG_WITH([pkg_config], -[ --with-pkg-config = use pkg-config to find libraries], ,[with_pkg_config=yes]) +AC_ARG_WITH([pkg_config],[AS_HELP_STRING([--with-pkg-config],[use pkg-config to find libraries])],[],[with_pkg_config=yes]) ##### The following check for the pthreads library doesn't put the compiler into the correct pthread mode ##### so we add the -pthread compilation flag in AMFLAGS in the Makefile.am as well. @@ -50,24 +49,35 @@ AC_ARG_WITH([pkg_config], AC_CHECK_LIB([pthread],[pthread_create], , AC_MSG_ERROR(pthread library needed)) AC_CHECK_LIB([m],[exp], , AC_MSG_ERROR(maths library needed)) -AC_MSG_RESULT(>>Including libpopt) if test "x${with_pkg_config}" = xyes ; then PKG_CHECK_MODULES( - [POPT], [popt], - [CFLAGS="${POPT_CFLAGS} ${CFLAGS}" - LIBS="${POPT_LIBS} ${LIBS}"]) + [popt], [popt], + [CFLAGS="${popt_CFLAGS} ${CFLAGS}" + LIBS="${popt_LIBS} ${LIBS}"], AC_MSG_ERROR(libpopt needed)) else AC_CHECK_LIB([popt],[poptGetContext], , AC_MSG_ERROR(libpopt needed)) fi -AC_ARG_WITH([dummy],[ --with-dummy = include the dummy audio back end ],[AC_MSG_RESULT(>>Including the dummy audio back end) AC_DEFINE([CONFIG_DUMMY], 1, [Needed by the compiler.]) ], ) +AC_ARG_WITH([dummy],[AS_HELP_STRING([--with-dummy],[include the dummy audio back end])],[],[]) +if test "x$with_dummy" = "xyes" ; then + AC_MSG_RESULT(>>Including the dummy audio back end) + AC_DEFINE([CONFIG_DUMMY], 1, [Needed by the compiler.]) +fi AM_CONDITIONAL([USE_DUMMY], [test "x$with_dummy" = "xyes" ]) -AC_ARG_WITH([stdout],[ --with-stdout = include the stdout audio back end ],[ AC_MSG_RESULT(>>Including the stdout audio back end) AC_DEFINE([CONFIG_STDOUT], 1, [Needed by the compiler.]) ], ) -AM_CONDITIONAL([USE_STDOUT], [test "x$with_stdout" = "xyes" ]) +AC_ARG_WITH([stdout],[AS_HELP_STRING([--with-stdout],[include the stdout audio back end])],[],[]) +if test "x$with_stdout" = "xyes" ; then + AC_MSG_RESULT(>>Including the stdout audio back end) + AC_DEFINE([CONFIG_STDOUT], 1, [Needed by the compiler.]) +fi +AM_CONDITIONAL([USE_STDOUT], [test "x$with_stdout" = "xyes"]) -AC_ARG_WITH([pipe],[ --with-pipe = include the pipe audio back end ],[ AC_MSG_RESULT(>>Including the pipe audio back end) AC_DEFINE([CONFIG_PIPE], 1, [Needed by the compiler.]) ], ) -AM_CONDITIONAL([USE_PIPE], [test "x$with_pipe" = "xyes" ]) +AC_ARG_WITH([pipe],[AS_HELP_STRING([--with-pipe],[include the pipe audio back end])],[],[]) +if test "x$with_pipe" = "xyes" ; then + AC_MSG_RESULT(>>Including the pipe audio back end) + AC_DEFINE([CONFIG_PIPE], 1, [Needed by the compiler.]) +fi +AM_CONDITIONAL([USE_PIPE], [test "x$with_dummy" = "xyes" ]) # Check to see if we should include the System V initscript @@ -106,18 +116,17 @@ AC_ARG_WITH([configfiles], AM_CONDITIONAL([INSTALL_CONFIG_FILES], [test "x$with_configfiles" = "xyes"]) # Look for Apple ALAC flag -AC_ARG_WITH(apple-alac, [ --with-apple-alac = include support for the Apple ALAC decoder], - [AC_MSG_RESULT(>>Including the Apple ALAC Decoder) +AC_ARG_WITH(apple-alac,[AS_HELP_STRING([--with-apple-alac],[include support for the Apple ALAC decoder])], []) +if test "x${with_apple_alac}" = "xyes" ; then +AC_MSG_RESULT(including the Apple ALAC Decoder) AC_DEFINE([CONFIG_APPLE_ALAC], 1, [Include support for using the Apple ALAC Decoder]) - REQUESTED_APPLE_ALAC=1 if test "x${with_pkg_config}" = xyes ; then - PKG_CHECK_MODULES( - [ALAC], [alac], - [LIBS="${ALAC_LIBS} ${LIBS}"]) + PKG_CHECK_MODULES([ALAC], [alac], [LIBS="${ALAC_LIBS} ${LIBS}"], AC_MSG_ERROR(Apple ALAC Decoder support requires the alac library.)) else - AC_CHECK_LIB([alac], [BitBufferInit], , AC_MSG_ERROR(Apple ALAC Decoder support requires the alac library!)) - fi ]) -AM_CONDITIONAL([USE_APPLE_ALAC], [test "x$REQUESTED_APPLE_ALAC" = "x1"]) + AC_CHECK_LIB([alac], [BitBufferInit], , AC_MSG_ERROR(Apple ALAC Decoder support requires the alac library.)) + fi +fi +AM_CONDITIONAL([USE_APPLE_ALAC], [test "x${with_apple_alac}" = "xyes"]) # Look for piddir flag AC_ARG_WITH(piddir, [ --with-piddir= Specify a pathname to a directory in which to write the PID file.], [ @@ -156,7 +165,7 @@ AC_ARG_WITH(ssl, [ choose --with-ssl=openssl, --with-ssl=mbedtls or --with-ssl=p AC_MSG_ERROR(choose "openssl", "mbedtls" or "polarssl" encryption) fi if test "x${with_ssl}" = xopenssl ; then - AC_DEFINE([CONFIG_OPENSSL], 1, [Use the OpenSSL libraries for encryption and encoding and decoding]) + AC_DEFINE([CONFIG_OPENSSL], 1, [Use the OpenSSL libraries for encryption and encoding and decoding]) if test "x${with_pkg_config}" = xyes ; then PKG_CHECK_MODULES( [SSL], [libssl,libcrypto], @@ -166,7 +175,7 @@ AC_ARG_WITH(ssl, [ choose --with-ssl=openssl, --with-ssl=mbedtls or --with-ssl=p AC_CHECK_LIB([ssl], [main], , AC_MSG_ERROR(libssl selected but the library cannot be found!)) fi elif test "x${with_ssl}" = xmbedtls ; then - AC_DEFINE([CONFIG_MBEDTLS], 1, [Use the mbed TLS libraries for encryption and encoding and decoding]) + AC_DEFINE([CONFIG_MBEDTLS], 1, [Use the mbed TLS libraries for encryption and encoding and decoding]) AC_CHECK_LIB([mbedtls],[mbedtls_ssl_init],, [AC_MSG_ERROR([mbed tls support requires the mbedtls library -- libmbedtls-dev suggested],1)]) AC_CHECK_LIB([mbedcrypto], [mbedtls_entropy_func],, @@ -174,7 +183,7 @@ AC_ARG_WITH(ssl, [ choose --with-ssl=openssl, --with-ssl=mbedtls or --with-ssl=p AC_CHECK_LIB([mbedx509], [mbedtls_pk_init],, [AC_MSG_ERROR([mbed tls support requires the mbedx509 library -- libmbedx509-0 suggested],1)]) elif test "x${with_ssl}" = xpolarssl ; then - AC_DEFINE([CONFIG_POLARSSL], 1, [Use the PolarSSL libraries for encryption and encoding and decoding]) + AC_DEFINE([CONFIG_POLARSSL], 1, [Use the PolarSSL libraries for encryption and encoding and decoding]) AC_CHECK_LIB([polarssl],[ssl_init], , AC_MSG_ERROR(PolarSSL is selected but the library cannot be found and is deprecated. Consider selecting mbed TLS instead using --with-ssl=mbedtls.)) else AC_MSG_ERROR(unknown option "${with_ssl}"." Please choose with "openssl", "mbedtls" or "polarssl") From 2538e46abe733360a0bb39ec66c3968f138f647e Mon Sep 17 00:00:00 2001 From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Sat, 26 Dec 2020 15:45:13 +0000 Subject: [PATCH 3/9] Further changes, use AS_HELP_STRING macros, remove most include messages, make many tokens lowercase. --- configure.ac | 114 ++++++++++++++++++++------------------------------- 1 file changed, 44 insertions(+), 70 deletions(-) diff --git a/configure.ac b/configure.ac index cde2ca71..46b3e4e3 100644 --- a/configure.ac +++ b/configure.ac @@ -58,67 +58,61 @@ else AC_CHECK_LIB([popt],[poptGetContext], , AC_MSG_ERROR(libpopt needed)) fi -AC_ARG_WITH([dummy],[AS_HELP_STRING([--with-dummy],[include the dummy audio back end])],[],[]) +AC_ARG_WITH([dummy],[AS_HELP_STRING([--with-dummy],[include the dummy audio back end])]) if test "x$with_dummy" = "xyes" ; then - AC_MSG_RESULT(>>Including the dummy audio back end) + AC_MSG_RESULT(include the dummy audio back end) AC_DEFINE([CONFIG_DUMMY], 1, [Needed by the compiler.]) fi AM_CONDITIONAL([USE_DUMMY], [test "x$with_dummy" = "xyes" ]) -AC_ARG_WITH([stdout],[AS_HELP_STRING([--with-stdout],[include the stdout audio back end])],[],[]) +AC_ARG_WITH([stdout],[AS_HELP_STRING([--with-stdout],[include the stdout audio back end])]) if test "x$with_stdout" = "xyes" ; then - AC_MSG_RESULT(>>Including the stdout audio back end) + AC_MSG_RESULT(include the stdout audio back end) AC_DEFINE([CONFIG_STDOUT], 1, [Needed by the compiler.]) fi AM_CONDITIONAL([USE_STDOUT], [test "x$with_stdout" = "xyes"]) -AC_ARG_WITH([pipe],[AS_HELP_STRING([--with-pipe],[include the pipe audio back end])],[],[]) +AC_ARG_WITH([pipe],[AS_HELP_STRING([--with-pipe],[include the pipe audio back end])]) if test "x$with_pipe" = "xyes" ; then - AC_MSG_RESULT(>>Including the pipe audio back end) + AC_MSG_RESULT(include the pipe audio back end) AC_DEFINE([CONFIG_PIPE], 1, [Needed by the compiler.]) fi AM_CONDITIONAL([USE_PIPE], [test "x$with_dummy" = "xyes" ]) # Check to see if we should include the System V initscript -AC_ARG_WITH([systemv], -[ --with-systemv = install a System V startup script during a make install], , ) +AC_ARG_WITH([systemv],[AS_HELP_STRING([--with-systemv],[install a System V startup script during a make install])]) AM_CONDITIONAL([INSTALL_SYSTEMV], [test "x$with_systemv" = "xyes"]) # Check to see if we should include the systemd stuff to define it as a service -AC_ARG_WITH([systemd], -[ --with-systemd = install a systemd startup script during a make install], , ) +AC_ARG_WITH([systemd],[AS_HELP_STRING([--with-systemd],[install a systemd startup script during a make install])]) AM_CONDITIONAL([INSTALL_SYSTEMD], [test "x$with_systemd" = "xyes"]) -AC_ARG_WITH([freebsd-service], -[ --with-freebsd-service = install a FreeBSD startup script during a make install], , ) +AC_ARG_WITH([freebsd-service],[AS_HELP_STRING([--with-freebsd-service],[install a FreeBSD startup script during a make install])]) AM_CONDITIONAL([INSTALL_FREEBSD_SERVICE], [test "x$with_freebsd_service" = "xyes"]) -AC_ARG_WITH([cygwin-service], -[ --with-cygwin-service = install a CYGWIN config script during a make install], , ) +AC_ARG_WITH([cygwin-service],[AS_HELP_STRING([--with-cygwin-service],[install a CYGWIN config script during a make install])]) AM_CONDITIONAL([INSTALL_CYGWIN_SERVICE], [test "x$with_cygwin_service" = "xyes"]) -AC_ARG_WITH([external-mdns],[ --with-external-mdns = support the use of 'avahi-publish-service' or 'mDNSPublish' to advertise the service on Bonjour/ZeroConf ],[ AC_MSG_RESULT(>>Including external mdns support) AC_DEFINE([CONFIG_EXTERNAL_MDNS], 1, [Needed by the compiler.]) ], ) +AC_ARG_WITH([external-mdns],[AS_HELP_STRING([--with-external-mdns],[support the use of 'avahi-publish-service' or 'mDNSPublish' to advertise the service on Bonjour/ZeroConf])],[ AC_MSG_RESULT(include external mdns support) AC_DEFINE([CONFIG_EXTERNAL_MDNS], 1, [Needed by the compiler.]) ], ) AM_CONDITIONAL([USE_EXTERNAL_MDNS], [test "x$with_external_mdns" = "xyes" ]) # Add the libconfig package if test "x${with_pkg_config}" = xyes ; then PKG_CHECK_MODULES( - [LIBCONFIG], [libconfig], - [LIBS="${LIBCONFIG_LIBS} ${LIBS}"]) + [libconfig], [libconfig], + [LIBS="${libconfig_LIBS} ${LIBS}"], AC_MSG_ERROR([libconfig library needed])) else AC_CHECK_LIB([config],[config_init], , AC_MSG_ERROR([libconfig library needed])) fi -AC_ARG_WITH([configfiles], -[ --with-configfiles = install configuration files during a make install ], ,[with_configfiles=yes]) +AC_ARG_WITH([configfiles],[AS_HELP_STRING([--with-configfiles],[install configuration files during a make install])], ,[with_configfiles=yes]) AM_CONDITIONAL([INSTALL_CONFIG_FILES], [test "x$with_configfiles" = "xyes"]) # Look for Apple ALAC flag -AC_ARG_WITH(apple-alac,[AS_HELP_STRING([--with-apple-alac],[include support for the Apple ALAC decoder])], []) +AC_ARG_WITH(apple-alac,[AS_HELP_STRING([--with-apple-alac],[include support for the Apple ALAC decoder])]) if test "x${with_apple_alac}" = "xyes" ; then -AC_MSG_RESULT(including the Apple ALAC Decoder) AC_DEFINE([CONFIG_APPLE_ALAC], 1, [Include support for using the Apple ALAC Decoder]) if test "x${with_pkg_config}" = xyes ; then PKG_CHECK_MODULES([ALAC], [alac], [LIBS="${ALAC_LIBS} ${LIBS}"], AC_MSG_ERROR(Apple ALAC Decoder support requires the alac library.)) @@ -129,7 +123,7 @@ fi AM_CONDITIONAL([USE_APPLE_ALAC], [test "x${with_apple_alac}" = "xyes"]) # Look for piddir flag -AC_ARG_WITH(piddir, [ --with-piddir= Specify a pathname to a directory in which to write the PID file.], [ +AC_ARG_WITH(piddir, [AS_HELP_STRING([--with-piddir=],[Specify a pathname to a directory in which to write the PID file.])], [ AC_MSG_CHECKING(--with-piddir argument) if test "x${with_piddir}" = x -o "x${with_piddir}" = xyes ; then AC_MSG_RESULT(not found) @@ -143,9 +137,8 @@ AM_CONDITIONAL([USE_CUSTOMPIDDIR], [test "x$REQUESTED_CUSTOMPIDDIR" = "x1"]) # Look for libdaemon -AC_ARG_WITH(libdaemon, [--with-libdaemon = include support for daemonising in non-systemd systems], REQUESTED_LIBDAEMON=1, ) +AC_ARG_WITH(libdaemon,[AS_HELP_STRING([--with-libdaemon],[include support for daemonising in non-systemd systems])], REQUESTED_LIBDAEMON=1, ) if test "x$REQUESTED_LIBDAEMON" = "x1"; then - AC_MSG_RESULT(>>Including libdaemon support for older systems) AC_DEFINE([CONFIG_LIBDAEMON], 1, [Include libdaemon]) if test "x${with_pkg_config}" = xyes ; then PKG_CHECK_MODULES( @@ -158,7 +151,7 @@ fi AM_CONDITIONAL([USE_LIBDAEMON], [test "x$REQUESTED_LIBDAEMON" = "x1"]) # Check --with-ssl=argument -AC_ARG_WITH(ssl, [ choose --with-ssl=openssl, --with-ssl=mbedtls or --with-ssl=polarssl (deprecated) for encryption services ], [ +AC_ARG_WITH(ssl, [AS_HELP_STRING([--with-ssl=],[choose --with-ssl=openssl, --with-ssl=mbedtls or --with-ssl=polarssl (deprecated) for encryption services ])], [ AC_MSG_CHECKING(encryption libraries chosen) if test "x${with_ssl}" = x -o "x${with_ssl}" = xyes ; then AC_MSG_RESULT(not found) @@ -191,13 +184,12 @@ AC_ARG_WITH(ssl, [ choose --with-ssl=openssl, --with-ssl=mbedtls or --with-ssl=p ], ) # Look for soxr flag -AC_ARG_WITH(soxr, [ --with-soxr = choose libsoxr for high-quality interpolation], [ - AC_MSG_RESULT(>>Including support for soxr-based interpolation) +AC_ARG_WITH(soxr, [AS_HELP_STRING([--with-soxr],[choose libsoxr for high-quality interpolation])], [ AC_DEFINE([CONFIG_SOXR], 1, [Include support for using the SoX Resampler library for interpolation]) if test "x${with_pkg_config}" = xyes ; then PKG_CHECK_MODULES( - [SOXR], [soxr], - [LIBS="${SOXR_LIBS} ${LIBS}"], + [soxr], [soxr], + [LIBS="${soxr_LIBS} ${LIBS}"], [AC_MSG_ERROR(soxr support requires the libsoxr library -- libsoxr-dev suggested!)]) else AC_CHECK_LIB([avutil],[av_get_cpu_flags]) @@ -211,51 +203,46 @@ AC_ARG_WITH(soxr, [ --with-soxr = choose libsoxr for high-quality interpolation ], ) # Look for metadata flag and resolve it further down the script -AC_ARG_WITH(metadata, [ --with-metadata = include support for a metadata feed], [ - REQUESTED_METADATA=1], ) +AC_ARG_WITH(metadata,[AS_HELP_STRING([--with-metadata],[include support for a metadata feed])], [REQUESTED_METADATA=1], ) # What follows is a bit messy, because if the relevant library is requested, a compiler flag is defined, a file is included in the compilation # and the relevant link files are added. # Look for avahi flag -AC_ARG_WITH(avahi, [ --with-avahi = choose Avahi-based mDNS support], [ - AC_MSG_RESULT(>>Including Avahi mDNS support) +AC_ARG_WITH(avahi, [AS_HELP_STRING([--with-avahi],[choose Avahi-based mDNS support])], [ REQUESTED_AVAHI=1 AC_DEFINE([CONFIG_AVAHI], 1, [Needed by the compiler.]) AC_CHECK_LIB([avahi-client], [avahi_client_new], , AC_MSG_ERROR(Avahi support requires the avahi-client library!)) - AC_CHECK_LIB([avahi-common],[avahi_strerror], , AC_MSG_ERROR(Avahi support requires the avahi-common library!))], ) + AC_CHECK_LIB([avahi-common],[avahi_strerror], , AC_MSG_ERROR(Avahi support requires the avahi-common library!))]) AM_CONDITIONAL([USE_AVAHI], [test "x$REQUESTED_AVAHI" = "x1"]) # Look for tinysvcmdns flag -AC_ARG_WITH(tinysvcmdns, [ --with-tinysvcmdns = choose tinysvcmdns-based mDNS support], [ - AC_MSG_RESULT(>>Including tinysvcmdns mDNS support) +AC_ARG_WITH(tinysvcmdns, [AS_HELP_STRING([--with-tinysvcmdns],[choose tinysvcmdns-based mDNS support])], [ REQUESTED_TINYSVCMDNS=1 AC_DEFINE([CONFIG_TINYSVCMDNS], 1, [Needed by the compiler.])], ) AM_CONDITIONAL([USE_TINYSVCMDNS], [test "x$REQUESTED_TINYSVCMDNS" = "x1"]) # Look for ALSA flag -AC_ARG_WITH(alsa, [ --with-alsa = choose ALSA API support (GNU/Linux only)], - [AC_MSG_RESULT(>>Including an ALSA back end) +AC_ARG_WITH(alsa, [AS_HELP_STRING([--with-alsa],[choose ALSA API support (GNU/Linux only)])], [ REQUESTED_ALSA=1 AC_DEFINE([CONFIG_ALSA], 1, [Needed by the compiler.]) if test "x${with_pkg_config}" = xyes ; then PKG_CHECK_MODULES( - [ALSA], [alsa], - [LIBS="${ALSA_LIBS} ${LIBS}"]) + [alsa], [alsa], + [LIBS="${alsa_LIBS} ${LIBS}"]) else AC_CHECK_LIB([asound], [snd_pcm_open], , AC_MSG_ERROR(ALSA support requires the asound library!)) fi ]) AM_CONDITIONAL([USE_ALSA], [test "x$REQUESTED_ALSA" = "x1"]) # Look for jack flag -AC_ARG_WITH(jack, [ --with-jack = include a Jack Audio Connection Kit (jack) backend], [ - AC_MSG_RESULT(>>Including a Jack Audio Connection Kit (jack) back end) +AC_ARG_WITH(jack, [AS_HELP_STRING([--with-jack],[include a Jack Audio Connection Kit (jack) backend])], [ REQUESTED_JACK=1 AC_DEFINE([CONFIG_JACK], 1, [Needed by the compiler.]) if test "x${with_pkg_config}" = xyes ; then PKG_CHECK_MODULES( - [JACK], [jack], - [LIBS="${JACK_LIBS} ${LIBS}"], + [jack], [jack], + [LIBS="${jack_LIBS} ${LIBS}"], [AC_MSG_ERROR(Jack Audio Connection Kit support requires the jack library -- libjack-dev suggested!)]) else AC_CHECK_LIB([jack], [jack_client_open], , AC_MSG_ERROR(Jack Audio Connection Kit support requires the jack library -- libjack-dev suggested!)) @@ -263,32 +250,28 @@ AC_ARG_WITH(jack, [ --with-jack = include a Jack Audio Connection Kit (jack) ba AM_CONDITIONAL([USE_JACK], [test "x$REQUESTED_JACK" = "x1"]) # Look for SNDIO flag -AC_ARG_WITH(sndio, [ --with-sndio = choose SNDIO API support], [ - AC_MSG_RESULT(>>Including a SNDIO back end) +AC_ARG_WITH(sndio, [AS_HELP_STRING([--with-sndio],[choose SNDIO API support])], [ REQUESTED_SNDIO=1 AC_DEFINE([CONFIG_SNDIO], 1, [Needed by the compiler.]) AC_CHECK_LIB([sndio], [sio_open], , AC_MSG_ERROR(SNDIO support requires the sndio library -- libsndio-dev suggested))], ) AM_CONDITIONAL([USE_SNDIO], [test "x$REQUESTED_SNDIO" = "x1"]) # Look for AO flag -AC_ARG_WITH(ao, [ --with-ao = choose AO (Audio Output?) API support. N.B. no synchronisation -- so underflow or overflow is inevitable!], [ - AC_MSG_RESULT(>>Including an AO back end. N.B. no synchronisation -- so underflow or overflow is inevitable!) +AC_ARG_WITH(ao, [AS_HELP_STRING([--with-ao],[choose AO (Audio Output?) API support. N.B. no synchronisation -- so underflow or overflow is inevitable!])], [ REQUESTED_AO=1 AC_DEFINE([CONFIG_AO], 1, [Needed by the compiler.]) AC_CHECK_LIB([ao], [ao_initialize], , AC_MSG_ERROR(AO support requires the ao library -- libao-dev suggested))], ) AM_CONDITIONAL([USE_AO], [test "x$REQUESTED_AO" = "x1"]) # Look for Soundio flag -AC_ARG_WITH(soundio, [ --with-soundio = choose soundio API support.], [ - AC_MSG_RESULT(>>Including an soundio back end) +AC_ARG_WITH(soundio, [AS_HELP_STRING([--with-soundio],[choose soundio API support.])], [ REQUESTED_SOUNDIO=1 AC_DEFINE([CONFIG_SOUNDIO], 1, [Needed by the compiler.]) AC_CHECK_LIB([soundio], [soundio_create], , AC_MSG_ERROR(soundio support requires the soundio library -- libsoundio-dev suggested))], ) AM_CONDITIONAL([USE_SOUNDIO], [test "x$REQUESTED_SOUNDIO" = "x1"]) # Look for pulseaudio flag -AC_ARG_WITH(pa, [ --with-pa = choose PulseAudio support.], [ - AC_MSG_RESULT(>>Including a PulseAudio back end.) +AC_ARG_WITH(pa, [AS_HELP_STRING([--with-pa],[choose PulseAudio support.])], [ REQUESTED_PA=1 AC_DEFINE([CONFIG_PA], 1, [Needed by the compiler.]) if test "x${with_pkg_config}" = xyes ; then @@ -302,8 +285,7 @@ AC_ARG_WITH(pa, [ --with-pa = choose PulseAudio support.], [ AM_CONDITIONAL([USE_PA], [test "x$REQUESTED_PA" = "x1"]) # Look for Convolution flag -AC_ARG_WITH(convolution, [ --with-convolution = choose audio DSP convolution support], [ - AC_MSG_RESULT(>>Including convolution support) +AC_ARG_WITH(convolution, [AS_HELP_STRING([--with-convolution],[choose audio DSP convolution support])], [ REQUESTED_CONVOLUTION=1 AM_INIT_AUTOMAKE([subdir-objects]) AC_DEFINE([CONFIG_CONVOLUTION], 1, [Needed by the compiler.]) @@ -311,16 +293,14 @@ AC_ARG_WITH(convolution, [ --with-convolution = choose audio DSP convolution su AM_CONDITIONAL([USE_CONVOLUTION], [test "x$REQUESTED_CONVOLUTION" = "x1"]) # Look for dns_sd flag -AC_ARG_WITH(dns_sd, [ --with-dns_sd = choose dns_sd mDNS support], [ - AC_MSG_RESULT(>>Including dns_sd for mDNS support) +AC_ARG_WITH(dns_sd, [AS_HELP_STRING([--with-dns_sd],[choose dns_sd mDNS support])], [ REQUESTED_DNS_SD=1 AC_DEFINE([CONFIG_DNS_SD], 1, [Needed by the compiler.]) AC_SEARCH_LIBS([DNSServiceRefDeallocate], [dns_sd], , AC_MSG_ERROR(dns_sd support requires the dns_sd library!))], ) AM_CONDITIONAL([USE_DNS_SD], [test "x$REQUESTED_DNS_SD" = "x1"]) # Look for dbus flag -AC_ARG_WITH(dbus-interface, [ --with-dbus-interface = include support for the native Shairport Sync D-Bus interface], [ - AC_MSG_RESULT(>>Including dbus support) +AC_ARG_WITH(dbus-interface, [AS_HELP_STRING([--with-dbus-interface],[include support for the native Shairport Sync D-Bus interface])], [ AC_DEFINE([CONFIG_DBUS_INTERFACE], 1, [Include support for the native Shairport Sync D-Bus interface]) REQUESTED_DBUS=1 PKG_CHECK_MODULES([GIO_UNIX], [gio-unix-2.0 >= 2.30.0],[CFLAGS="${GIO_UNIX_CFLAGS} ${CFLAGS}" LIBS="${GIO_UNIX_LIBS} ${LIBS}"],[AC_MSG_ERROR(dbus messaging support requires the glib 2.0 library -- libglib2.0-dev suggested!)]) @@ -328,16 +308,14 @@ AC_ARG_WITH(dbus-interface, [ --with-dbus-interface = include support for the n AM_CONDITIONAL([USE_DBUS], [test "x$REQUESTED_DBUS" = "x1"]) # Look for dbus test client flag -AC_ARG_WITH(dbus-test-client, [ --with-dbus-test-client = compile dbus test client], [ - AC_MSG_RESULT(>>Including dbus test client) +AC_ARG_WITH(dbus-test-client, [AS_HELP_STRING([--with-dbus-test-client],[compile a separare D-Bus test client])], [ REQUESTED_DBUS_CLIENT=1 PKG_CHECK_MODULES([GIO_UNIX], [gio-unix-2.0 >= 2.30.0],[CFLAGS="${GIO_UNIX_CFLAGS} ${CFLAGS}" LIBS="${GIO_UNIX_LIBS} ${LIBS}"],[AC_MSG_ERROR(dbus client support requires the glib 2.0 library -- libglib2.0-dev suggested!)]) ], ) AM_CONDITIONAL([USE_DBUS_CLIENT], [test "x$REQUESTED_DBUS_CLIENT" = "x1"]) # Look for mpris flag -AC_ARG_WITH(mpris-interface, [ --with-mpris-interface = include support for a D-Bus interface conforming to the MPRIS standard], [ - AC_MSG_RESULT(>>Including the MPRIS D-Bus Interface) +AC_ARG_WITH(mpris-interface, [AS_HELP_STRING([--with-mpris-interface],[include support for a D-Bus interface conforming to the MPRIS standard])], [ AC_DEFINE([CONFIG_MPRIS_INTERFACE], 1, [Include support for a D-Bus interface conforming to the MPRIS standard]) REQUESTED_MPRIS=1 PKG_CHECK_MODULES([GIO_UNIX], [gio-unix-2.0 >= 2.30.0],[CFLAGS="${GIO_UNIX_CFLAGS} ${CFLAGS}" LIBS="${GIO_UNIX_LIBS} ${LIBS}"],[AC_MSG_ERROR(dbus messaging support for mpris requires the glib 2.0 library -- libglib2.0-dev suggested!)]) @@ -345,28 +323,25 @@ AC_ARG_WITH(mpris-interface, [ --with-mpris-interface = include support for a D AM_CONDITIONAL([USE_MPRIS], [test "x$REQUESTED_MPRIS" = "x1"]) # Look for mpris test client flag -AC_ARG_WITH(mpris-test-client, [ --with-mpris-test-client = compile mpris test client], [ - AC_MSG_RESULT(>>Including mpris test client) +AC_ARG_WITH(mpris-test-client, [AS_HELP_STRING([--with-mpris-test-client],[compile an separate MPRIS test client])], [ REQUESTED_MPRIS_CLIENT=1 PKG_CHECK_MODULES([GIO_UNIX], [gio-unix-2.0 >= 2.30.0],[CFLAGS="${GIO_UNIX_CFLAGS} ${CFLAGS}" LIBS="${GIO_UNIX_LIBS} ${LIBS}"],[AC_MSG_ERROR(mpris client support requires the glib 2.0 library -- libglib2.0-dev suggested!)]) ], ) AM_CONDITIONAL([USE_MPRIS_CLIENT], [test "x$REQUESTED_MPRIS_CLIENT" = "x1"]) # Look for mqtt flag -AC_ARG_WITH(mqtt-client, [ --with-mqtt-client = include a client for MQTT -- the Message Queuing Telemetry Transport protocol], [ +AC_ARG_WITH(mqtt-client, [AS_HELP_STRING([--with-mqtt-client],[include a client for MQTT -- the Message Queuing Telemetry Transport protocol])], [ AC_DEFINE([CONFIG_MQTT], 1, [Include a client for MQTT, the Message Queuing Telemetry Transport protocol]) - AC_MSG_RESULT(>>Including MQTT support) REQUESTED_MQTT=1 AC_CHECK_LIB([mosquitto], [mosquitto_lib_init], , AC_MSG_ERROR(MQTT support requires the mosquitto library -- libmosquitto-dev suggested!)) ],) AM_CONDITIONAL([USE_MQTT], [test "x$REQUESTED_MQTT" = "x1"]) if test "x$REQUESTED_MQTT" = "x1" && test "x$REQUESTED_AVAHI" != "x1"; then - AC_MSG_WARN([>>MQTT needs Avahi to allow remote control functionality. Only Metadata publishing will be supported]) + AC_MSG_WARN([MQTT needs Avahi to allow remote control functionality. At present, only metadata publishing will be supported]) fi if test "x$REQUESTED_MPRIS" = "x1" || test "x$REQUESTED_DBUS" = "x1" || test "x$REQUESTED_MQTT" = "x1"; then - AC_MSG_RESULT(>>Including extended metadata and DACP client support) REQUESTED_EXTENDED_METADATA_SUPPORT=1 AC_DEFINE([CONFIG_METADATA_HUB], 1, [Needed by the compiler.]) AC_DEFINE([CONFIG_DACP_CLIENT], 1, [Needed by the compiler.]) @@ -375,7 +350,6 @@ AM_CONDITIONAL([USE_METADATA_HUB], [test "x$REQUESTED_EXTENDED_METADATA_SUPPORT" AM_CONDITIONAL([USE_DACP_CLIENT], [test "x$REQUESTED_EXTENDED_METADATA_SUPPORT" = "x1"]) if test "x$REQUESTED_EXTENDED_METADATA_SUPPORT" = "x1" || test "x$REQUESTED_METADATA" = "x1"; then - AC_MSG_RESULT(>>Including metadata support) AC_DEFINE([CONFIG_METADATA], 1, [Needed by the compiler.]) fi AM_CONDITIONAL([USE_METADATA], [test "x$REQUESTED_METADATA" = "x1"]) @@ -400,7 +374,7 @@ fi # Look for xmltoman AC_CHECK_PROGS([XMLTOMAN], [xmltoman]) if test -z "$XMLTOMAN"; then - AC_MSG_WARN([>>xmltoman not found - not rebuilding man pages]) + AC_MSG_WARN([xmltoman not found - not rebuilding man pages]) fi AM_CONDITIONAL([HAVE_XMLTOMAN], [test -n "$XMLTOMAN"]) From 3612fa374fc2de5d1e3e111216e512bf20da8309 Mon Sep 17 00:00:00 2001 From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Sat, 26 Dec 2020 16:10:04 +0000 Subject: [PATCH 4/9] Further changes, make ALAC and GIO lowecase. --- configure.ac | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 46b3e4e3..3a86e3b6 100644 --- a/configure.ac +++ b/configure.ac @@ -115,9 +115,9 @@ AC_ARG_WITH(apple-alac,[AS_HELP_STRING([--with-apple-alac],[include support for if test "x${with_apple_alac}" = "xyes" ; then AC_DEFINE([CONFIG_APPLE_ALAC], 1, [Include support for using the Apple ALAC Decoder]) if test "x${with_pkg_config}" = xyes ; then - PKG_CHECK_MODULES([ALAC], [alac], [LIBS="${ALAC_LIBS} ${LIBS}"], AC_MSG_ERROR(Apple ALAC Decoder support requires the alac library.)) + PKG_CHECK_MODULES([alac], [alac], [LIBS="${alac_LIBS} ${LIBS}"], AC_MSG_ERROR(Apple ALAC Decoder support requires the ALAC library.)) else - AC_CHECK_LIB([alac], [BitBufferInit], , AC_MSG_ERROR(Apple ALAC Decoder support requires the alac library.)) + AC_CHECK_LIB([alac], [BitBufferInit], , AC_MSG_ERROR(Apple ALAC Decoder support requires the ALAC library.)) fi fi AM_CONDITIONAL([USE_APPLE_ALAC], [test "x${with_apple_alac}" = "xyes"]) @@ -303,14 +303,14 @@ AM_CONDITIONAL([USE_DNS_SD], [test "x$REQUESTED_DNS_SD" = "x1"]) AC_ARG_WITH(dbus-interface, [AS_HELP_STRING([--with-dbus-interface],[include support for the native Shairport Sync D-Bus interface])], [ AC_DEFINE([CONFIG_DBUS_INTERFACE], 1, [Include support for the native Shairport Sync D-Bus interface]) REQUESTED_DBUS=1 - PKG_CHECK_MODULES([GIO_UNIX], [gio-unix-2.0 >= 2.30.0],[CFLAGS="${GIO_UNIX_CFLAGS} ${CFLAGS}" LIBS="${GIO_UNIX_LIBS} ${LIBS}"],[AC_MSG_ERROR(dbus messaging support requires the glib 2.0 library -- libglib2.0-dev suggested!)]) + PKG_CHECK_MODULES([glib], [gio-unix-2.0 >= 2.30.0],[CFLAGS="${glib_CFLAGS} ${CFLAGS}" LIBS="${glib_LIBS} ${LIBS}"],[AC_MSG_ERROR(D-Bus messaging support requires the glib 2.0 library -- libglib2.0-dev suggested!)]) ], ) AM_CONDITIONAL([USE_DBUS], [test "x$REQUESTED_DBUS" = "x1"]) # Look for dbus test client flag AC_ARG_WITH(dbus-test-client, [AS_HELP_STRING([--with-dbus-test-client],[compile a separare D-Bus test client])], [ REQUESTED_DBUS_CLIENT=1 - PKG_CHECK_MODULES([GIO_UNIX], [gio-unix-2.0 >= 2.30.0],[CFLAGS="${GIO_UNIX_CFLAGS} ${CFLAGS}" LIBS="${GIO_UNIX_LIBS} ${LIBS}"],[AC_MSG_ERROR(dbus client support requires the glib 2.0 library -- libglib2.0-dev suggested!)]) + PKG_CHECK_MODULES([glib], [gio-unix-2.0 >= 2.30.0],[CFLAGS="${glib_CFLAGS} ${CFLAGS}" LIBS="${glib_LIBS} ${LIBS}"],[AC_MSG_ERROR(D-Bus client support requires the glib 2.0 library -- libglib2.0-dev suggested!)]) ], ) AM_CONDITIONAL([USE_DBUS_CLIENT], [test "x$REQUESTED_DBUS_CLIENT" = "x1"]) @@ -318,14 +318,14 @@ AM_CONDITIONAL([USE_DBUS_CLIENT], [test "x$REQUESTED_DBUS_CLIENT" = "x1"]) AC_ARG_WITH(mpris-interface, [AS_HELP_STRING([--with-mpris-interface],[include support for a D-Bus interface conforming to the MPRIS standard])], [ AC_DEFINE([CONFIG_MPRIS_INTERFACE], 1, [Include support for a D-Bus interface conforming to the MPRIS standard]) REQUESTED_MPRIS=1 - PKG_CHECK_MODULES([GIO_UNIX], [gio-unix-2.0 >= 2.30.0],[CFLAGS="${GIO_UNIX_CFLAGS} ${CFLAGS}" LIBS="${GIO_UNIX_LIBS} ${LIBS}"],[AC_MSG_ERROR(dbus messaging support for mpris requires the glib 2.0 library -- libglib2.0-dev suggested!)]) + PKG_CHECK_MODULES([glib], [gio-unix-2.0 >= 2.30.0],[CFLAGS="${glib_CFLAGS} ${CFLAGS}" LIBS="${glib_LIBS} ${LIBS}"],[AC_MSG_ERROR(MPRIS messaging support for mpris requires the glib 2.0 library -- libglib2.0-dev suggested!)]) ], ) AM_CONDITIONAL([USE_MPRIS], [test "x$REQUESTED_MPRIS" = "x1"]) # Look for mpris test client flag AC_ARG_WITH(mpris-test-client, [AS_HELP_STRING([--with-mpris-test-client],[compile an separate MPRIS test client])], [ REQUESTED_MPRIS_CLIENT=1 - PKG_CHECK_MODULES([GIO_UNIX], [gio-unix-2.0 >= 2.30.0],[CFLAGS="${GIO_UNIX_CFLAGS} ${CFLAGS}" LIBS="${GIO_UNIX_LIBS} ${LIBS}"],[AC_MSG_ERROR(mpris client support requires the glib 2.0 library -- libglib2.0-dev suggested!)]) + PKG_CHECK_MODULES([glib], [gio-unix-2.0 >= 2.30.0],[CFLAGS="${glib_CFLAGS} ${CFLAGS}" LIBS="${glib_LIBS} ${LIBS}"],[AC_MSG_ERROR(MPRIS client support requires the glib 2.0 library -- libglib2.0-dev suggested!)]) ], ) AM_CONDITIONAL([USE_MPRIS_CLIENT], [test "x$REQUESTED_MPRIS_CLIENT" = "x1"]) From 9af9dafb97ac227c3185a9ad6db43305a45c7b1e Mon Sep 17 00:00:00 2001 From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Sat, 26 Dec 2020 16:11:53 +0000 Subject: [PATCH 5/9] Partially fix the --with-* and --without-* issues and clean up the script. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 3a86e3b6..acaebe24 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.50]) -AC_INIT([shairport-sync], [3.3.8d3], [4265913+mikebrady@users.noreply.github.com]) +AC_INIT([shairport-sync], [3.3.8d4], [4265913+mikebrady@users.noreply.github.com]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([shairport.c]) AC_CONFIG_HEADERS([config.h]) From 26ff0c2095fd6686320fa93b6dac17a0a02fe863 Mon Sep 17 00:00:00 2001 From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Wed, 30 Dec 2020 19:32:46 +0000 Subject: [PATCH 6/9] More of the configure.ac fixes done. Still incomplete. --- configure.ac | 174 ++++++++++++++++++++++++++++----------------------- 1 file changed, 94 insertions(+), 80 deletions(-) diff --git a/configure.ac b/configure.ac index acaebe24..dd59c22c 100644 --- a/configure.ac +++ b/configure.ac @@ -17,6 +17,10 @@ if test "z$with_os" = "z"; then fi with_os=`echo ${with_os} | tr '[[:upper:]]' '[[:lower:]]' ` +if test "x${with_os}" != xlinux && "x${with_os}" != xfreebsd && "x${with_os}" != xdarwin ; then + AC_MSG_ERROR(--with-os= argument must linux, freebsd, openbsd or darwin) +fi + # Checks for programs. AC_PROG_CC AC_PROG_CXX @@ -40,6 +44,7 @@ AM_CONDITIONAL([BUILD_FOR_OPENBSD], [test "x${with_os}" = xopenbsd ]) ##### Some build systems are not fully using pkg-config, so we can use the flag ${with_pkg_config} on a case-by-case basis ##### to control how to deal with them +##### Note -- this flag is sometimes ignored, especially for newer packages AC_ARG_WITH([pkg_config],[AS_HELP_STRING([--with-pkg-config],[use pkg-config to find libraries])],[],[with_pkg_config=yes]) @@ -77,7 +82,7 @@ if test "x$with_pipe" = "xyes" ; then AC_MSG_RESULT(include the pipe audio back end) AC_DEFINE([CONFIG_PIPE], 1, [Needed by the compiler.]) fi -AM_CONDITIONAL([USE_PIPE], [test "x$with_dummy" = "xyes" ]) +AM_CONDITIONAL([USE_PIPE], [test "x$with_pipe" = "xyes" ]) # Check to see if we should include the System V initscript @@ -95,7 +100,11 @@ AM_CONDITIONAL([INSTALL_FREEBSD_SERVICE], [test "x$with_freebsd_service" = "xyes AC_ARG_WITH([cygwin-service],[AS_HELP_STRING([--with-cygwin-service],[install a CYGWIN config script during a make install])]) AM_CONDITIONAL([INSTALL_CYGWIN_SERVICE], [test "x$with_cygwin_service" = "xyes"]) -AC_ARG_WITH([external-mdns],[AS_HELP_STRING([--with-external-mdns],[support the use of 'avahi-publish-service' or 'mDNSPublish' to advertise the service on Bonjour/ZeroConf])],[ AC_MSG_RESULT(include external mdns support) AC_DEFINE([CONFIG_EXTERNAL_MDNS], 1, [Needed by the compiler.]) ], ) +AC_ARG_WITH([external-mdns],[AS_HELP_STRING([--with-external-mdns],[support the use of 'avahi-publish-service' or 'mDNSPublish' to advertise the service on Bonjour/ZeroConf])]) +if test "x$with_external_mdns" = xyes ; then + AC_MSG_RESULT(include external mdns support) + AC_DEFINE([CONFIG_EXTERNAL_MDNS], 1, [Use 'avahi-publish-service' or 'mDNSPublish' to advertise.]) +fi AM_CONDITIONAL([USE_EXTERNAL_MDNS], [test "x$with_external_mdns" = "xyes" ]) # Add the libconfig package @@ -123,22 +132,22 @@ fi AM_CONDITIONAL([USE_APPLE_ALAC], [test "x${with_apple_alac}" = "xyes"]) # Look for piddir flag -AC_ARG_WITH(piddir, [AS_HELP_STRING([--with-piddir=],[Specify a pathname to a directory in which to write the PID file.])], [ +AC_ARG_WITH(piddir, [AS_HELP_STRING([--with-piddir=],[Specify a pathname to a directory in which to write the PID file.])]) +if test "x${with_piddir}" != "x" ; then AC_MSG_CHECKING(--with-piddir argument) if test "x${with_piddir}" = x -o "x${with_piddir}" = xyes ; then AC_MSG_RESULT(not found) AC_MSG_ERROR(when you use the --with-piddir directive you must specify the pathname of the directory into which the PID file will be written) fi AC_MSG_RESULT(${with_piddir}) - REQUESTED_CUSTOMPIDDIR=1 - AC_SUBST(CUSTOM_PID_DIR,["${with_piddir}"]) - AC_DEFINE([DEFINED_CUSTOM_PID_DIR],1,[Hook up special proc to libdaemon to point to this directory])], ) -AM_CONDITIONAL([USE_CUSTOMPIDDIR], [test "x$REQUESTED_CUSTOMPIDDIR" = "x1"]) - + AC_SUBST(CUSTOM_PID_DIR,["${with_piddir}"]) + AC_DEFINE([DEFINED_CUSTOM_PID_DIR],1,[Hook up special proc to libdaemon to point to this directory]) +fi +AM_CONDITIONAL([USE_CUSTOMPIDDIR], [ test "x${with_piddir}" != "x" ]) # Look for libdaemon -AC_ARG_WITH(libdaemon,[AS_HELP_STRING([--with-libdaemon],[include support for daemonising in non-systemd systems])], REQUESTED_LIBDAEMON=1, ) -if test "x$REQUESTED_LIBDAEMON" = "x1"; then +AC_ARG_WITH(libdaemon,[AS_HELP_STRING([--with-libdaemon],[include support for daemonising in non-systemd systems])]) +if test "x$with_libdaemon" = "x1"; then AC_DEFINE([CONFIG_LIBDAEMON], 1, [Include libdaemon]) if test "x${with_pkg_config}" = xyes ; then PKG_CHECK_MODULES( @@ -148,43 +157,40 @@ if test "x$REQUESTED_LIBDAEMON" = "x1"; then AC_CHECK_LIB([daemon],[daemon_fork], , AC_MSG_ERROR(libdaemon needed)) fi fi -AM_CONDITIONAL([USE_LIBDAEMON], [test "x$REQUESTED_LIBDAEMON" = "x1"]) +AM_CONDITIONAL([USE_LIBDAEMON], [test "x$with_libdaemon" = "x1"]) # Check --with-ssl=argument -AC_ARG_WITH(ssl, [AS_HELP_STRING([--with-ssl=],[choose --with-ssl=openssl, --with-ssl=mbedtls or --with-ssl=polarssl (deprecated) for encryption services ])], [ - AC_MSG_CHECKING(encryption libraries chosen) - if test "x${with_ssl}" = x -o "x${with_ssl}" = xyes ; then - AC_MSG_RESULT(not found) - AC_MSG_ERROR(choose "openssl", "mbedtls" or "polarssl" encryption) - fi - if test "x${with_ssl}" = xopenssl ; then - AC_DEFINE([CONFIG_OPENSSL], 1, [Use the OpenSSL libraries for encryption and encoding and decoding]) - if test "x${with_pkg_config}" = xyes ; then - PKG_CHECK_MODULES( - [SSL], [libssl,libcrypto], - [LIBS="${SSL_LIBS} ${LIBS}"]) - else - AC_CHECK_LIB([crypto], [main], , AC_MSG_ERROR(libcrypto selected but the library cannot be found!)) - AC_CHECK_LIB([ssl], [main], , AC_MSG_ERROR(libssl selected but the library cannot be found!)) - fi - elif test "x${with_ssl}" = xmbedtls ; then - AC_DEFINE([CONFIG_MBEDTLS], 1, [Use the mbed TLS libraries for encryption and encoding and decoding]) - AC_CHECK_LIB([mbedtls],[mbedtls_ssl_init],, +AC_ARG_WITH(ssl, [AS_HELP_STRING([--with-ssl=],[choose --with-ssl=openssl, --with-ssl=mbedtls or --with-ssl=polarssl (deprecated) for encryption services ])]) + +if test "x${with_ssl}" = xopenssl ; then + AC_DEFINE([CONFIG_OPENSSL], 1, [Use the OpenSSL libraries for encryption and encoding and decoding]) + if test "x${with_pkg_config}" = xyes ; then + PKG_CHECK_MODULES( + [SSL], [libssl,libcrypto], + [LIBS="${SSL_LIBS} ${LIBS}"]) + else + AC_CHECK_LIB([crypto], [main], , AC_MSG_ERROR(libcrypto selected but the library cannot be found!)) + AC_CHECK_LIB([ssl], [main], , AC_MSG_ERROR(libssl selected but the library cannot be found!)) + fi +elif test "x${with_ssl}" = xmbedtls ; then + AC_DEFINE([CONFIG_MBEDTLS], 1, [Use the mbed TLS libraries for encryption and encoding and decoding]) + AC_CHECK_LIB([mbedtls],[mbedtls_ssl_init],, [AC_MSG_ERROR([mbed tls support requires the mbedtls library -- libmbedtls-dev suggested],1)]) - AC_CHECK_LIB([mbedcrypto], [mbedtls_entropy_func],, - [AC_MSG_ERROR([mbed tls support requires the mbedcrypto library -- libmbedcrypto0 suggested],1)]) - AC_CHECK_LIB([mbedx509], [mbedtls_pk_init],, - [AC_MSG_ERROR([mbed tls support requires the mbedx509 library -- libmbedx509-0 suggested],1)]) - elif test "x${with_ssl}" = xpolarssl ; then - AC_DEFINE([CONFIG_POLARSSL], 1, [Use the PolarSSL libraries for encryption and encoding and decoding]) - AC_CHECK_LIB([polarssl],[ssl_init], , AC_MSG_ERROR(PolarSSL is selected but the library cannot be found and is deprecated. Consider selecting mbed TLS instead using --with-ssl=mbedtls.)) - else - AC_MSG_ERROR(unknown option "${with_ssl}"." Please choose with "openssl", "mbedtls" or "polarssl") - fi -], ) + AC_CHECK_LIB([mbedcrypto], [mbedtls_entropy_func],, + [AC_MSG_ERROR([mbed tls support requires the mbedcrypto library -- libmbedcrypto0 suggested],1)]) + AC_CHECK_LIB([mbedx509], [mbedtls_pk_init],, + [AC_MSG_ERROR([mbed tls support requires the mbedx509 library -- libmbedx509-0 suggested],1)]) +elif test "x${with_ssl}" = xpolarssl ; then + AC_DEFINE([CONFIG_POLARSSL], 1, [Use the PolarSSL libraries for encryption and encoding and decoding]) + AC_CHECK_LIB([polarssl],[ssl_init], , AC_MSG_ERROR(PolarSSL is selected but the library cannot be found and is deprecated. Consider selecting mbed TLS instead using --with-ssl=mbedtls.)) +else + AC_MSG_ERROR(specify one of --with-ssl=openssl or --with-ssl=mbedtls or --with-ssl=polarssl) +fi # Look for soxr flag -AC_ARG_WITH(soxr, [AS_HELP_STRING([--with-soxr],[choose libsoxr for high-quality interpolation])], [ + +AC_ARG_WITH(soxr, [AS_HELP_STRING([--with-soxr],[choose libsoxr for high-quality interpolation])]) +if test "x$with_soxr" = "xyes" ; then AC_DEFINE([CONFIG_SOXR], 1, [Include support for using the SoX Resampler library for interpolation]) if test "x${with_pkg_config}" = xyes ; then PKG_CHECK_MODULES( @@ -200,31 +206,33 @@ AC_ARG_WITH(soxr, [AS_HELP_STRING([--with-soxr],[choose libsoxr for high-quality AC_CHECK_LIB([soxr],[soxr_create], , AC_MSG_ERROR(soxr support requires the libsoxr library -- libsoxr-dev suggested!)) fi fi -], ) +fi # Look for metadata flag and resolve it further down the script -AC_ARG_WITH(metadata,[AS_HELP_STRING([--with-metadata],[include support for a metadata feed])], [REQUESTED_METADATA=1], ) +AC_ARG_WITH(metadata,[AS_HELP_STRING([--with-metadata],[include support for a metadata feed])]) # What follows is a bit messy, because if the relevant library is requested, a compiler flag is defined, a file is included in the compilation # and the relevant link files are added. # Look for avahi flag -AC_ARG_WITH(avahi, [AS_HELP_STRING([--with-avahi],[choose Avahi-based mDNS support])], [ - REQUESTED_AVAHI=1 +AC_ARG_WITH(avahi, [AS_HELP_STRING([--with-avahi],[choose Avahi-based mDNS support])]) +if test "x$with_avahi" = "xyes" ; then AC_DEFINE([CONFIG_AVAHI], 1, [Needed by the compiler.]) AC_CHECK_LIB([avahi-client], [avahi_client_new], , AC_MSG_ERROR(Avahi support requires the avahi-client library!)) - AC_CHECK_LIB([avahi-common],[avahi_strerror], , AC_MSG_ERROR(Avahi support requires the avahi-common library!))]) -AM_CONDITIONAL([USE_AVAHI], [test "x$REQUESTED_AVAHI" = "x1"]) + AC_CHECK_LIB([avahi-common],[avahi_strerror], , AC_MSG_ERROR(Avahi support requires the avahi-common library!)) +fi +AM_CONDITIONAL([USE_AVAHI], [test "x$with_avahi" = "xyes"]) # Look for tinysvcmdns flag -AC_ARG_WITH(tinysvcmdns, [AS_HELP_STRING([--with-tinysvcmdns],[choose tinysvcmdns-based mDNS support])], [ - REQUESTED_TINYSVCMDNS=1 - AC_DEFINE([CONFIG_TINYSVCMDNS], 1, [Needed by the compiler.])], ) -AM_CONDITIONAL([USE_TINYSVCMDNS], [test "x$REQUESTED_TINYSVCMDNS" = "x1"]) +AC_ARG_WITH(tinysvcmdns, [AS_HELP_STRING([--with-tinysvcmdns],[choose tinysvcmdns-based mDNS support])]) +if test "x$with_tinysvcmdns" = "xyes" ; then + AC_DEFINE([CONFIG_TINYSVCMDNS], 1, [Include TinySVCmDNS-based mDNS support]) +fi +AM_CONDITIONAL([USE_TINYSVCMDNS], [test "x$with_tinysvcmdns" = "xyes"]) # Look for ALSA flag -AC_ARG_WITH(alsa, [AS_HELP_STRING([--with-alsa],[choose ALSA API support (GNU/Linux only)])], [ - REQUESTED_ALSA=1 +AC_ARG_WITH(alsa, [AS_HELP_STRING([--with-alsa],[choose ALSA API support (GNU/Linux only)])]) +if test "x$with_alsa" = "xyes" ; then AC_DEFINE([CONFIG_ALSA], 1, [Needed by the compiler.]) if test "x${with_pkg_config}" = xyes ; then PKG_CHECK_MODULES( @@ -232,12 +240,13 @@ AC_ARG_WITH(alsa, [AS_HELP_STRING([--with-alsa],[choose ALSA API support (GNU/Li [LIBS="${alsa_LIBS} ${LIBS}"]) else AC_CHECK_LIB([asound], [snd_pcm_open], , AC_MSG_ERROR(ALSA support requires the asound library!)) - fi ]) -AM_CONDITIONAL([USE_ALSA], [test "x$REQUESTED_ALSA" = "x1"]) + fi +fi +AM_CONDITIONAL([USE_ALSA], [test "x$with_alsa" = "xyes"]) # Look for jack flag -AC_ARG_WITH(jack, [AS_HELP_STRING([--with-jack],[include a Jack Audio Connection Kit (jack) backend])], [ - REQUESTED_JACK=1 +AC_ARG_WITH(jack, [AS_HELP_STRING([--with-jack],[include a Jack Audio Connection Kit (jack) backend])]) +if test "x$with_jack" = "xyes" ; then AC_DEFINE([CONFIG_JACK], 1, [Needed by the compiler.]) if test "x${with_pkg_config}" = xyes ; then PKG_CHECK_MODULES( @@ -246,33 +255,37 @@ AC_ARG_WITH(jack, [AS_HELP_STRING([--with-jack],[include a Jack Audio Connection [AC_MSG_ERROR(Jack Audio Connection Kit support requires the jack library -- libjack-dev suggested!)]) else AC_CHECK_LIB([jack], [jack_client_open], , AC_MSG_ERROR(Jack Audio Connection Kit support requires the jack library -- libjack-dev suggested!)) - fi ]) -AM_CONDITIONAL([USE_JACK], [test "x$REQUESTED_JACK" = "x1"]) + fi +fi +AM_CONDITIONAL([USE_JACK], [test "x$with_jack" = "xyes"]) # Look for SNDIO flag -AC_ARG_WITH(sndio, [AS_HELP_STRING([--with-sndio],[choose SNDIO API support])], [ - REQUESTED_SNDIO=1 +AC_ARG_WITH(sndio, [AS_HELP_STRING([--with-sndio],[choose SNDIO API support])]) +if test "x$with_sndio" = "xyes" ; then AC_DEFINE([CONFIG_SNDIO], 1, [Needed by the compiler.]) - AC_CHECK_LIB([sndio], [sio_open], , AC_MSG_ERROR(SNDIO support requires the sndio library -- libsndio-dev suggested))], ) -AM_CONDITIONAL([USE_SNDIO], [test "x$REQUESTED_SNDIO" = "x1"]) + AC_CHECK_LIB([sndio], [sio_open], , AC_MSG_ERROR(SNDIO support requires the sndio library -- libsndio-dev suggested)) +fi +AM_CONDITIONAL([USE_SNDIO], [test "x$with_sndio" = "xyes"]) # Look for AO flag -AC_ARG_WITH(ao, [AS_HELP_STRING([--with-ao],[choose AO (Audio Output?) API support. N.B. no synchronisation -- so underflow or overflow is inevitable!])], [ - REQUESTED_AO=1 +AC_ARG_WITH(ao, [AS_HELP_STRING([--with-ao],[choose AO (Audio Output?) API support. N.B. no synchronisation -- so underflow or overflow is inevitable!])]) +if test "x$with_ao" = "xyes" ; then AC_DEFINE([CONFIG_AO], 1, [Needed by the compiler.]) - AC_CHECK_LIB([ao], [ao_initialize], , AC_MSG_ERROR(AO support requires the ao library -- libao-dev suggested))], ) -AM_CONDITIONAL([USE_AO], [test "x$REQUESTED_AO" = "x1"]) + AC_CHECK_LIB([ao], [ao_initialize], , AC_MSG_ERROR(AO support requires the ao library -- libao-dev suggested)) +fi +AM_CONDITIONAL([USE_AO], [test "x$with_ao" = "xyes"]) # Look for Soundio flag -AC_ARG_WITH(soundio, [AS_HELP_STRING([--with-soundio],[choose soundio API support.])], [ - REQUESTED_SOUNDIO=1 - AC_DEFINE([CONFIG_SOUNDIO], 1, [Needed by the compiler.]) - AC_CHECK_LIB([soundio], [soundio_create], , AC_MSG_ERROR(soundio support requires the soundio library -- libsoundio-dev suggested))], ) -AM_CONDITIONAL([USE_SOUNDIO], [test "x$REQUESTED_SOUNDIO" = "x1"]) +AC_ARG_WITH(soundio, [AS_HELP_STRING([--with-soundio],[choose soundio API support.])]) +if test "x$with_soundio" = "xyes" ; then + AC_DEFINE([CONFIG_SOUNDIO], 1, [Include SoundIO Support.]) + AC_CHECK_LIB([soundio], [soundio_create], , AC_MSG_ERROR(soundio support requires the soundio library -- libsoundio-dev suggested)) +fi +AM_CONDITIONAL([USE_SOUNDIO], [test "x$with_soundio" = "xyes"]) # Look for pulseaudio flag -AC_ARG_WITH(pa, [AS_HELP_STRING([--with-pa],[choose PulseAudio support.])], [ - REQUESTED_PA=1 +AC_ARG_WITH(pa, [AS_HELP_STRING([--with-pa],[choose PulseAudio support.])]) +if test "x$with_pa" = "xyes" ; then AC_DEFINE([CONFIG_PA], 1, [Needed by the compiler.]) if test "x${with_pkg_config}" = xyes ; then PKG_CHECK_MODULES( @@ -281,8 +294,9 @@ AC_ARG_WITH(pa, [AS_HELP_STRING([--with-pa],[choose PulseAudio support.])], [ else AC_CHECK_LIB([pulse-simple], [pa_simple_new], , AC_MSG_ERROR(PulseAudio support requires the libpulse library!)) AC_CHECK_LIB([pulse], [pa_stream_peek], , AC_MSG_ERROR(PulseAudio support requires the libpulse-dev library.)) - fi ]) -AM_CONDITIONAL([USE_PA], [test "x$REQUESTED_PA" = "x1"]) + fi +fi +AM_CONDITIONAL([USE_PA], [test "x$with_pa" = "xyes"]) # Look for Convolution flag AC_ARG_WITH(convolution, [AS_HELP_STRING([--with-convolution],[choose audio DSP convolution support])], [ @@ -337,7 +351,7 @@ AC_ARG_WITH(mqtt-client, [AS_HELP_STRING([--with-mqtt-client],[include a client ],) AM_CONDITIONAL([USE_MQTT], [test "x$REQUESTED_MQTT" = "x1"]) -if test "x$REQUESTED_MQTT" = "x1" && test "x$REQUESTED_AVAHI" != "x1"; then +if test "x$REQUESTED_MQTT" = "x1" && test "x$with_avahi" = "xyes" ; then AC_MSG_WARN([MQTT needs Avahi to allow remote control functionality. At present, only metadata publishing will be supported]) fi @@ -349,10 +363,10 @@ fi AM_CONDITIONAL([USE_METADATA_HUB], [test "x$REQUESTED_EXTENDED_METADATA_SUPPORT" = "x1"]) AM_CONDITIONAL([USE_DACP_CLIENT], [test "x$REQUESTED_EXTENDED_METADATA_SUPPORT" = "x1"]) -if test "x$REQUESTED_EXTENDED_METADATA_SUPPORT" = "x1" || test "x$REQUESTED_METADATA" = "x1"; then +if test "x$REQUESTED_EXTENDED_METADATA_SUPPORT" = "x1" || test "x$with_metadata" = "xyes" ; then AC_DEFINE([CONFIG_METADATA], 1, [Needed by the compiler.]) fi -AM_CONDITIONAL([USE_METADATA], [test "x$REQUESTED_METADATA" = "x1"]) +AM_CONDITIONAL([USE_METADATA], [test "x$with_metadata" = "xyes"]) if test "x${with_systemd}" = xyes ; then # Find systemd unit dir From ca40780a76996774f4a3a5588b0db4bcf6a89329 Mon Sep 17 00:00:00 2001 From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Fri, 1 Jan 2021 19:16:27 +0000 Subject: [PATCH 7/9] Add some simple configuration tests. --- .gitignore | 1 + configure.ac | 106 ++++++++++----------- tests/configure_test.sh | 201 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 256 insertions(+), 52 deletions(-) create mode 100644 tests/configure_test.sh diff --git a/.gitignore b/.gitignore index 6f76aec5..9d13084c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ /shairport-sync-mpris-test-client *.o +*.log /*~ *.xml~ /config.mk diff --git a/configure.ac b/configure.ac index dd59c22c..341bb389 100644 --- a/configure.ac +++ b/configure.ac @@ -66,21 +66,21 @@ fi AC_ARG_WITH([dummy],[AS_HELP_STRING([--with-dummy],[include the dummy audio back end])]) if test "x$with_dummy" = "xyes" ; then AC_MSG_RESULT(include the dummy audio back end) - AC_DEFINE([CONFIG_DUMMY], 1, [Needed by the compiler.]) + AC_DEFINE([CONFIG_DUMMY], 1, [Include a fake audio backend.]) fi AM_CONDITIONAL([USE_DUMMY], [test "x$with_dummy" = "xyes" ]) AC_ARG_WITH([stdout],[AS_HELP_STRING([--with-stdout],[include the stdout audio back end])]) if test "x$with_stdout" = "xyes" ; then AC_MSG_RESULT(include the stdout audio back end) - AC_DEFINE([CONFIG_STDOUT], 1, [Needed by the compiler.]) + AC_DEFINE([CONFIG_STDOUT], 1, [Include an audio backend to output to standard output (stdout).]) fi AM_CONDITIONAL([USE_STDOUT], [test "x$with_stdout" = "xyes"]) AC_ARG_WITH([pipe],[AS_HELP_STRING([--with-pipe],[include the pipe audio back end])]) if test "x$with_pipe" = "xyes" ; then AC_MSG_RESULT(include the pipe audio back end) - AC_DEFINE([CONFIG_PIPE], 1, [Needed by the compiler.]) + AC_DEFINE([CONFIG_PIPE], 1, [Include an audio backend to output to a unix pipe.]) fi AM_CONDITIONAL([USE_PIPE], [test "x$with_pipe" = "xyes" ]) @@ -148,7 +148,7 @@ AM_CONDITIONAL([USE_CUSTOMPIDDIR], [ test "x${with_piddir}" != "x" ]) # Look for libdaemon AC_ARG_WITH(libdaemon,[AS_HELP_STRING([--with-libdaemon],[include support for daemonising in non-systemd systems])]) if test "x$with_libdaemon" = "x1"; then - AC_DEFINE([CONFIG_LIBDAEMON], 1, [Include libdaemon]) + AC_DEFINE([CONFIG_LIBDAEMON], 1, [Include libdaemon for daemonising in non-systemd systems]) if test "x${with_pkg_config}" = xyes ; then PKG_CHECK_MODULES( [DAEMON], [libdaemon], @@ -217,7 +217,7 @@ AC_ARG_WITH(metadata,[AS_HELP_STRING([--with-metadata],[include support for a me # Look for avahi flag AC_ARG_WITH(avahi, [AS_HELP_STRING([--with-avahi],[choose Avahi-based mDNS support])]) if test "x$with_avahi" = "xyes" ; then - AC_DEFINE([CONFIG_AVAHI], 1, [Needed by the compiler.]) + AC_DEFINE([CONFIG_AVAHI], 1, [Include Avahi-based mDNS support.]) AC_CHECK_LIB([avahi-client], [avahi_client_new], , AC_MSG_ERROR(Avahi support requires the avahi-client library!)) AC_CHECK_LIB([avahi-common],[avahi_strerror], , AC_MSG_ERROR(Avahi support requires the avahi-common library!)) fi @@ -247,7 +247,7 @@ AM_CONDITIONAL([USE_ALSA], [test "x$with_alsa" = "xyes"]) # Look for jack flag AC_ARG_WITH(jack, [AS_HELP_STRING([--with-jack],[include a Jack Audio Connection Kit (jack) backend])]) if test "x$with_jack" = "xyes" ; then - AC_DEFINE([CONFIG_JACK], 1, [Needed by the compiler.]) + AC_DEFINE([CONFIG_JACK], 1, [Include a Jack Audio Connection Kit (jack) audio backend]) if test "x${with_pkg_config}" = xyes ; then PKG_CHECK_MODULES( [jack], [jack], @@ -262,7 +262,7 @@ AM_CONDITIONAL([USE_JACK], [test "x$with_jack" = "xyes"]) # Look for SNDIO flag AC_ARG_WITH(sndio, [AS_HELP_STRING([--with-sndio],[choose SNDIO API support])]) if test "x$with_sndio" = "xyes" ; then - AC_DEFINE([CONFIG_SNDIO], 1, [Needed by the compiler.]) + AC_DEFINE([CONFIG_SNDIO], 1, [Include a sndio-compatible audio backend.]) AC_CHECK_LIB([sndio], [sio_open], , AC_MSG_ERROR(SNDIO support requires the sndio library -- libsndio-dev suggested)) fi AM_CONDITIONAL([USE_SNDIO], [test "x$with_sndio" = "xyes"]) @@ -270,7 +270,7 @@ AM_CONDITIONAL([USE_SNDIO], [test "x$with_sndio" = "xyes"]) # Look for AO flag AC_ARG_WITH(ao, [AS_HELP_STRING([--with-ao],[choose AO (Audio Output?) API support. N.B. no synchronisation -- so underflow or overflow is inevitable!])]) if test "x$with_ao" = "xyes" ; then - AC_DEFINE([CONFIG_AO], 1, [Needed by the compiler.]) + AC_DEFINE([CONFIG_AO], 1, [Include an AO-compatible audio backend.]) AC_CHECK_LIB([ao], [ao_initialize], , AC_MSG_ERROR(AO support requires the ao library -- libao-dev suggested)) fi AM_CONDITIONAL([USE_AO], [test "x$with_ao" = "xyes"]) @@ -286,7 +286,7 @@ AM_CONDITIONAL([USE_SOUNDIO], [test "x$with_soundio" = "xyes"]) # Look for pulseaudio flag AC_ARG_WITH(pa, [AS_HELP_STRING([--with-pa],[choose PulseAudio support.])]) if test "x$with_pa" = "xyes" ; then - AC_DEFINE([CONFIG_PA], 1, [Needed by the compiler.]) + AC_DEFINE([CONFIG_PA], 1, [Include PulseAudio support.]) if test "x${with_pkg_config}" = xyes ; then PKG_CHECK_MODULES( [PULSEAUDIO], [libpulse >= 0.9.2], @@ -299,63 +299,65 @@ fi AM_CONDITIONAL([USE_PA], [test "x$with_pa" = "xyes"]) # Look for Convolution flag -AC_ARG_WITH(convolution, [AS_HELP_STRING([--with-convolution],[choose audio DSP convolution support])], [ - REQUESTED_CONVOLUTION=1 +AC_ARG_WITH(convolution, [AS_HELP_STRING([--with-convolution],[choose audio DSP convolution support])]) +if test "x$with_convolution" = "xyes" ; then AM_INIT_AUTOMAKE([subdir-objects]) - AC_DEFINE([CONFIG_CONVOLUTION], 1, [Needed by the compiler.]) - AC_CHECK_LIB([sndfile], [sf_open], , AC_MSG_ERROR(Convolution support requires the sndfile library -- libsndfile1-dev suggested!))], ) -AM_CONDITIONAL([USE_CONVOLUTION], [test "x$REQUESTED_CONVOLUTION" = "x1"]) + AC_DEFINE([CONFIG_CONVOLUTION], 1, [Include audio DSP convolution support.]) + AC_CHECK_LIB([sndfile], [sf_open], , AC_MSG_ERROR(Convolution support requires the sndfile library -- libsndfile1-dev suggested!)) +fi +AM_CONDITIONAL([USE_CONVOLUTION], [test "x$with_convolution" = "xyes"]) # Look for dns_sd flag -AC_ARG_WITH(dns_sd, [AS_HELP_STRING([--with-dns_sd],[choose dns_sd mDNS support])], [ - REQUESTED_DNS_SD=1 - AC_DEFINE([CONFIG_DNS_SD], 1, [Needed by the compiler.]) - AC_SEARCH_LIBS([DNSServiceRefDeallocate], [dns_sd], , AC_MSG_ERROR(dns_sd support requires the dns_sd library!))], ) -AM_CONDITIONAL([USE_DNS_SD], [test "x$REQUESTED_DNS_SD" = "x1"]) +AC_ARG_WITH(dns_sd, [AS_HELP_STRING([--with-dns_sd],[choose dns_sd mDNS support])]) +if test "x$with_dns_sd" = "xyes" ; then + AC_DEFINE([CONFIG_DNS_SD], 1, [Include dns_sd mDNS support.]) + AC_SEARCH_LIBS([DNSServiceRefDeallocate], [dns_sd], , [AC_MSG_ERROR(dns_sd support requires the dns_sd library!)]) +fi +AM_CONDITIONAL([USE_DNS_SD], [test "x$with_dns_sd" = "xyes"]) # Look for dbus flag -AC_ARG_WITH(dbus-interface, [AS_HELP_STRING([--with-dbus-interface],[include support for the native Shairport Sync D-Bus interface])], [ - AC_DEFINE([CONFIG_DBUS_INTERFACE], 1, [Include support for the native Shairport Sync D-Bus interface]) - REQUESTED_DBUS=1 - PKG_CHECK_MODULES([glib], [gio-unix-2.0 >= 2.30.0],[CFLAGS="${glib_CFLAGS} ${CFLAGS}" LIBS="${glib_LIBS} ${LIBS}"],[AC_MSG_ERROR(D-Bus messaging support requires the glib 2.0 library -- libglib2.0-dev suggested!)]) - ], ) -AM_CONDITIONAL([USE_DBUS], [test "x$REQUESTED_DBUS" = "x1"]) +AC_ARG_WITH(dbus-interface, [AS_HELP_STRING([--with-dbus-interface],[include support for the native Shairport Sync D-Bus interface])]) +if test "x$with_dbus_interface" = "xyes" ; then + AC_DEFINE([CONFIG_DBUS_INTERFACE], 1, [Support the native Shairport Sync D-Bus interface]) + # remember to include glib, below +fi +AM_CONDITIONAL([USE_DBUS], [test "x$with_dbus_interface" = "xyes"]) # Look for dbus test client flag -AC_ARG_WITH(dbus-test-client, [AS_HELP_STRING([--with-dbus-test-client],[compile a separare D-Bus test client])], [ - REQUESTED_DBUS_CLIENT=1 - PKG_CHECK_MODULES([glib], [gio-unix-2.0 >= 2.30.0],[CFLAGS="${glib_CFLAGS} ${CFLAGS}" LIBS="${glib_LIBS} ${LIBS}"],[AC_MSG_ERROR(D-Bus client support requires the glib 2.0 library -- libglib2.0-dev suggested!)]) - ], ) -AM_CONDITIONAL([USE_DBUS_CLIENT], [test "x$REQUESTED_DBUS_CLIENT" = "x1"]) +AC_ARG_WITH(dbus-test-client, [AS_HELP_STRING([--with-dbus-test-client],[compile a D-Bus test client application])]) +# remember to include glib, below +AM_CONDITIONAL([USE_DBUS_CLIENT], [test "x$with_dbus_test_client" = "xyes"]) # Look for mpris flag -AC_ARG_WITH(mpris-interface, [AS_HELP_STRING([--with-mpris-interface],[include support for a D-Bus interface conforming to the MPRIS standard])], [ - AC_DEFINE([CONFIG_MPRIS_INTERFACE], 1, [Include support for a D-Bus interface conforming to the MPRIS standard]) - REQUESTED_MPRIS=1 - PKG_CHECK_MODULES([glib], [gio-unix-2.0 >= 2.30.0],[CFLAGS="${glib_CFLAGS} ${CFLAGS}" LIBS="${glib_LIBS} ${LIBS}"],[AC_MSG_ERROR(MPRIS messaging support for mpris requires the glib 2.0 library -- libglib2.0-dev suggested!)]) - ], ) -AM_CONDITIONAL([USE_MPRIS], [test "x$REQUESTED_MPRIS" = "x1"]) +AC_ARG_WITH(mpris-interface, [AS_HELP_STRING([--with-mpris-interface],[include support for a D-Bus interface conforming to the MPRIS standard])]) +if test "x$with_mpris_interface" = "xyes" ; then + AC_DEFINE([CONFIG_MPRIS_INTERFACE], 1, [Support the MPRIS standard]) + # remember to include glib, below +fi +AM_CONDITIONAL([USE_MPRIS], [test "x$with_mpris_interface" = "xyes"]) # Look for mpris test client flag -AC_ARG_WITH(mpris-test-client, [AS_HELP_STRING([--with-mpris-test-client],[compile an separate MPRIS test client])], [ - REQUESTED_MPRIS_CLIENT=1 +AC_ARG_WITH(mpris-test-client, [AS_HELP_STRING([--with-mpris-test-client],[compile an MPRIS test client application])]) +# remember to include glib, below +AM_CONDITIONAL([USE_MPRIS_CLIENT], [test "x$with_mpris_test_client" = "xyes"]) + +if test "x$with_mpris_test_client" = "xyes" || test "x$with_dbus_test_client" = "xyes" || test "x$with_mpris_interface" = "xyes" || test "x$with_dbus_interface" = "xyes" ; then PKG_CHECK_MODULES([glib], [gio-unix-2.0 >= 2.30.0],[CFLAGS="${glib_CFLAGS} ${CFLAGS}" LIBS="${glib_LIBS} ${LIBS}"],[AC_MSG_ERROR(MPRIS client support requires the glib 2.0 library -- libglib2.0-dev suggested!)]) - ], ) -AM_CONDITIONAL([USE_MPRIS_CLIENT], [test "x$REQUESTED_MPRIS_CLIENT" = "x1"]) - -# Look for mqtt flag -AC_ARG_WITH(mqtt-client, [AS_HELP_STRING([--with-mqtt-client],[include a client for MQTT -- the Message Queuing Telemetry Transport protocol])], [ - AC_DEFINE([CONFIG_MQTT], 1, [Include a client for MQTT, the Message Queuing Telemetry Transport protocol]) - REQUESTED_MQTT=1 - AC_CHECK_LIB([mosquitto], [mosquitto_lib_init], , AC_MSG_ERROR(MQTT support requires the mosquitto library -- libmosquitto-dev suggested!)) - ],) -AM_CONDITIONAL([USE_MQTT], [test "x$REQUESTED_MQTT" = "x1"]) - -if test "x$REQUESTED_MQTT" = "x1" && test "x$with_avahi" = "xyes" ; then - AC_MSG_WARN([MQTT needs Avahi to allow remote control functionality. At present, only metadata publishing will be supported]) fi -if test "x$REQUESTED_MPRIS" = "x1" || test "x$REQUESTED_DBUS" = "x1" || test "x$REQUESTED_MQTT" = "x1"; then +# Look for mqtt flag +AC_ARG_WITH(mqtt-client, [AS_HELP_STRING([--with-mqtt-client],[include a client for MQTT -- the Message Queuing Telemetry Transport protocol])]) +if test "x$with_mqtt_client" = "xyes" ; then + AC_DEFINE([CONFIG_MQTT], 1, [Include a client for MQTT, the Message Queuing Telemetry Transport protocol]) + AC_CHECK_LIB([mosquitto], [mosquitto_lib_init], , AC_MSG_ERROR(MQTT support requires the mosquitto library -- libmosquitto-dev suggested!)) +fi +AM_CONDITIONAL([USE_MQTT], [test "x$with_mqtt_client" = "xyes"]) + +if test "x$with_mqtt_client" = "xyes" && test "x$with_avahi" != "xyes" ; then + AC_MSG_WARN([MQTT needs Avahi for remote control functionality. With the current configuration settings, only metadata publishing will be supported.]) +fi + +if test "x$with_mpris_interface" = "xyes" || test "x$with_dbus_interface" = "xyes" || test "x$with_mqtt_client" = "xyes" ; then REQUESTED_EXTENDED_METADATA_SUPPORT=1 AC_DEFINE([CONFIG_METADATA_HUB], 1, [Needed by the compiler.]) AC_DEFINE([CONFIG_DACP_CLIENT], 1, [Needed by the compiler.]) diff --git a/tests/configure_test.sh b/tests/configure_test.sh new file mode 100644 index 00000000..f1dccf9c --- /dev/null +++ b/tests/configure_test.sh @@ -0,0 +1,201 @@ +#!/bin/sh + +# These tests check that the requested configuration can be made and can be built +# In many cases it will check that the Shairport Sync configuration string +# contains or omits the relevant string +# If doesn't check for the presence or absence of products except +# when it checks for the configuration string + +# At present, it is Linux-only. +check_configuration_string_includes() +{ + echo -n " checking configuration string includes \"$1\"..." + ./shairport-sync -V | grep -q $1 + if [ "$?" -eq "1" ] ; then + echo "\nError: \"$1\" not included in configuration string" + exit 1 + fi + echo -n "ok" +} + +check_configuration_string_excludes() +{ + echo -n " checking configuration string excludes \"$1\"..." + ./shairport-sync -V | grep -q $1 + if [ "$?" -eq "0" ] ; then + echo "\nError: \"$1\" is unexpectedly included in the configuration string" + exit 1 + fi + echo -n "ok" +} +check_for_success() +{ + if [ "$2" = "x" ] ; then + A2="" + else + A2="$2" + fi + if [ "$3" = "x" ] ; then + A3="" + else + A3="$3" + fi + if [ "$4" = "x" ] ; then + A4="" + else + A4="$4" + fi + if [ "$5" = "x" ] ; then + A5="" + else + A5=$5 + fi + if [ "$1" = "x" -o "$1" = "x$A2" ] ; then + TESTCOUNT="$(expr "$TESTCOUNT" '+' '1')" + echo -n "Checking \"$A2\": " + echo -n "configuring..." + echo "./configure $A3 $A2" > $LOGFILE + ./configure $A3 $A2 >> $LOGFILE 2>&1 + if [ "$?" -eq "0" ] ; then + echo -n "ok making..." + echo "make clean" >> $LOGFILE + make clean >> $LOGFILE 2>&1 + echo "make -j $((`nproc`*2))" >> $LOGFILE + make -j $((`nproc`*2)) >> $LOGFILE 2>&1 + if [ "$?" -ne "0" ] ; then + echo "\nError at build step with arg \"$A2\"." + exit 1 + fi + echo -n "ok" + else + echo "\nError at configure step with arg \"$A2\"." + exit 1 + fi + if [ "$A4" != "" ] ; then + check_configuration_string_includes $A4 + fi + if [ "$A5" != "" ] ; then + check_configuration_string_excludes $A5 + fi + echo "." + fi +} + +check_for_configuration_fail() +{ + if [ "$1" = "x" -o "$1" = "x$2" ] ; then + echo -n "Checking \"$2\" fails during configuration... " + TESTCOUNT="$(expr "$TESTCOUNT" '+' '1')" + ./configure $3 $2 > $LOGFILE 2>&1 + if [ "$?" -eq "0" ] ; then + echo "\nError: configuration did not fail with arg \"$2\"." + exit 1 + fi + echo " done." + fi + return 0 +} + +echo -n "Preparing..." +LOGFILE=configure_test.log +CWD=`pwd` +cd .. +autoreconf -fi > $LOGFILE 2>&1 +if [ "$?" -ne "0" ] ; then + echo "\Error running \"autoreconf -fi\"" + exit 1 +fi +echo "ok." +TESTCOUNT=0 +check_for_success x$1 --with-pkg-config --with-ssl=mbedtls +check_for_success x$1 --with-ssl=openssl x OpenSSL +check_for_success x$1 --with-ssl=mbedtls x mbedTLS +check_for_success x$1 --with-ssl=polarssl x PolarSSL +check_for_configuration_fail x$1 --with-ssl +check_for_configuration_fail x$1 --without-ssl=openssl +check_for_configuration_fail x$1 --without-ssl=mbedtls +check_for_configuration_fail x$1 --without-ssl=polarssl +check_for_configuration_fail x$1 +check_for_success x$1 --with-alsa --with-ssl=mbedtls ALSA +check_for_success x$1 --without-alsa --with-ssl=mbedtls x ALSA + +check_for_success x$1 --with-dummy --with-ssl=mbedtls dummy +check_for_success x$1 --without-dummy --with-ssl=mbedtls x dummy + +check_for_success x$1 --with-stdout --with-ssl=mbedtls stdout +check_for_success x$1 --without-stdout --with-ssl=mbedtls x stdout + +check_for_success x$1 --with-pipe --with-ssl=mbedtls pipe +check_for_success x$1 --without-pipe --with-ssl=mbedtls x pipe + +check_for_success x$1 --with-external-mdns --with-ssl=mbedtls external_mdns +check_for_success x$1 --without-external-mdns --with-ssl=mbedtls x external_mdns + +check_for_success x$1 --with-apple-alac --with-ssl=mbedtls alac +check_for_success x$1 --without-apple-alac --with-ssl=mbedtls x alac + +check_for_success x$1 --with-piddir=/var --with-ssl=mbedtls +check_for_success x$1 --without-piddir --with-ssl=mbedtls + +check_for_success x$1 --with-libdaemon --with-ssl=mbedtls +check_for_success x$1 --without-libdaemon --with-ssl=mbedtls + +check_for_success x$1 --with-soxr --with-ssl=mbedtls soxr +check_for_success x$1 --without-soxr --with-ssl=mbedtls x soxr + +check_for_success x$1 --with-metadata --with-ssl=mbedtls metadata +check_for_success x$1 --without-metadata --with-ssl=mbedtls x metadata + +check_for_success x$1 --with-avahi --with-ssl=mbedtls Avahi +check_for_success x$1 --without-avahi --with-ssl=mbedtls x Avahi + +check_for_success x$1 --with-tinysvcmdns --with-ssl=mbedtls tinysvcmdns +check_for_success x$1 --without-tinysvcmdns --with-ssl=mbedtls x tinysvcmdns + +check_for_success x$1 --with-jack --with-ssl=mbedtls jack +check_for_success x$1 --without-jack --with-ssl=mbedtls x jack + +check_for_success x$1 --with-sndio --with-ssl=mbedtls sndio +check_for_success x$1 --without-sndio --with-ssl=mbedtls x sndio + +check_for_success x$1 --with-ao --with-ssl=mbedtls ao +check_for_success x$1 --without-ao --with-ssl=mbedtls x ao + +# the following is disabled because there is no soundio library for Raspberry OS +#check_for_success x$1 --with-soundio --with-ssl=mbedtls soundio +check_for_success x$1 --without-soundio --with-ssl=mbedtls x soundio + +check_for_success x$1 --with-pa --with-ssl=mbedtls pa +check_for_success x$1 --without-pa --with-ssl=mbedtls x pa + +check_for_success x$1 --with-convolution --with-ssl=mbedtls convolution +check_for_success x$1 --without-convolution --with-ssl=mbedtls x convolution + +check_for_success x$1 --with-dns_sd --with-ssl=mbedtls dns_sd +check_for_success x$1 --without-dns_sd --with-ssl=mbedtls x dns_sd + +check_for_success x$1 --with-dbus-interface --with-ssl=mbedtls metadata-dbus +check_for_success x$1 --without-dbus-interface --with-ssl=mbedtls x dbus + +check_for_success x$1 --with-dbus-test-client --with-ssl=mbedtls +check_for_success x$1 --without-dbus-test-client --with-ssl=mbedtls + +check_for_success x$1 --with-mpris-interface --with-ssl=mbedtls metadata-mpris +check_for_success x$1 --without-mpris-interface --with-ssl=mbedtls x mpris + +check_for_success x$1 --with-mpris-test-client --with-ssl=mbedtls +check_for_success x$1 --without-mpris-test-client --with-ssl=mbedtls + +check_for_success x$1 --with-mqtt-client --with-ssl=mbedtls metadata-mqtt +check_for_success x$1 --without-mqtt-client --with-ssl=mbedtls x mqtt + +check_for_success x$1 --with-configfiles '--sysconfdir=/etc --with-alsa --with-soxr --with-avahi --with-ssl=openssl --with-systemd' OpenSSL-Avahi-ALSA-soxr-sysconfdir:/etc +check_for_success x$1 --without-configfiles '--sysconfdir=/etc --with-alsa --with-soxr --with-avahi --with-ssl=openssl --with-systemd' OpenSSL-Avahi-ALSA-soxr-sysconfdir:/etc + +check_for_success x$1 --with-systemd '--sysconfdir=/etc --with-alsa --with-soxr --with-avahi --with-ssl=openssl' OpenSSL-Avahi-ALSA-soxr-sysconfdir:/etc +check_for_success x$1 --without-systemd '--sysconfdir=/etc --with-alsa --with-soxr --with-avahi --with-ssl=openssl' OpenSSL-Avahi-ALSA-soxr-sysconfdir:/etc +check_for_success x$1 --with-systemv '--sysconfdir=/etc --with-libdaemon --with-alsa --with-soxr --with-avahi --with-ssl=openssl' OpenSSL-Avahi-ALSA-soxr-sysconfdir:/etc +check_for_success x$1 --without-systemv '--sysconfdir=/etc --with-libdaemon --with-alsa --with-soxr --with-avahi --with-ssl=openssl' OpenSSL-Avahi-ALSA-soxr-sysconfdir:/etc + +cd $CWD +echo "$TESTCOUNT tests completed." \ No newline at end of file From 48295d48b0044eb1dc95daedce6ae6a1f83d0b04 Mon Sep 17 00:00:00 2001 From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Fri, 1 Jan 2021 19:26:13 +0000 Subject: [PATCH 8/9] Update RELEASENOTES-DEVELOPMENT.md --- RELEASENOTES-DEVELOPMENT.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/RELEASENOTES-DEVELOPMENT.md b/RELEASENOTES-DEVELOPMENT.md index 63422e8e..618edea6 100644 --- a/RELEASENOTES-DEVELOPMENT.md +++ b/RELEASENOTES-DEVELOPMENT.md @@ -1,3 +1,8 @@ +Version 3.3.8d4 +==== +**Bug Fixes** +* Fix a fault in the configuration script `configure.ac`. The fault was that a `--without-*` configuration argument was being misunderstood and interpreted partly as a `--with-*` argument. Thanks to [David Racine](https://github.com/bassdr) for the [report](https://github.com/mikebrady/shairport-sync/issues/1123). + Version 3.3.8d3 ==== **Enhancements** From 534ce8cd0689ec02c529c388636e8cd4033739e7 Mon Sep 17 00:00:00 2001 From: Emanuel Haupt Date: Fri, 1 Jan 2021 22:14:09 +0100 Subject: [PATCH 9/9] Add packaging status --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 5f92027c..1934009b 100644 --- a/README.md +++ b/README.md @@ -632,3 +632,7 @@ MQTT --------------- Please refer to the [MQTT INFO](https://github.com/mikebrady/shairport-sync/blob/master/MQTT.md) page for additional info on building, configuring and using MQTT to interface shairport-sync with common home automation systems (contributed by users). +Packaging status +---------------- + +[![Packaging status](https://repology.org/badge/vertical-allrepos/shairport-sync.svg)](https://repology.org/project/shairport-sync/versions)