diff options
author | gimli <ebsi4711@gmail.com> | 2012-08-10 22:29:10 +0200 |
---|---|---|
committer | gimli <ebsi4711@gmail.com> | 2012-08-10 22:29:10 +0200 |
commit | 9787d5762ed552fb75f4d238a51a1a7b3b92b978 (patch) | |
tree | 49be54c91b977feec8e67c8cae3f17b8a415996e /configure.in | |
parent | 6b37a4c8ec605689aee9b8625aec0c41764f21b4 (diff) |
[rbp] cec: added support for the Raspberry Pi. needs libCEC v1.8.0+. other targets are still supported by libCEC 1.7.0
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 93 |
1 files changed, 89 insertions, 4 deletions
diff --git a/configure.in b/configure.in index 05527c015e..4cc7abb78b 100644 --- a/configure.in +++ b/configure.in @@ -154,7 +154,8 @@ libusb_disabled="== libusb disabled. Plug and play USB device support will not b libusb_disabled_udev_found="== libusb disabled. ==" libcec_enabled="== libcec enabled. ==" libcec_disabled="== libcec disabled. CEC adapter support will not be available. ==" -libcec_disabled_missing_libs="== libcec disabled because both libudev and libusb are not available. CEC adapter support will not be available. ==" +libcec_disabled_missing_libs="== libcec disabled because it either needs libudev, or libusb a compatible version of the RPi API. CEC adapter support will not be available. ==" +cec_rpi_api_missing="== no compatible RPi API found ==" # External library message strings external_libraries_enabled="== Use of all supported external libraries enabled. ==" @@ -461,6 +462,12 @@ AC_ARG_ENABLE([libcec], [use_libcec=$enableval], [use_libcec=auto]) +AC_ARG_ENABLE([rpi-cec-api], + [AS_HELP_STRING([--enable-rpi-cec-api], + [enable support for the Raspberry Pi (default is auto)])], + [use_rpi_cec_api=$enableval], + [use_rpi_cec_api=auto]) + AC_ARG_ENABLE([libmp3lame], [AS_HELP_STRING([--enable-libmp3lame], [enable lame mp3 encoder support (default is auto)])], @@ -1398,9 +1405,65 @@ fi # libcec USE_LIBCEC=0 +USE_CEC_RPI_API=0 if test "x$use_libcec" != "xno"; then - # libcec needs libudev or libusb under linux, or the device will never be detected. - if test "$host_vendor" != "apple" && test "$use_libusb" = "no" && test "$use_libudev" = "no"; then + case "${host_cpu}" in + arm*) + echo "will check for RPi support" + ;; + *) + echo "will not check for RPi support (unsupported cpu: ${host_cpu})" + use_rpi_cec_api="no" + ;; + esac + + if test "x$use_rpi_cec_api" != "xno"; then + if test "x$use_rpi_cec_api" = "xyes"; then + AC_CHECK_HEADER(interface/vmcs_host/vc_cec.h,, + AC_MSG_ERROR($cec_rpi_api_missing)) + else + AC_CHECK_HEADER(interface/vmcs_host/vc_cec.h,, + use_rpi_cec_api="no") + fi + + if test "x$use_rpi_cec_api" != "xno"; then + # check if the headers contain support for libCEC + AC_MSG_CHECKING([interface/vmcs_host/vc_cec.h compatibility]) + + check_rpi_cec_service="yes" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <interface/vmcs_host/vc_cecservice.h> +#include <interface/vchiq_arm/vchiq_if.h> +#if !defined(VC_CECSERVICE_VER) +#error RPi headers doesn't contain libCEC support +#endif]], [[]])],[AC_MSG_RESULT([yes])],[check_rpi_cec_service="no"; AC_MSG_RESULT([no])]) + + if test "x$check_rpi_cec_service" != "xyes" && test "x$use_rpi_cec_api" = "xyes"; then + AC_MSG_ERROR($cec_rpi_api_missing) + fi + + if test "x$check_rpi_cec_service" != "xyes"; then + use_rpi_cec_api="no" + fi + fi + + if test "x$use_rpi_cec_api" != "xno"; then + # check for vc_cec_poll_address, to ensure that we got the correct version of bcm_host that supports libCEC + if test "x$use_rpi_cec_api" = "xyes"; then + AC_CHECK_LIB(bcm_host,vc_cec_poll_address,, + AC_MSG_ERROR($cec_rpi_api_missing),-lvcos -lvchiq_arm) + else + AC_CHECK_LIB(bcm_host,vc_cec_poll_address,, + use_rpi_cec_api="no",-lvcos -lvchiq_arm) + fi + fi + + if test "x$use_rpi_cec_api" != "xno"; then + LIBS+=" -lvcos -lvchiq_arm" + fi + fi + + # libcec needs libudev, libusb or the RPi API under linux, or the device will never be detected. + if test "$host_vendor" != "apple" && test "$use_libusb" = "no" && test "$use_libudev" = "no" && test "$use_rpi_cec_api" = "no"; then if test "x$use_libcec" != "xauto"; then AC_MSG_ERROR($libcec_disabled_missing_libs) else @@ -1411,11 +1474,27 @@ if test "x$use_libcec" != "xno"; then # libcec is dyloaded, so we need to check for its headers and link any depends. if test "x$use_libcec" != "xno"; then - PKG_CHECK_MODULES([CEC],[libcec >= 1.7.0],,[use_libcec="no";AC_MSG_RESULT($libcec_disabled)]) + if test "x$use_libcec" != "xauto"; then + if test "x$use_rpi_cec_api" != "xno"; then + PKG_CHECK_MODULES([CEC],[libcec >= 1.8.0],,[use_libcec="no";AC_MSG_ERROR($libcec_disabled)]) + else + PKG_CHECK_MODULES([CEC],[libcec >= 1.7.0],,[use_libcec="no";AC_MSG_ERROR($libcec_disabled)]) + fi + else + if test "x$use_rpi_cec_api" != "xno"; then + PKG_CHECK_MODULES([CEC],[libcec >= 1.8.0],,[use_libcec="no";AC_MSG_RESULT($libcec_disabled)]) + else + PKG_CHECK_MODULES([CEC],[libcec >= 1.7.0],,[use_libcec="no";AC_MSG_RESULT($libcec_disabled)]) + fi + fi if test "x$use_libcec" != "xno"; then INCLUDES="$INCLUDES $CEC_CFLAGS" USE_LIBCEC=1;AC_DEFINE([HAVE_LIBCEC],[1],["Define to 1 if libcec is installed"]) + if test "x$use_rpi_cec_api" != "xno"; then + AC_DEFINE([HAVE_CEC_RPI_API],[1],["Define to 1 if the CEC RPi API is installed"]) + USE_CEC_RPI_API=1 + fi XB_FIND_SONAME([LIBCEC],[cec],[use_libcec]) AC_MSG_NOTICE($libcec_enabled) else @@ -2107,6 +2186,11 @@ fi if test "x$use_libcec" != "xno"; then final_message="$final_message\n libcec support:\tYes" + if test "x$use_rpi_cec_api" != "xno"; then + final_message="$final_message\n libcec RPi support:\tYes" + else + final_message="$final_message\n libcec RPi support:\tNo" + fi else final_message="$final_message\n libcec support:\tNo" fi @@ -2283,6 +2367,7 @@ AC_SUBST(USE_AIRTUNES) AC_SUBST(USE_LIBUDEV) AC_SUBST(USE_LIBUSB) AC_SUBST(USE_LIBCEC) +AC_SUBST(USE_CEC_RPI_API) AC_SUBST(USE_MYSQL) AC_SUBST(USE_WEB_SERVER) AC_SUBST(USE_ANDROID) |