#!/usr/bin/make -f

DEB_CONFIGURE_EXTRA_FLAGS := \
	--disable-maintainer-mode \
	--disable-dependency-tracking

ifneq (,$(filter debug,$(DEB_BUILD_OPTIONS)))
DEB_CONFIGURE_EXTRA_FLAGS += \
	--enable-debug=yes \
	--enable-xv-debug=yes
endif

# Configuration:
override_dh_auto_configure:
	dh_auto_configure -- $(DEB_CONFIGURE_EXTRA_FLAGS)

# Install in debian/tmp to retain control through dh_install:
override_dh_auto_install:
	dh_auto_install --destdir=debian/tmp

# Kill *.la files, and forget no-one:
override_dh_install:
	find debian/tmp -name '*.la' -delete
	dh_install --fail-missing

# That's a plugin, use appropriate warning level:
override_dh_shlibdeps:
	dh_shlibdeps -- --warnings=6

override_dh_strip:
	dh_strip --dbg-package=xserver-xorg-video-openchrome-dbg

%:
	dh $@ --with quilt,autoreconf,xsf --builddirectory=build/
