tvheadend/configure

118 lines
2.1 KiB
Text
Raw Normal View History

#!/bin/bash
#
# Tvheadend configure script
#
# Copyright (c) 2012 Adam Sutton <dev@adamsutton.me.uk>
#
# ###########################################################################
# Setup
# ###########################################################################
ROOTDIR=$(dirname $0)
#
# Options
#
OPTIONS=(
"cwc:yes"
"v4l:yes"
"linuxdvb:yes"
"dvbscan:yes"
"avahi:auto"
"bundle:auto"
"zlib:auto"
)
2011-01-04 21:34:02 +01:00
#
# Begin
#
2011-01-04 21:34:02 +01:00
. $ROOTDIR/support/configure.inc
parse_args $*
2011-01-04 21:34:02 +01:00
# ###########################################################################
# Checks
# ###########################################################################
#
# Compiler
#
check_cc || die
check_cc_header execinfo
check_cc_option mmx
check_cc_option sse2
#
# SSL
#
if check_pkg openssl || check_pkg libssl; then
enable ssl
else
die "SSL development support not found"
fi
#
# Gzip
#
if enabled_or_auto zlib; then
if check_pkg zlib; then
enable zlib
elif enabled zlib; then
die "Zlib development support not found (use --disable-zlib)"
fi
fi
#
# Bundling
#
if enabled_or_auto bundle; then
if enabled zlib; then
enable bundle
elif enabled bundle; then
die "Zlib development support not found (use --disable-bundle)"
fi
fi
#
# Avahi
#
if enabled_or_auto avahi; then
if check_pkg avahi-client; then
enable avahi
elif enabled avahi; then
die "Avahi development support not found (use --disable-avahi)"
fi
fi
2009-03-30 17:10:22 +00:00
#
# DVB scan
2009-03-30 17:10:22 +00:00
#
if enabled linuxdvb && enabled dvbscan; then
if [ ! -d ${ROOTDIR}/data/dvb-scan ]; then
echo -n "Fetching dvb-scan files... "
${ROOTDIR}/support/getmuxlist &> /dev/null
echo "done"
fi
fi
# ###########################################################################
# Write config
# ###########################################################################
# Write config
write_config
cat >> ${CONFIG_H} <<EOF
#define TVHEADEND_DATADIR "$(eval echo ${datadir})/tvheadend"
EOF
# Output config
print_config
echo "Final Binary:"
echo " $BUILDDIR/tvheadend"
echo ""
echo "Tvheadend Data Directory:"
echo " $(eval echo ${datadir}/tvheadend)"
echo ""