libudev_disabled="== udev support disabled. Will use polling to check for device changes. =="
libusb_not_found="== Could not find libusb. Plug and play USB device support will not be available. =="
libusb_disabled="== libusb disabled. Plug and play USB device support will not be available. =="
-libcec_not_found="== Could not find libcec. CEC device support will not be available. =="
-libcec_disabled="== libcec disabled. CEC device support will not be available. =="
+libcec_enabled="== libCEC enabled. =="
+libcec_disabled="== libCEC disabled. CEC adapter support will not be available. =="
+libcec_internal="== Using internal libCEC. =="
+libcec_external_missing="== libCEC was not found on your system. =="
# External library message strings
external_libraries_enabled="== Use of all supported external libraries enabled. =="
AC_ARG_ENABLE([libcec],
[AS_HELP_STRING([--enable-libcec],
- [enable libcec support (default is auto)])],
+ [enable libcec support (default is yes)])],
[use_libcec=$enableval],
- [use_libcec=auto])
+ [use_libcec=yes])
### External libraries options
AC_ARG_ENABLE([external-libraries],
[use_external_libraries=$enableval],
[use_external_libraries=no])
+AC_ARG_ENABLE([external-libcec],
+ [AS_HELP_STRING([--enable-external-libcec],
+ [external libcec support (default is no) 'Linux only'])],
+ [use_external_libcec=$enableval],
+ [use_external_libcec=no])
+
AC_ARG_ENABLE([external-ffmpeg],
[AS_HELP_STRING([--enable-external-ffmpeg],
[enable use of external ffmpeg libraries (default is no) 'Linux only'])],
# libcec
USE_LIBCEC=0
-if test "$use_libcec" = "auto"; then
- PKG_CHECK_MODULES([CEC], [libcec],
- use_libcec="yes"; USE_LIBCEC=1; [INCLUDES="$INCLUDES $CEC_CFLAGS"; LIBS="$LIBS $CEC_LIBS";] \
- AC_DEFINE([HAVE_LIBCEC],[1],["Define to 1 if libcec is installed"]),
- use_libcec="no"; AC_MSG_RESULT($libcec_not_found))
-elif test "$use_libcec" = "yes"; then
- PKG_CHECK_MODULES([CEC], [libcec],
- use_libcec="yes"; USE_LIBCEC=1; [INCLUDES="$INCLUDES $CEC_CFLAGS"; LIBS="$LIBS $CEC_LIBS";] \
- AC_DEFINE([HAVE_LIBCEC],[1],["Define to 1 if libcec is installed"]),
- use_libcec="no"; AC_MSG_ERROR($libcec_not_found))
+if test "$use_libcec" = "yes"; then
+ USE_LIBCEC=1; AC_DEFINE([HAVE_LIBCEC],[1],["Define to 1 if libCEC is installed"])
+ AC_MSG_NOTICE($libcec_enabled)
else
use_libcec="no"
AC_MSG_NOTICE($libcec_disabled)
fi
### External libraries checks
+
+# external libcec
+USE_EXTERNAL_LIBCEC=0
+if test "$use_external_libcec" = "yes"; then
+ USE_EXTERNAL_LIBCEC=1; PKG_CHECK_MODULES([CEC], [libcec],
+ [INCLUDES="$INCLUDES $CEC_CFLAGS"; LIBS="$LIBS $CEC_LIBS"],
+ AC_MSG_ERROR($libcec_external_missing))
+elif test "$use_libcec" = "yes"; then
+ [INCLUDES="$INCLUDES -I\$(abs_top_srcdir)/lib/libcec/include"]
+ AC_MSG_NOTICE($libcec_internal)
+fi
+
# External FFmpeg
if test "$use_external_ffmpeg" = "yes"; then
FFMPEG_LIBNAMES="libavcodec libavfilter libavformat libavutil libpostproc libswscale"
final_message="$final_message\n libcec support:\tNo"
fi
+if test "$use_libcec" = "yes"; then
+ final_message="$final_message\n libCEC support:\tYes"
+else
+ final_message="$final_message\n libCEC support:\tNo"
+fi
+
### External libraries messages
+if test "$use_external_libcec" = "yes"; then
+ final_message="$final_message\n External libCEC:\tYes"
+else
+ final_message="$final_message\n External libCEC:\tNo"
+fi
+
if test "$use_external_ffmpeg" = "yes"; then
final_message="$final_message\n External FFmpeg:\tYes"
else
tools/TexturePacker/Makefile \
tools/EventClients/Clients/OSXRemote/Makefile \
xbmc/peripherals/bus/Makefile \
- xbmc/peripherals/devices/Makefile"
+ xbmc/peripherals/devices/Makefile \
+ lib/libcec/Makefile"
# Line below is used so we can use AM_INIT_AUTOMAKE. The corresponding
# .dummy.am does nothing.
AC_SUBST(USE_LIBUDEV)
AC_SUBST(USE_LIBUSB)
AC_SUBST(USE_LIBCEC)
+AC_SUBST(USE_EXTERNAL_LIBCEC)
# pushd and popd are not available in other shells besides bash, so implement
# our own pushd/popd functions
#LDFLAGS="$LDFLAGS -Wl,-read_only_relocs,suppress"
], [0])
+XB_CONFIG_MODULE([lib/libcec], [
+ if test "$use_libcec" = "yes" ; then
+ cd libcec ; ./configure \
+ --prefix="${prefix}" --includedir="${includedir}" --libdir="${libdir}" --datadir="${datadir}" \
+ --host=$host_alias \
+ --build=$build_alias \
+ --target=$target_alias CFLAGS="$CFLAGS" CC="$CC" CXX="$CXX"
+ fi
+], [0])
+
AC_OUTPUT
final_message="$final_message\n prefix:\t$prefix\n$dashes"
--- /dev/null
+# Download and build libCEC
+#
+# Usage:
+# make download
+# make bootstrap
+# make configure
+# make
+
+# lib name, version
+LIBNAME=libcec
+VERSION=0.6
+ARCHIVE=$(LIBNAME)-$(VERSION)
+
+# download location and format
+ARCHIVE_BASE_URL=http://github.com/Pulse-Eight/$(LIBNAME)/tarball/
+ARCHIVE_EXTRACTED_DIR=Pulse-Eight-libcec-d9ba5be
+ARCHIVE_URL=$(ARCHIVE_BASE_URL)$(ARCHIVE)
+ARCHIVE_TOOL=tar
+ARCHIVE_TOOL_FLAGS=xf
+ARCHIVE_ADD_EXTENSION=.tar.gz
+RETRIEVE_TOOL=/usr/bin/curl
+RETRIEVE_TOOL_FLAGS=-Ls --create-dirs --output $(ARCHIVE)$(ARCHIVE_ADD_EXTENSION)
+
+# configuration
+PREFIX ?= @abs_top_srcdir@/lib/libcec
+LIBCEC_CONFIGOPTS ?= --prefix=$(PREFIX)
+CONFIGURE=./configure CFLAGS=-D_FILE_OFFSET_BITS=64 $(LIBCEC_CONFIGOPTS)
+
+all: libcec.a
+
+download: distclean
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(ARCHIVE_URL)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(ARCHIVE)$(ARCHIVE_ADD_EXTENSION)
+ rm -f $(ARCHIVE)$(ARCHIVE_ADD_EXTENSION)
+ mv $(ARCHIVE_EXTRACTED_DIR) $(LIBNAME)
+ mkdir -p include/libcec
+ cp $(LIBNAME)/include/* include/libcec
+
+libcec.a:
+ make -C $(LIBNAME)
+ cp $(LIBNAME)/src/lib/.libs/libcec.a libcec.a
+
+clean:
+ rm -f libcec.a
+ make -C $(LIBNAME) clean
+
+distclean:
+ rm -f $(ARCHIVE) libcec.a Makefile
+ rm -rf include
+ rm -rf $(LIBNAME)
+ rm -rf $(ARCHIVE_DIR)