[SCM] mplayer2/master: Enable CPU autodetection on architectures that support it.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Fri Nov 23 20:03:06 UTC 2012


The following commit has been merged in the master branch:
commit efc0a5caa886871594557e0262c561abb0233881
Author: Julien Lavergne <gilir at ubuntu.com>
Date:   Fri Nov 23 20:55:33 2012 +0100

    Enable CPU autodetection on architectures that support it.
    
    LP: #934774, #928793, #858226, #974125, #974774, #987734, #101

diff --git a/debian/rules b/debian/rules
index 7bd7530..a669a45 100755
--- a/debian/rules
+++ b/debian/rules
@@ -12,6 +12,11 @@ NUMJOBS := -j$(shell getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1)
 endif
 endif
 
+DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+ifeq ($(DEB_HOST_GNU_CPU),i686)
+	CFLAGS += -march=i686
+endif
+
 CFLAGS = `dpkg-buildflags --get CFLAGS`
 CFLAGS += `dpkg-buildflags --get CPPFLAGS`
 LDFLAGS = `dpkg-buildflags --get LDFLAGS`
@@ -21,21 +26,26 @@ confflags := --prefix=/usr \
 	--enable-translation \
 	--extra-cflags="${CFLAGS}" \
 	--extra-ldflags="${LDFLAGS}" \
-	--enable-debug=3
+	--enable-debug=3 \
+	$(archconf)
 
-# runtime cpu detection works on x86 and ppc only. These checks also work on kfreebsd!
-DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-ifeq ($(DEB_HOST_GNU_CPU),i486)
-	confflags += --enable-runtime-cpudetection
+ifeq ($(DEB_HOST_ARCH),i386)
+#configure optimizes for the cpu detected at ./configure time
+#in order to build a generic binary, avoid non-standard opcodes through gcc
+  archconf += --target=i586-linux
+  confflags += --enable-runtime-cpudetection
+endif
+ifeq ($(DEB_HOST_ARCH),amd64)
+  confflags += --enable-runtime-cpudetection
 endif
-ifeq ($(DEB_HOST_GNU_CPU),x86_64)
-	confflags += --enable-runtime-cpudetection
+ifeq ($(DEB_HOST_ARCH),kfreebsd-i386)
+  confflags += --enable-runtime-cpudetection
 endif
-ifeq ($(DEB_HOST_GNU_CPU),powerpc)
-	confflags += --enable-runtime-cpudetection
+ifeq ($(DEB_HOST_ARCH),kfreebsd-amd64)
+  confflags += --enable-runtime-cpudetection
 endif
-ifeq ($(DEB_HOST_GNU_CPU),sparc)
-        confflags += --target=generic
+ifeq ($(DEB_HOST_ARCH),powerpc)
+  confflags += --enable-runtime-cpudetection
 endif
 
 %:

-- 
mplayer2 packaging



More information about the pkg-multimedia-commits mailing list