#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

override_dh_auto_configure:
	dh_auto_configure -- --disable-network-tests $(cfgflags)

override_dh_auto_build:
	chmod a+x src/bin2s.pl
	if which musl-gcc >/dev/null; then dh_auto_build -- -C init CC=musl-gcc; fi
	dh_auto_build

override_dh_auto_test:
	dh_auto_test -- SKIP_TEST_EXECSTACK=1

override_dh_gencontrol:
	dh_gencontrol -- -Vmisc:Built-Using="$(shell dpkg-query -f '$${source:Package} (= $${source:Version}), ' -W $(if $(shell which musl-gcc),musl-tools,libc6-dev))"

%:
	dh $@ --with=ocaml,autoreconf

override_dh_autoreconf:
	AUTOMAKE='automake --foreign --add-missing' dh_autoreconf
