aboutsummaryrefslogtreecommitdiff
path: root/multimedia/x264
diff options
context:
space:
mode:
authorMartin Matuska <mm@FreeBSD.org>2010-03-10 11:05:44 +0000
committerMartin Matuska <mm@FreeBSD.org>2010-03-10 11:05:44 +0000
commit94b594e75e0a1301e37d254187dcd7c859f4ee28 (patch)
treea9e52bcc9be2bfe1da0a00d76818698a56f831aa /multimedia/x264
parentc311f99b08da14da001b7e50c45bd15d90bfdcc7 (diff)
downloadports-94b594e75e0a1301e37d254187dcd7c859f4ee28.tar.gz
ports-94b594e75e0a1301e37d254187dcd7c859f4ee28.zip
Notes
Diffstat (limited to 'multimedia/x264')
-rw-r--r--multimedia/x264/Makefile3
-rw-r--r--multimedia/x264/files/patch-Makefile13
-rw-r--r--multimedia/x264/files/patch-common_cpu.c30
3 files changed, 44 insertions, 2 deletions
diff --git a/multimedia/x264/Makefile b/multimedia/x264/Makefile
index 6684e2a992df..71e6005a0a40 100644
--- a/multimedia/x264/Makefile
+++ b/multimedia/x264/Makefile
@@ -7,6 +7,7 @@
PORTNAME= x264
PORTVERSION= 0.0.20090119
+PORTREVISION= 1
CATEGORIES= multimedia
MASTER_SITES= http://downloads.videolan.org/pub/videolan/x264/snapshots/ \
http://samples.mplayerhq.hu/yuv4mpeg2/:pgo
@@ -49,6 +50,8 @@ LDFLAGS+= -fstack-protector
.if ${ARCH}=="i386"
MAKE_ENV+= ARCH_X86="1"
+.elif ${ARCH} == "powerpc"
+MAKE_ENV+= ARCH_PPC="1"
.endif
MAKE_ENV+= ARCH=${ARCH}
diff --git a/multimedia/x264/files/patch-Makefile b/multimedia/x264/files/patch-Makefile
index af5638d37df6..9be78fa7c198 100644
--- a/multimedia/x264/files/patch-Makefile
+++ b/multimedia/x264/files/patch-Makefile
@@ -1,5 +1,5 @@
---- ./Makefile.orig 2008-12-18 22:45:07.000000000 +0100
-+++ ./Makefile 2009-03-17 19:09:28.000000000 +0100
+--- Makefile.orig 2008-12-18 13:45:07.000000000 -0800
++++ Makefile 2010-02-27 15:21:32.000000000 -0800
@@ -26,12 +26,12 @@
cpu-a.asm dct-32.asm
X86SRC = $(X86SRC0:%=common/x86/%)
@@ -15,3 +15,12 @@
ARCH_X86 = yes
ASMSRC = $(X86SRC:-32.asm=-64.asm)
ASFLAGS += -DARCH_X86_64
+@@ -47,7 +47,7 @@
+ endif
+
+ # AltiVec optims
+-ifeq ($(ARCH),PPC)
++ifeq ($(ARCH),powerpc)
+ ALTIVECSRC += common/ppc/mc.c common/ppc/pixel.c common/ppc/dct.c \
+ common/ppc/quant.c common/ppc/deblock.c \
+ common/ppc/predict.c
diff --git a/multimedia/x264/files/patch-common_cpu.c b/multimedia/x264/files/patch-common_cpu.c
new file mode 100644
index 000000000000..3dee424cc366
--- /dev/null
+++ b/multimedia/x264/files/patch-common_cpu.c
@@ -0,0 +1,30 @@
+--- common/cpu.c.orig 2010-02-28 10:49:54.000000000 -0800
++++ common/cpu.c 2010-02-28 10:56:06.000000000 -0800
+@@ -211,6 +211,27 @@
+ return cpu;
+ }
+
++#elif defined(SYS_FREEBSD)
++#include <sys/sysctl.h>
++uint32_t x264_cpu_detect( void )
++{
++ uint32_t cpu;
++ int has_altivec, error;
++ size_t length;
++
++ cpu = 0;
++ has_altivec = 0;
++ length = sizeof( has_altivec );
++ error = sysctlbyname("hw.altivec", &has_altivec, &length, NULL, 0 );
++
++ if( error == 0 && has_altivec != 0 )
++ {
++ cpu |= X264_CPU_ALTIVEC;
++ }
++
++ return cpu;
++}
++
+ #elif defined( SYS_LINUX )
+ #include <signal.h>
+ #include <setjmp.h>