#!/usr/bin/make -f

export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

override_dh_auto_configure:
	# Strip the following unused file from the tree to prevent it from being
	# used as the license is incompatible with lib/util/getoptx.*
	rm -fv tools/turbocharger/mod_gzip.c
	dh_auto_configure -- \
		--disable-libwww-client \
		--disable-wininet-client

override_dh_auto_build:
	dh_auto_build -- BUILDTOOL_CC=gcc 'BUILDTOOL_CCLD=$$(BUILDTOOL_CC)'
	$(MAKE) -C tools

override_dh_auto_clean:
	# Add here commands to clean up after the build process.
	# xxx upstream build process still breaks on distclean...
	[ ! -f Makefile ] || [ ! -f config.status ] || dh_auto_clean || true

override_dh_install:
	dh_install --fail-missing

override_dh_makeshlibs:
	dh_makeshlibs -plibxmlrpc-core-c3 --add-udeb=libxmlrpc-core-c3-udeb
	dh_makeshlibs -plibxmlrpc-c++8v5 -V'libxmlrpc-c++8v5 (>= 1.33.14-7~)'
	dh_makeshlibs --remaining-packages

override_dh_compress:
	dh_compress -Xusr/share/doc/libxmlrpc-core-c3-dev/examples/

%:
	dh $@
