configure: Do not unconditionally check for (and enable) xlib

This avoids unnecessarily linking against xlib.
This commit is contained in:
Diego Biurrun
2016-11-07 20:22:14 +01:00
parent d1a91ebe49
commit fe7bc1f16a

15
configure vendored
View File

@@ -4778,8 +4778,6 @@ if enabled libcdio; then
die "ERROR: No usable libcdio/cdparanoia found" die "ERROR: No usable libcdio/cdparanoia found"
fi fi
check_lib X11/Xlib.h XOpenDisplay -lX11 && enable xlib
if enabled libxcb; then if enabled libxcb; then
check_pkg_config xcb-shape xcb/shape.h xcb_shape_rectangles || { check_pkg_config xcb-shape xcb/shape.h xcb_shape_rectangles || {
enabled libxcb && die "ERROR: libxcb not found"; enabled libxcb && die "ERROR: libxcb not found";
@@ -4805,19 +4803,20 @@ enabled vaapi &&
check_code cc "va/va.h" "vaCreateSurfaces(0, 0, 0, 0, 0, 0, 0, 0)" || check_code cc "va/va.h" "vaCreateSurfaces(0, 0, 0, 0, 0, 0, 0, 0)" ||
disable vaapi disable vaapi
if enabled vaapi ; then enabled vaapi &&
enabled xlib &&
check_lib "va/va.h va/va_x11.h" vaGetDisplay -lva -lva-x11 &&
enable vaapi_x11
check_lib "va/va.h va/va_drm.h" vaGetDisplayDRM -lva -lva-drm && check_lib "va/va.h va/va_drm.h" vaGetDisplayDRM -lva -lva-drm &&
enable vaapi_drm enable vaapi_drm
fi
enabled vdpau && enabled vdpau &&
check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" || check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
disable vdpau disable vdpau
enabled_any vaapi vdpau && check_lib X11/Xlib.h XOpenDisplay -lX11 && enable xlib
enabled vaapi && enabled xlib &&
check_lib "va/va.h va/va_x11.h" vaGetDisplay -lva -lva-x11 &&
enable vaapi_x11
enabled vdpau && enabled xlib && enabled vdpau && enabled xlib &&
check_lib "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau && check_lib "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau &&
enable vdpau_x11 enable vdpau_x11