1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
#!/usr/bin/make -f
# DH_VERBOSE := 1
export LC_ALL=C.UTF-8
CLANG_SKIP=i386 alpha hppa ia64 m68k sh4 x32
# i386 is due to https://github.com/simd-everywhere/simde/issues/683
# ppc64 is due to https://github.com/simd-everywhere/simde/issues/185
include /usr/share/dpkg/default.mk
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
ifneq (,$(filter $(DEB_BUILD_ARCH),armel))
export DEB_LDFLAGS_MAINT_APPEND=-latomic
endif
ifneq (,$(filter $(DEB_BUILD_ARCH),i386))
export DEB_CFLAGS_MAINT_APPEND=-O0
export DEB_CXXFLAGS_MAINT_APPEND=-O0
endif
%:
dh $@ --buildsystem=meson+ninja
override_dh_auto_configure:
dh_auto_configure -- -Dtests=false --libdir=lib
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
# ifeq (,$(filter $(DEB_HOST_ARCH),$(CLANG_SKIP)))
# CC=clang CXX=clang++ dh_auto_configure --builddirectory=clang_test
# endif
# https://github.com/simd-everywhere/simde/issues/867
ifneq (,$(filter $(DEB_BUILD_ARCH),i386))
sed -i "/'dbsad'/d" meson.build
sed -i "/'fpclass'/d" meson.build
rm -f test/x86/avx512/dbsad.c
rm -f test/x86/avx512/fpclass.c
endif
# According to https://wiki.debian.org/ArchitectureSpecificsMemo#Architecture_baselines
# It is odd that gcc doesn't include this automatically, but clang does
ifneq (,$(filter $(DEB_BUILD_ARCH),ppc64))
export DEB_CFLAGS_MAINT_APPEND=-maltivec
export DEB_CXXFLAGS_MAINT_APPEND=-maltivec
endif
CC=gcc CXX=g++ dh_auto_configure --builddirectory=gcc_test
endif
override_dh_auto_build:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
dh_auto_build --builddirectory=gcc_test
# ifeq (,$(filter $(DEB_HOST_ARCH),$(CLANG_SKIP)))
# dh_auto_build --builddirectory=clang_test
# endif
endif
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
dh_auto_test --builddirectory=gcc_test -- $(shell meson test -C gcc_test --list | grep -v emul)
# Skip testing on clang for now owing to bug report #1002223
# ifeq (,$(filter $(DEB_HOST_ARCH),$(CLANG_SKIP)))
# dh_auto_test --builddirectory=clang_test -- $(shell meson test -C clang_test --list | grep -v emul)
# endif
endif
override_dh_auto_clean:
dh_auto_clean --builddirectory=gcc_test
dh_auto_clean --builddirectory=clang_test
dh_auto_clean
override_dh_auto_install:
dh_auto_install
mkdir --parents debian/libsimde-dev/usr/share/
mv debian/libsimde-dev/usr/lib/pkgconfig debian/libsimde-dev/usr/share/
find debian/libsimde-dev -type d -empty -delete
|