# -*- mode: makefile -*-
# vim:syntax=make

# Set CFLAGS from DEB_CFLAGS if defined, otherwise let xvidcore's build system
# set CFLAGS to use.
DEFAULT_CFLAGS = -Wall -O3 -fstrength-reduce -finline-functions -ffast-math \
                 -fomit-frame-pointer
export CFLAGS = $(or $(DEB_CFLAGS),$(DEFAULT_CFLAGS))

export DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
export DEB_HOST_ARCH_OS  ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)

# Explicitely disable Altivec support on powerpc until we introduce flavours
ifeq ($(DEB_HOST_ARCH_CPU),powerpc)
	confflags += --disable-assembly
endif

# Explicitely disable yasm support on kfreebsd, it's broken on 64bit;
# see: http://www.freebsd.org/cgi/cvsweb.cgi/ports/multimedia/xvid/Makefile?rev=1.36
ifeq ($(DEB_HOST_ARCH_OS),kfreebsd)
	confflags += --disable-assembly
endif
