#!/usr/bin/make -f

DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)

ifeq ($(DEB_BUILD_ARCH),i386)
additional_confflags := --disable-sse2
endif

# Do not link against unused libraries (make dpkg-shlibdeps happy).
LDFLAGS += -Wl,-z,defs -Wl,--as-needed

ifeq ($(DEB_BUILD_ARCH),sparc)
export CFLAGS += -O1
endif

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

override_dh_auto_configure:
	dh_auto_configure -- --disable-rpath --enable-chardet $(additional_confflags) \
		--with-buildstamp="$(shell dpkg-vendor --query vendor) package"

override_dh_strip:
	dh_strip --dbg-package=audacious-dbg

override_dh_installdirs:
	dh_installdirs
	mkdir -p debian/tmp/usr/share/pixmaps
	convert pixmaps/audacious.png -resize 16x16 debian/tmp/usr/share/pixmaps/audacious-16.xpm
	convert pixmaps/audacious.png -resize 32x32 debian/tmp/usr/share/pixmaps/audacious-32.xpm

override_dh_auto_clean:
	dh_auto_clean
	rm -f src/libaudcore/audio.h
