| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
### |
| 4 |
### Configuration, decide what to build |
| 5 |
### |
| 6 |
|
| 7 |
# Some variables: |
| 8 |
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) |
| 9 |
DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) |
| 10 |
DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU) |
| 11 |
|
| 12 |
confflags = \ |
| 13 |
--auto-features=disabled \ |
| 14 |
-Ddefault_library=both \ |
| 15 |
-Dman-pages=enabled \ |
| 16 |
-Dradeon=enabled \ |
| 17 |
-Damdgpu=enabled \ |
| 18 |
-Dinstall-test-programs=true \ |
| 19 |
-Dvalgrind=disabled \ |
| 20 |
$() |
| 21 |
|
| 22 |
# Linux vs. the rest: |
| 23 |
ifeq (linux, $(DEB_HOST_ARCH_OS)) |
| 24 |
confflags += -Dudev=true |
| 25 |
confflags += -Dvmwgfx=enabled |
| 26 |
confflags += -Dnouveau=enabled |
| 27 |
NOUVEAU = yes |
| 28 |
else |
| 29 |
confflags += -Dudev=false |
| 30 |
confflags += -Dvmwgfx=disabled |
| 31 |
confflags += -Dnouveau=disabled |
| 32 |
NOUVEAU = no |
| 33 |
endif |
| 34 |
|
| 35 |
# Intel is only on x86, arm64, riscv64 and loong64: |
| 36 |
ifneq (,$(filter amd64 arm64 i386 riscv64 loong64,$(DEB_HOST_ARCH_CPU))) |
| 37 |
ifneq (,$(filter linux hurd,$(DEB_HOST_ARCH_OS))) |
| 38 |
INTEL = yes |
| 39 |
endif |
| 40 |
endif |
| 41 |
ifeq ($(INTEL), yes) |
| 42 |
confflags += -Dintel=enabled |
| 43 |
else |
| 44 |
confflags += -Dintel=disabled |
| 45 |
endif |
| 46 |
|
| 47 |
# Exynos/Omap/Tegra are only on arm |
| 48 |
ifneq (,$(filter arm,$(DEB_HOST_ARCH_CPU))) |
| 49 |
ARM = yes |
| 50 |
endif |
| 51 |
ifeq ($(ARM), yes) |
| 52 |
confflags += -Dexynos=enabled |
| 53 |
confflags += -Domap=enabled |
| 54 |
else |
| 55 |
confflags += -Dexynos=disabled |
| 56 |
confflags += -Domap=disabled |
| 57 |
endif |
| 58 |
|
| 59 |
# Etnaviv is on armhf and arm64 |
| 60 |
ifneq (,$(filter armhf arm64,$(DEB_HOST_ARCH))) |
| 61 |
ETNAVIV = yes |
| 62 |
endif |
| 63 |
ifeq ($(ETNAVIV), yes) |
| 64 |
confflags += -Detnaviv=enabled |
| 65 |
else |
| 66 |
confflags += -Detnaviv=disabled |
| 67 |
endif |
| 68 |
|
| 69 |
# Tegra is on arm and arm64 |
| 70 |
ifneq (,$(filter arm arm64,$(DEB_HOST_ARCH_CPU))) |
| 71 |
TEGRA = yes |
| 72 |
endif |
| 73 |
ifeq ($(TEGRA), yes) |
| 74 |
confflags += -Dtegra=enabled |
| 75 |
else |
| 76 |
confflags += -Dtegra=disabled |
| 77 |
endif |
| 78 |
|
| 79 |
# Freedreno is on arm and arm64 |
| 80 |
ifneq (,$(filter arm arm64,$(DEB_HOST_ARCH_CPU))) |
| 81 |
FREEDRENO = yes |
| 82 |
endif |
| 83 |
ifeq ($(FREEDRENO), yes) |
| 84 |
confflags += -Dfreedreno=enabled -Dfreedreno-kgsl=true |
| 85 |
else |
| 86 |
confflags += -Dfreedreno=disabled |
| 87 |
endif |
| 88 |
|
| 89 |
### |
| 90 |
### Actual build |
| 91 |
### |
| 92 |
|
| 93 |
override_dh_auto_configure: |
| 94 |
dh_auto_configure -- $(confflags) |
| 95 |
|
| 96 |
override_dh_auto_test: |
| 97 |
dh_auto_test || echo "Test suite failure, but keeping on anyway" |
| 98 |
|
| 99 |
override_dh_install: |
| 100 |
find debian/tmp -name '*.la' -delete |
| 101 |
dh_install |
| 102 |
|
| 103 |
ifneq (,$(filter $(DEB_HOST_ARCH_CPU),arm)) |
| 104 |
for file in debian/tmp/usr/bin/exynos_*; do \ |
| 105 |
mv $$file debian/libdrm-tests/usr/bin; \ |
| 106 |
done |
| 107 |
endif |
| 108 |
ifneq (,$(filter $(DEB_HOST_ARCH_CPU),arm arm64)) |
| 109 |
for file in debian/tmp/usr/bin/tegra-*; do \ |
| 110 |
mv $$file debian/libdrm-tests/usr/bin; \ |
| 111 |
done |
| 112 |
endif |
| 113 |
ifneq (,$(filter $(DEB_HOST_ARCH),armhf arm64)) |
| 114 |
for file in debian/tmp/usr/bin/etnaviv*; do \ |
| 115 |
mv $$file debian/libdrm-tests/usr/bin; \ |
| 116 |
done |
| 117 |
endif |
| 118 |
|
| 119 |
override_dh_makeshlibs: |
| 120 |
dh_makeshlibs -plibdrm2 -V'libdrm2 (>= 2.4.89)' --add-udeb=libdrm2-udeb -- -c4 |
| 121 |
ifeq ($(INTEL), yes) |
| 122 |
dh_makeshlibs -plibdrm-intel1 -V'libdrm-intel1 (>= 2.4.75)' -- -c4 |
| 123 |
endif |
| 124 |
ifeq ($(NOUVEAU), yes) |
| 125 |
dh_makeshlibs -plibdrm-nouveau2 -V'libdrm-nouveau2 (>= 2.4.66)' -- -c4 |
| 126 |
endif |
| 127 |
dh_makeshlibs -plibdrm-radeon1 -V'libdrm-radeon1 (>= 2.4.39)' -- -c4 |
| 128 |
dh_makeshlibs -plibdrm-amdgpu1 -V'libdrm-amdgpu1 (>= 2.4.97)' -- -c4 |
| 129 |
ifeq ($(ARM), yes) |
| 130 |
dh_makeshlibs -plibdrm-omap1 -V'libdrm-omap1 (>= 2.4.38)' -- -c4 |
| 131 |
dh_makeshlibs -plibdrm-exynos1 -V'libdrm-exynos1 (>= 2.4.66)' -- -c4 |
| 132 |
endif |
| 133 |
ifeq ($(ETNAVIV), yes) |
| 134 |
dh_makeshlibs -plibdrm-etnaviv1 -V'libdrm-etnaviv1 (>= 2.4.89)' -- -c4 |
| 135 |
endif |
| 136 |
ifeq ($(TEGRA), yes) |
| 137 |
dh_makeshlibs -plibdrm-tegra0 -V'libdrm-tegra0' -- -c4 |
| 138 |
endif |
| 139 |
ifeq ($(FREEDRENO), yes) |
| 140 |
dh_makeshlibs -plibdrm-freedreno1 -V'libdrm-freedreno1 (>= 2.4.97)' -- -c4 |
| 141 |
endif |
| 142 |
|
| 143 |
%: |
| 144 |
dh $@ --builddirectory=build/ \ |
| 145 |
--buildsystem=meson |