#!/usr/bin/make -f

export JAVA_HOME = /usr/lib/jvm/default-java/

ifneq (,$(findstring $(DEB_HOST_ARCH),mips mipsel))
export DEB_CXXFLAGS_MAINT_APPEND+=-Wa,-xgot
endif
ifneq (,$(findstring $(DEB_HOST_ARCH),hppa))
export DEB_LDFLAGS_MAINT_APPEND+=-ffunction-sections
endif

export DEB_CFLAGS_MAINT_APPEND+= -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux -Wdate-time
export DEB_CXXFLAGS_MAINT_APPEND+= -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux -Wdate-time

%:
	dh $@ --with autoreconf --parallel

override_dh_auto_configure:
	LIBS="-lboost_system" BOOST_LIB_SUFFIX="" dh_auto_configure -- \
	    --disable-script-node-javascript --disable-mozilla-plugin

override_dh_auto_build-indep:
	$(MAKE) -C doc html-local

override_dh_auto_test:
	# Testsuite is completly untested on buildds, run for the very first time,
	# so I'm gonna test it first, not failing the build now.
	dh_auto_test || echo "TESTSUITE FAILED"

