Commit bf06e99e authored by Eric Petit's avatar Eric Petit

Attempt to fix build on Linux PPC


git-svn-id: svn://svn.videolan.org/x264/trunk@14 df754926-b1dd-0310-bc7b-ec298dee348c
parent 86ca4903
......@@ -11,13 +11,13 @@ AS = nasm ;
CCFLAGS = -g -Wall -W ;
# Globals defines
DEFINES = DEBUG __X264__ ;
DEFINES = DEBUG __X264__ ARCH_$(OSPLAT) SYS_$(OS) ;
# Optims
OPTIM = -O3 -funroll-loops ;
# Headers rep
HDRS = . core core/i366 decoder encoder ;
HDRS = . core core/i386 decoder encoder ;
SOURCES_C = core/mc.c core/predict.c core/pixel.c core/macroblock.c
core/frame.c core/dct.c core/cpu.c core/cabac.c
......@@ -33,22 +33,29 @@ SOURCES_ALTIVEC = core/ppc/mc.c core/ppc/pixel.c ;
# libx264
SOURCES_X264 = $(SOURCES_C) ;
if $(OS) = LINUX
if $(OSPLAT) = X86
{
DEFINES += ARCH_X86 HAVE_MMXEXT HAVE_SSE2 HAVE_MALLOC_H ;
DEFINES += HAVE_MALLOC_H HAVE_MMXEXT HAVE_SSE2 ;
SOURCES_X264 += $(SOURCES_MMX) ;
SOURCES_X264 += $(SOURCES_X86) ;
ASFLAGS = -f elf ;
ASFLAGS = -f elf ;
# Don't ask why
# Don't ask
NOARUPDATE = false ;
}
if $(OS) = MACOSX
if $(OSPLAT) = PPC
{
DEFINES += HAVE_ALTIVEC ;
SOURCES_X264 += $(SOURCES_ALTIVEC) ;
CCFLAGS += -faltivec ;
# OPTIM += -falign-loops=16 ;
OPTIM += -falign-loops=16 ;
if $(OS) = MACOSX
{
CCFLAGS += -faltivec ;
}
if $(OS) = LINUX
{
CCFLAGS += -maltivec -mabi=altivec ;
}
}
Library libx264 : $(SOURCES_X264) ;
......
# Makefile: tuned for i386/MMX system only
# For ppc append
# SRCS: core/ppc/mc.c core/ppc/pixel.c
# Defines: HAVE_ALTIVEC
# Defines: HAVE_PPC
# CFLAGS: -faltivec
#
PFLAGS=-DARCH_X86 -DHAVE_MMXEXT -DHAVE_SSE2
......
......@@ -194,12 +194,13 @@ uint32_t x264_cpu_detect( void )
}
#endif
#elif defined( HAVE_ALTIVEC )
#include <sys/sysctl.h>
#elif defined( ARCH_PPC )
#ifdef SYS_MACOSX
#include <sys/sysctl.h>
uint32_t x264_cpu_detect( void )
{
/* Thx VLC */
/* Thank you VLC */
uint32_t cpu = 0;
int selectors[2] = { CTL_HW, HW_VECTORUNIT };
int has_altivec = 0;
......@@ -214,6 +215,14 @@ uint32_t x264_cpu_detect( void )
return cpu;
}
#elif defined( SYS_LINUX )
uint32_t x264_cpu_detect( void )
{
/* FIXME (Linux PPC) */
return X264_CPU_ALTIVEC;
}
#endif
void x264_cpu_restore( uint32_t cpu )
{
}
......
......@@ -37,7 +37,7 @@
#ifdef HAVE_MMXEXT
# include "i386/mc.h"
#endif
#ifdef HAVE_ALTIVEC
#ifdef ARCH_PPC
# include "ppc/mc.h"
#endif
......@@ -313,7 +313,7 @@ void x264_mc_init( int cpu, x264_mc_function_t pf[2] )
x264_mc_sse2_init( pf );
#endif
#ifdef HAVE_ALTIVEC
#ifdef ARCH_PPC
if( cpu&X264_CPU_ALTIVEC )
x264_mc_altivec_init( pf );
#endif
......
......@@ -31,7 +31,7 @@
#ifdef HAVE_MMXEXT
# include "i386/pixel.h"
#endif
#ifdef HAVE_ALTIVEC
#ifdef ARCH_PPC
# include "ppc/pixel.h"
#endif
......@@ -218,7 +218,7 @@ void x264_pixel_init( int cpu, x264_pixel_function_t *pixf )
pixf->satd[PIXEL_4x4] = x264_pixel_satd_4x4_mmxext;
}
#endif
#ifdef HAVE_ALTIVEC
#ifdef ARCH_PPC
if( cpu&X264_CPU_ALTIVEC )
{
x264_pixel_altivec_init( pixf );
......
......@@ -26,6 +26,10 @@
#include <string.h>
#include <stdint.h>
#ifdef SYS_LINUX
#include <altivec.h>
#endif
#include "x264.h"
#include "../mc.h"
#include "../clip1.h"
......
......@@ -26,6 +26,10 @@
#include <string.h>
#include <stdint.h>
#ifdef SYS_LINUX
#include <altivec.h>
#endif
#include "x264.h"
#include "../pixel.h"
#include "pixel.h"
......
......@@ -9,7 +9,7 @@
#include "core/i386/dct.h"
#include "core/i386/mc.h"
#endif
#ifdef HAVE_ALTIVEC
#ifdef ARCH_PPC
#include "core/ppc/pixel.h"
#endif
......@@ -30,7 +30,7 @@ static int check_pixel()
#ifdef HAVE_MMXEXT
x264_pixel_init( X264_CPU_MMX|X264_CPU_MMXEXT, &pixel_asm );
#endif
#ifdef HAVE_ALTIVEC
#ifdef ARCH_PPC
x264_pixel_altivec_init( &pixel_asm );
#endif
......@@ -311,7 +311,7 @@ int main()
#ifdef HAVE_MMXEXT
fprintf( stderr, "x264: MMXEXT against C\n" );
#elif HAVE_ALTIVEC
#elif ARCH_PPC
fprintf( stderr, "x264: ALTIVEC against C\n" );
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment