Files
shairport-sync/configure
T
Paul LietarandJames Laird ce77feecef Add a new mDNS backend which uses mDNSResponder
This backend uses mDNSResponder, like the external-dns-sd one. However,
this one uses the dns-sd library instead of relying on an external
program.
2013-10-22 10:33:41 +11:00

68 lines
1.8 KiB
Bash
Executable File

#!/bin/sh
echo Configuring Shairport
rm -f config.mk config.h
echo "// automatically generated file" > config.h
LDFLAGS="${LDFLAGS} -lm -lpthread"
if make -f Makefile.tests test_getopt > /dev/null 2>&1; then
echo "getopt.h found"
echo "#define CONFIG_HAVE_GETOPT_H" >> config.h
echo "CONFIG_HAVE_GETOPT_H=yes" >> config.mk
else
echo "getopt.h not found (or compiler broken), using our own getopt_long."
fi
if make -f Makefile.tests test_dns_sd > /dev/null 2>&1; then
echo "dns_sd.h found"
echo "#define CONFIG_HAVE_DNS_SD_H" >> config.h
echo "CONFIG_HAVE_DNS_SD_H=yes" >> config.mk
else
echo "dns_sd.h not found"
fi
# check for and use pkg-config package $2 with CONFIG_ var $3
do_pkg_config()
{
if pkg-config $2 2>/dev/null; then
CFLAGS="${CFLAGS} `pkg-config --cflags $2`"
LDFLAGS="${LDFLAGS} `pkg-config --libs $2`"
if [ "$3" ]; then
echo "#define $3" >> config.h
echo "$3=yes" >> config.mk
fi
echo "$1 found"
else
echo "$1 or its dev package not found"
if [ ! "$3" ]; then
echo "Required package not found, cannot continue"
rm -f config.mk config.h
exit 1
fi
fi
}
do_pkg_config OpenSSL openssl
do_pkg_config libao ao CONFIG_AO
do_pkg_config PulseAudio libpulse-simple CONFIG_PULSE
do_pkg_config ALSA alsa CONFIG_ALSA
do_pkg_config Avahi\ client avahi-client CONFIG_AVAHI
if [ `uname` = 'OpenBSD' ]; then
echo "OpenBSD machine, use sndio"
echo "#define CONFIG_SNDIO" >> config.h
echo "CONFIG_SNDIO=yes" >> config.mk
LDFLAGS="${LDFLAGS} -lsndio"
fi
echo "CFLAGS+=${CFLAGS}" >> config.mk
echo "LDFLAGS+=${LDFLAGS}" >> config.mk
echo CFLAGS: ${CFLAGS}
echo LDFLAGS: ${LDFLAGS}
echo "Configure successful. You may now build with 'make'"