#!/usr/bin/make -f

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

export JAVA_HOME = /usr/lib/jvm/default-java
export CLASSPATH = /usr/share/java/log4j-1.2.jar

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

# The option below causes the shared objects to contain a TEXTREL section,
# triggering a non-PIC lintian error.
#export DEB_BUILD_MAINT_OPTIONS := hardening=+all

%:
	dh $@ --with autoreconf,javahelper,python3

override_dh_auto_configure:
	PYTHON=python3 \
	dh_auto_configure -- \
		--enable-python-agent \
		--enable-jni-interface \
		--enable-java-agent-all \
		--with-java-prefix=$(JAVA_HOME)

override_dh_makeshlibs:
	dh_makeshlibs -V -X/usr/lib/$(DEB_HOST_MULTIARCH)/jni

override_jh_manifest:
	jh_manifest -pliblttng-ust-agent-java
