kumquat-buildroot/package/libdrm/libdrm.mk

118 lines
2.4 KiB
Makefile
Raw Normal View History

################################################################################
#
# libdrm
#
################################################################################
LIBDRM_VERSION = 2.4.107
LIBDRM_SOURCE = libdrm-$(LIBDRM_VERSION).tar.xz
LIBDRM_SITE = https://dri.freedesktop.org/libdrm
LIBDRM_LICENSE = MIT
LIBDRM_LICENSE_FILES = xf86drm.c
LIBDRM_INSTALL_STAGING = YES
LIBDRM_DEPENDENCIES = \
libpthread-stubs \
host-pkgconf
LIBDRM_CONF_OPTS = \
-Dcairo-tests=false \
-Dman-pages=false
libdrm: improve atomic handling, fix SPARCv8 build This commit improves the handling of the "atomic stuff" in the libdrm package. libdrm can either use the atomic intrinsics (4 byte variant) when available, or otherwise can use libatomic_ops. Note that the dependency on atomic operations is not from libdrm itself, but only from some specific DRM drivers only. Amongst other things, it fixes the build of the libdrm package on SPARCv8, therefore fixing: http://autobuild.buildroot.org/results/74dd29b5ea146c320fde80a87a2fc910de9b7f60/ This commit does a number of changes that are all related to each other: - Removes the dependency of the Intel DRM driver on libatomic_ops. The Intel DRM driver builds perfectly fine without libatomic_ops, as long as 4-byte variant __sync operations are available, which is always the case on x86 and x86_84 (which are the only architectures on which the Intel DRM driver can be enabled). - Adds an hidden Config.in boolean option BR2_PACKAGE_LIBDRM_HAS_ATOMIC that allows DRM driver that need atomic operation to know whether atomic support is available (either through intrinsics or through libatomic_ops). - Adds an hidden BR2_PACKAGE_LIBDRM_ENABLE_ATOMIC Config.in option that DRM drivers that need atomic operation should select to ensure that the relevant dependencies are selected. It simply selects libatomic_ops if 4-byte atomic intrinsics are not available. We could let each DRM driver do this, but having an intermediate option avoids a bit of duplication. - Adds a patch that defines AO_REQUIRE_CAS before including <atomic_ops.h>. This is needed because libdrm uses the AO_compare_and_swap_full() which is only provided on all architectures when AO_REQUIRE_CAS is defined. The exact same fix was done in the erlang package in commit 4a9df2942470241d7a96f326f0e7012aacd36f2e. - Adds the dependency on libatomic_ops when the package is enabled, and passes the necessary CFLAGS on SPARCv8 to make the thing build properly. The same CFLAGS are passed in the nginx package and bdwgc package. Cc: Waldemar Brodkorb <wbx@openadk.org> Cc: Bernd Kuhls <bernd.kuhls@t-online.de> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-05-26 12:53:16 +02:00
ifeq ($(BR2_PACKAGE_LIBATOMIC_OPS),y)
LIBDRM_DEPENDENCIES += libatomic_ops
ifeq ($(BR2_sparc_v8)$(BR2_sparc_leon3),y)
LIBDRM_CFLAGS = $(TARGET_CFLAGS) -DAO_NO_SPARC_V9
libdrm: improve atomic handling, fix SPARCv8 build This commit improves the handling of the "atomic stuff" in the libdrm package. libdrm can either use the atomic intrinsics (4 byte variant) when available, or otherwise can use libatomic_ops. Note that the dependency on atomic operations is not from libdrm itself, but only from some specific DRM drivers only. Amongst other things, it fixes the build of the libdrm package on SPARCv8, therefore fixing: http://autobuild.buildroot.org/results/74dd29b5ea146c320fde80a87a2fc910de9b7f60/ This commit does a number of changes that are all related to each other: - Removes the dependency of the Intel DRM driver on libatomic_ops. The Intel DRM driver builds perfectly fine without libatomic_ops, as long as 4-byte variant __sync operations are available, which is always the case on x86 and x86_84 (which are the only architectures on which the Intel DRM driver can be enabled). - Adds an hidden Config.in boolean option BR2_PACKAGE_LIBDRM_HAS_ATOMIC that allows DRM driver that need atomic operation to know whether atomic support is available (either through intrinsics or through libatomic_ops). - Adds an hidden BR2_PACKAGE_LIBDRM_ENABLE_ATOMIC Config.in option that DRM drivers that need atomic operation should select to ensure that the relevant dependencies are selected. It simply selects libatomic_ops if 4-byte atomic intrinsics are not available. We could let each DRM driver do this, but having an intermediate option avoids a bit of duplication. - Adds a patch that defines AO_REQUIRE_CAS before including <atomic_ops.h>. This is needed because libdrm uses the AO_compare_and_swap_full() which is only provided on all architectures when AO_REQUIRE_CAS is defined. The exact same fix was done in the erlang package in commit 4a9df2942470241d7a96f326f0e7012aacd36f2e. - Adds the dependency on libatomic_ops when the package is enabled, and passes the necessary CFLAGS on SPARCv8 to make the thing build properly. The same CFLAGS are passed in the nginx package and bdwgc package. Cc: Waldemar Brodkorb <wbx@openadk.org> Cc: Bernd Kuhls <bernd.kuhls@t-online.de> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-05-26 12:53:16 +02:00
endif
endif
ifeq ($(BR2_PACKAGE_LIBDRM_INTEL),y)
LIBDRM_CONF_OPTS += -Dintel=true
libdrm: improve atomic handling, fix SPARCv8 build This commit improves the handling of the "atomic stuff" in the libdrm package. libdrm can either use the atomic intrinsics (4 byte variant) when available, or otherwise can use libatomic_ops. Note that the dependency on atomic operations is not from libdrm itself, but only from some specific DRM drivers only. Amongst other things, it fixes the build of the libdrm package on SPARCv8, therefore fixing: http://autobuild.buildroot.org/results/74dd29b5ea146c320fde80a87a2fc910de9b7f60/ This commit does a number of changes that are all related to each other: - Removes the dependency of the Intel DRM driver on libatomic_ops. The Intel DRM driver builds perfectly fine without libatomic_ops, as long as 4-byte variant __sync operations are available, which is always the case on x86 and x86_84 (which are the only architectures on which the Intel DRM driver can be enabled). - Adds an hidden Config.in boolean option BR2_PACKAGE_LIBDRM_HAS_ATOMIC that allows DRM driver that need atomic operation to know whether atomic support is available (either through intrinsics or through libatomic_ops). - Adds an hidden BR2_PACKAGE_LIBDRM_ENABLE_ATOMIC Config.in option that DRM drivers that need atomic operation should select to ensure that the relevant dependencies are selected. It simply selects libatomic_ops if 4-byte atomic intrinsics are not available. We could let each DRM driver do this, but having an intermediate option avoids a bit of duplication. - Adds a patch that defines AO_REQUIRE_CAS before including <atomic_ops.h>. This is needed because libdrm uses the AO_compare_and_swap_full() which is only provided on all architectures when AO_REQUIRE_CAS is defined. The exact same fix was done in the erlang package in commit 4a9df2942470241d7a96f326f0e7012aacd36f2e. - Adds the dependency on libatomic_ops when the package is enabled, and passes the necessary CFLAGS on SPARCv8 to make the thing build properly. The same CFLAGS are passed in the nginx package and bdwgc package. Cc: Waldemar Brodkorb <wbx@openadk.org> Cc: Bernd Kuhls <bernd.kuhls@t-online.de> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-05-26 12:53:16 +02:00
LIBDRM_DEPENDENCIES += libpciaccess
else
LIBDRM_CONF_OPTS += -Dintel=false
endif
ifeq ($(BR2_PACKAGE_LIBDRM_RADEON),y)
LIBDRM_CONF_OPTS += -Dradeon=true
else
LIBDRM_CONF_OPTS += -Dradeon=false
endif
ifeq ($(BR2_PACKAGE_LIBDRM_AMDGPU),y)
LIBDRM_CONF_OPTS += -Damdgpu=true
else
LIBDRM_CONF_OPTS += -Damdgpu=false
endif
ifeq ($(BR2_PACKAGE_LIBDRM_NOUVEAU),y)
LIBDRM_CONF_OPTS += -Dnouveau=true
else
LIBDRM_CONF_OPTS += -Dnouveau=false
endif
ifeq ($(BR2_PACKAGE_LIBDRM_VMWGFX),y)
LIBDRM_CONF_OPTS += -Dvmwgfx=true
else
LIBDRM_CONF_OPTS += -Dvmwgfx=false
endif
ifeq ($(BR2_PACKAGE_LIBDRM_OMAP),y)
LIBDRM_CONF_OPTS += -Domap=true
else
LIBDRM_CONF_OPTS += -Domap=false
endif
ifeq ($(BR2_PACKAGE_LIBDRM_ETNAVIV),y)
LIBDRM_CONF_OPTS += -Detnaviv=true
else
LIBDRM_CONF_OPTS += -Detnaviv=false
endif
ifeq ($(BR2_PACKAGE_LIBDRM_EXYNOS),y)
LIBDRM_CONF_OPTS += -Dexynos=true
else
LIBDRM_CONF_OPTS += -Dexynos=false
endif
ifeq ($(BR2_PACKAGE_LIBDRM_FREEDRENO),y)
LIBDRM_CONF_OPTS += -Dfreedreno=true
else
LIBDRM_CONF_OPTS += -Dfreedreno=false
endif
ifeq ($(BR2_PACKAGE_LIBDRM_TEGRA),y)
LIBDRM_CONF_OPTS += -Dtegra=true
else
LIBDRM_CONF_OPTS += -Dtegra=false
endif
ifeq ($(BR2_PACKAGE_LIBDRM_VC4),y)
LIBDRM_CONF_OPTS += -Dvc4=true
else
LIBDRM_CONF_OPTS += -Dvc4=false
endif
ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
LIBDRM_CONF_OPTS += -Dudev=true
LIBDRM_DEPENDENCIES += udev
else
LIBDRM_CONF_OPTS += -Dudev=false
endif
ifeq ($(BR2_PACKAGE_VALGRIND),y)
LIBDRM_CONF_OPTS += -Dvalgrind=true
LIBDRM_DEPENDENCIES += valgrind
else
LIBDRM_CONF_OPTS += -Dvalgrind=false
endif
ifeq ($(BR2_PACKAGE_LIBDRM_INSTALL_TESTS),y)
LIBDRM_CONF_OPTS += -Dinstall-test-programs=true
ifeq ($(BR2_PACKAGE_CUNIT),y)
LIBDRM_DEPENDENCIES += cunit
endif
endif
$(eval $(meson-package))