diff options
author | Max Kellermann <max@duempel.org> | 2015-05-05 18:45:51 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-05-26 09:55:19 +0200 |
commit | 5802f51eca8e3a7b7866a0cfa86ff2cf7a028c9e (patch) | |
tree | 7c0cd6018b95388937c8fbb1f4af3970e9d36ede /configure.ac | |
parent | b1e80a967c48adcf8282ead98e3a57e80045f2fc (diff) |
configure.ac: simplify $host_vendor=apple special cases
Instead of adding an "apple" check to each library check that is known
to be unsupported on "apple", disable all those features in the
beginning. This simplifies the library checking code by removing
unnecessary clutter.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 138 |
1 files changed, 60 insertions, 78 deletions
diff --git a/configure.ac b/configure.ac index 760e8737e4..3810fe86ec 100644 --- a/configure.ac +++ b/configure.ac @@ -753,6 +753,7 @@ case $use_platform in use_arch="arm" use_cpu=arm1176jzf-s use_hardcoded_tables="yes" + use_openmax=no ARCH="arm" AC_DEFINE(HAS_EGLGLES, [1], [Define if supporting EGL based GLES Framebuffer]) USE_OMXLIB=1; AC_DEFINE([HAVE_OMXLIB],[1],["Define to 1 if OMX libs is enabled"]) @@ -762,6 +763,17 @@ case $use_platform in ;; esac +if test "$host_vendor" = "apple"; then + use_avahi=no + use_alsa=no + use_openmax=no + use_goom=no + use_libudev=no + use_libusb=no + use_x11=no + use_wayland=no +fi + XBMC_SETUP_ARCH_DEFINES() # detect soname version @@ -975,7 +987,7 @@ else fi # Wayland -if test "$use_wayland" = "yes" && test "$host_vendor" != "apple"; then +if test "$use_wayland" = "yes"; then AC_MSG_NOTICE($wayland_enabled) PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client], [INCLUDES="$INCLUDES $WAYLAND_CLIENT_CFLAGS"; @@ -1318,7 +1330,7 @@ if test "$use_optical_drive" = "yes"; then fi # Alsa -if test "$use_alsa" = "yes" && test "$host_vendor" != "apple"; then +if test "$use_alsa" = "yes"; then PKG_CHECK_MODULES([ALSA], [alsa], [INCLUDES="$INCLUDES $ALSA_CFLAGS"; LIBS="$LIBS $ALSA_LIBS"], AC_MSG_ERROR($missing_library)) @@ -1359,21 +1371,16 @@ else fi # avahi -if test "$host_vendor" = "apple" ; then - use_avahi="no" - AC_MSG_RESULT($avahi_disabled) -else +if test "$use_avahi" = "yes"; then + AC_CHECK_LIB([avahi-common], [main],, + use_avahi=no;AC_MSG_RESULT($avahi_not_found)) if test "$use_avahi" = "yes"; then - AC_CHECK_LIB([avahi-common], [main],, + #either both libs or none + AC_CHECK_LIB([avahi-client], [main],, use_avahi=no;AC_MSG_RESULT($avahi_not_found)) - if test "$use_avahi" = "yes"; then - #either both libs or none - AC_CHECK_LIB([avahi-client], [main],, - use_avahi=no;AC_MSG_RESULT($avahi_not_found)) - fi - else - AC_MSG_RESULT($avahi_disabled) fi +else + AC_MSG_RESULT($avahi_disabled) fi # mdnsembedded @@ -1398,7 +1405,7 @@ fi AC_SUBST(USE_MDNSEMBEDDED) # X11 -if test "$use_x11" = "yes" && test "$host_vendor" != "apple"; then +if test "$use_x11" = "yes"; then AC_MSG_NOTICE($x11_enabled) PKG_CHECK_MODULES([X11], [x11], [INCLUDES="$INCLUDES $X11_CFLAGS"; LIBS="$LIBS $X11_LIBS"], @@ -1415,7 +1422,7 @@ else fi # XRandR -if test "$host_vendor" = "apple" || test "$use_x11" = "no"; then +if test "$use_x11" = "no"; then use_xrandr="no" AC_MSG_RESULT($xrandr_disabled) else @@ -1446,17 +1453,12 @@ else fi # GOOM -if test "$host_vendor" = "apple" ; then +if test "$use_goom" = "yes" && test "$use_gl" = "yes"; then + AC_MSG_NOTICE($goom_enabled) + DISABLE_GOOM=0 +else AC_MSG_NOTICE($goom_disabled) DISABLE_GOOM=1 -else - if test "$use_goom" = "yes" && test "$use_gl" = "yes"; then - AC_MSG_NOTICE($goom_enabled) - DISABLE_GOOM=0 - else - AC_MSG_NOTICE($goom_disabled) - DISABLE_GOOM=1 - fi fi # RSXS @@ -1622,22 +1624,17 @@ fi # libudev USE_LIBUDEV=0 -if test "$host_vendor" = "apple" ; then - use_libudev="no" - AC_MSG_NOTICE($libudev_disabled) +if test "$use_libudev" = "auto"; then + PKG_CHECK_MODULES([UDEV],[libudev],,[use_libudev="no";AC_MSG_RESULT($libudev_not_found)]) +elif test "$use_libudev" = "yes" ; then + PKG_CHECK_MODULES([UDEV],[libudev],,[use_libudev="no";AC_MSG_ERROR($libudev_not_found)]) else - if test "$use_libudev" = "auto"; then - PKG_CHECK_MODULES([UDEV],[libudev],,[use_libudev="no";AC_MSG_RESULT($libudev_not_found)]) - elif test "$use_libudev" = "yes" ; then - PKG_CHECK_MODULES([UDEV],[libudev],,[use_libudev="no";AC_MSG_ERROR($libudev_not_found)]) - else - AC_MSG_NOTICE($libudev_disabled) - fi + AC_MSG_NOTICE($libudev_disabled) +fi - if test "x$use_libudev" != "xno"; then - USE_LIBUDEV=1;INCLUDES="$INCLUDES $UDEV_CFLAGS";LIBS="$LIBS $UDEV_LIBS" - AC_DEFINE([HAVE_LIBUDEV],[1],["Define to 1 if libudev is installed"]) - fi +if test "x$use_libudev" != "xno"; then + USE_LIBUDEV=1;INCLUDES="$INCLUDES $UDEV_CFLAGS";LIBS="$LIBS $UDEV_LIBS" + AC_DEFINE([HAVE_LIBUDEV],[1],["Define to 1 if libudev is installed"]) fi # libusb @@ -1648,26 +1645,21 @@ if test "x$use_libudev" != "xno"; then use_libusb="no" AC_MSG_NOTICE($libusb_disabled_udev_found) else - if test "$host_vendor" = "apple" ; then - use_libusb="no" - AC_MSG_NOTICE($libusb_disabled) - else - if echo "$ARCH" | grep -q freebsd ; then - AC_CHECK_LIB([usb],[main], + if echo "$ARCH" | grep -q freebsd ; then + AC_CHECK_LIB([usb],[main], [use_libusb="yes";USB_LIBS="-lusb"], [use_libusb="no";AC_MSG_RESULT($libusb_not_found)]) - elif test "$use_libusb" = "auto"; then - PKG_CHECK_MODULES([USB],[libusb],,[use_libusb="no";AC_MSG_RESULT($libusb_not_found)]) - elif test "$use_libusb" = "yes"; then - PKG_CHECK_MODULES([USB],[libusb],,[use_libusb="no";AC_MSG_ERROR($libusb_not_found)]) - else - AC_MSG_NOTICE($libusb_disabled) - fi - - if test "x$use_libusb" != "xno"; then - USE_LIBUSB=1;INCLUDES="$INCLUDES $USB_CFLAGS";LIBS="$LIBS $USB_LIBS" - AC_DEFINE([HAVE_LIBUSB],[1],["Define to 1 if libusb is installed"]) - fi + elif test "$use_libusb" = "auto"; then + PKG_CHECK_MODULES([USB],[libusb],,[use_libusb="no";AC_MSG_RESULT($libusb_not_found)]) + elif test "$use_libusb" = "yes"; then + PKG_CHECK_MODULES([USB],[libusb],,[use_libusb="no";AC_MSG_ERROR($libusb_not_found)]) + else + AC_MSG_NOTICE($libusb_disabled) + fi + + if test "x$use_libusb" != "xno"; then + USE_LIBUSB=1;INCLUDES="$INCLUDES $USB_CFLAGS";LIBS="$LIBS $USB_LIBS" + AC_DEFINE([HAVE_LIBUSB],[1],["Define to 1 if libusb is installed"]) fi fi @@ -1930,29 +1922,19 @@ else fi # OpenMax -if test "$host_vendor" = "apple" ; then - use_openmax="no" - USE_OPENMAX=0 +if test "$use_gles" = "yes" && test "$use_openmax" = "auto"; then + + AC_CHECK_HEADERS([OMX_Core.h], + USE_OPENMAX=1;[INCLUDES="$INCLUDES $OPENMAX_CFLAGS"; LIBS="$LIBS $OPENMAX_LIBS";AC_DEFINE([HAVE_LIBOPENMAX], [1], [Define to 1 if you have the OpenMax library.])], + use_openmax=no;USE_OPENMAX=0;AC_MSG_RESULT($openmax_not_found)) +elif test "$use_gles" = "yes" && test "$use_openmax" = "yes"; then + AC_CHECK_HEADERS([OMX_Core.h], + USE_OPENMAX=1;[INCLUDES="$INCLUDES $OPENMAX_CFLAGS"; LIBS="$LIBS $OPENMAX_LIBS";AC_DEFINE([HAVE_LIBOPENMAX], [1], [Define to 1 if you have the OpenMax library.])], + AC_MSG_ERROR($openmax_not_found)) +else AC_MSG_NOTICE($openmax_disabled) -elif test "$target_platform" = "target_raspberry_pi"; then - use_openmax="no" + use_openmax=no USE_OPENMAX=0 - AC_MSG_NOTICE($openmax_disabled) -else - if test "$use_gles" = "yes" && test "$use_openmax" = "auto"; then - - AC_CHECK_HEADERS([OMX_Core.h], - USE_OPENMAX=1;[INCLUDES="$INCLUDES $OPENMAX_CFLAGS"; LIBS="$LIBS $OPENMAX_LIBS";AC_DEFINE([HAVE_LIBOPENMAX], [1], [Define to 1 if you have the OpenMax library.])], - use_openmax=no;USE_OPENMAX=0;AC_MSG_RESULT($openmax_not_found)) - elif test "$use_gles" = "yes" && test "$use_openmax" = "yes"; then - AC_CHECK_HEADERS([OMX_Core.h], - USE_OPENMAX=1;[INCLUDES="$INCLUDES $OPENMAX_CFLAGS"; LIBS="$LIBS $OPENMAX_LIBS";AC_DEFINE([HAVE_LIBOPENMAX], [1], [Define to 1 if you have the OpenMax library.])], - AC_MSG_ERROR($openmax_not_found)) - else - AC_MSG_NOTICE($openmax_disabled) - use_openmax=no - USE_OPENMAX=0 - fi fi # additional internal players |