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
|
#!/usr/bin/make -f
# LTO is disabled until https://github.com/Mbed-TLS/mbedtls/issues/5906 is fixed
# optimize=-lto because I use CMake's LTO
export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=+all,-lto qa=+all
# Required as libmbedtls-dev ships .a files
#export DEB_CFLAGS_MAINT_APPEND = -ffat-lto-objects
#export DEB_CXXFLAGS_MAINT_APPEND = -ffat-lto-objects
UPSTREAM_DATE = $(shell awk '/^= .* [0-9-]*$$/ { print $$NF; exit }' ChangeLog)
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
test := true
else
test := false
endif
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
doc := true
else
doc := false
endif
%:
dh $@ --buildsystem=cmake
CONFIG_H := include/mbedtls/mbedtls_config.h
execute_after_dh_auto_clean:
[ ! -e $(CONFIG_H).bak ] || mv $(CONFIG_H).bak $(CONFIG_H)
override_dh_auto_configure:
cp $(CONFIG_H) $(CONFIG_H).bak
scripts/config.py set MBEDTLS_DEPRECATED_WARNING
scripts/config.py set MBEDTLS_THREADING_C
scripts/config.py set MBEDTLS_THREADING_PTHREAD
scripts/config.py set MBEDTLS_CMAC_C
scripts/config.py set MBEDTLS_SSL_DTLS_SRTP
dh_auto_configure -- \
-DUSE_STATIC_MBEDTLS_LIBRARY=ON \
-DUSE_SHARED_MBEDTLS_LIBRARY=ON \
-DENABLE_PROGRAMS=OFF \
-DENABLE_TESTING=$(test) \
-DCMAKE_BUILD_RPATH_USE_ORIGIN=ON
# -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
# -DCMAKE_POLICY_DEFAULT_CMP0069=NEW
ifeq ($(doc),true)
override_dh_auto_build-indep:
dh_auto_build --indep -- apidoc
endif
# Use faketime to prevent testsuite timebombing in the future
override_dh_auto_test-arch:
faketime '$(UPSTREAM_DATE)' dh_auto_test --no-parallel
override_dh_auto_test-indep:
override_dh_auto_install-indep:
ifeq ($(doc),true)
execute_after_dh_installdocs-indep:
dh_doxygen --indep
endif
|