1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-23 00:43:28 +00:00

- Fix powerpc support

- Bump PORTREVISION

Submitted by:	stas
This commit is contained in:
Martin Matuska 2010-03-10 11:05:44 +00:00
parent c311f99b08
commit 94b594e75e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=250837
6 changed files with 88 additions and 4 deletions

View File

@ -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}

View File

@ -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

View File

@ -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>

View File

@ -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}

View File

@ -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

View File

@ -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>