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 73 74 75 76 77 78 79 80
|
#!/usr/bin/make -f
#export DH_VERBOSE=1
include /usr/share/dpkg/default.mk
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DPKG_GENSYMBOLS_CHECK_LEVEL = 4
%:
dh $@ --buildsystem=cmake+ninja
# Prefer SCALAR over EMU128 for now, see #1015256
#DEB_CXXFLAGS_MAINT_APPEND += -DHWY_BROKEN_EMU128=1
ifneq (,$(filter $(DEB_HOST_ARCH), armel armhf))
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77728
DEB_CXXFLAGS_MAINT_APPEND += -Wno-psabi
endif
ifeq ($(DEB_HOST_ARCH),$(filter $(DEB_HOST_ARCH),armhf))
# https://github.com/google/highway/issues/1271
CMAKE_EXTRA_FLAGS += -DHWY_CMAKE_ARM7:BOOL=OFF
endif
include /usr/share/dpkg/buildtools.mk
export DEB_CXXFLAGS_MAINT_APPEND
# test suite rely on CMAKE_SKIP_RPATH=OFF
CMAKE_EXTRA_FLAGS += \
-DCMAKE_SKIP_RPATH:BOOL=OFF \
-DBUILD_SHARED_LIBS:BOOL=ON \
-DHWY_WARNINGS_ARE_ERRORS:BOOL=ON \
-DHWY_SYSTEM_GTEST:BOOL=ON
ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
CMAKE_EXTRA_FLAGS += -DBUILD_TESTING=OFF
endif
override_dh_auto_configure-arch:
dh_auto_configure -- $(CMAKE_EXTRA_FLAGS)
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
# run default example to check compilation ok:
override_dh_install-arch:
ifeq (,$(filter $(DEB_BUILD_ARCH),hurd-i386))
obj-*/examples/hwy_benchmark
else
echo "CPU 'QEMU Virtual CPU version 2.5+' does not support RDTSCP, skipping benchmark."
endif
dh_install
endif
override_dh_clean-indep:
dh_clean debian_docs/
override_dh_auto_configure-indep:
override_dh_auto_build-indep:
# most docs are ok as-is
cp -a g3doc debian_docs
# let's shrink a bit this one:
gs -q -dNOPAUSE -dBATCH -dSAFER \
-sDEVICE=pdfwrite \
-dCompatibilityLevel=1.4 \
-dPDFSETTINGS=/screen \
-dEmbedAllFonts=true \
-dSubsetFonts=true \
-dColorImageDownsampleType=/Bicubic \
-dColorImageResolution=72 \
-dGrayImageDownsampleType=/Bicubic \
-dGrayImageResolution=72 \
-dMonoImageDownsampleType=/Bicubic \
-dMonoImageResolution=72 \
-sOutputFile=debian_docs/highway_intro.pdf ./g3doc/highway_intro.pdf
override_dh_auto_test-indep:
override_dh_auto_install-indep:
override_dh_compress-indep:
# do not compress .pdf/.md files for documentation
dh_compress -X.md -X.pdf
|