#!/usr/bin/make -f

DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
gles2_architectures := armel armhf

CORE_ABIVERSION := $(shell sed -rn 's/^\#define[[:space:]]+CORE_ABIVERSION[[:space:]]+//p' /usr/include/compiz/core/abiversion.h )

override_dh_auto_configure:
ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), $(gles2_architectures)))
	dh_auto_configure -- -DCOMPIZ_BUILD_WITH_RPATH=FALSE -DBUILD_GLES=ON
else
	dh_auto_configure -- -DCOMPIZ_BUILD_WITH_RPATH=FALSE
endif

override_dh_gencontrol:
	dh_gencontrol -- -Vcoreabiversion=$(CORE_ABIVERSION)

%:
	dh $@
