#!/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/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_HAVEGE_C scripts/config.py set MBEDTLS_MD2_C scripts/config.py set MBEDTLS_MD4_C 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 -- \ -DLIB_INSTALL_DIR="lib/$(DEB_HOST_MULTIARCH)" \ -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