Commit 17dd119d authored by Alex Izvorski's avatar Alex Izvorski

allow compiling without yasm/nasm on x86 and x86-64 platforms

git-svn-id: svn://svn.videolan.org/x264/trunk@658 df754926-b1dd-0310-bc7b-ec298dee348c
parent 26bed72b
......@@ -19,6 +19,7 @@ endif
# MMX/SSE optims
ifeq ($(ARCH),X86)
ifneq ($(AS),)
SRCS += common/i386/mc-c.c common/i386/predict-c.c
ASMSRC = common/i386/dct-a.asm common/i386/cpu-a.asm \
common/i386/pixel-a.asm common/i386/mc-a.asm \
......@@ -28,9 +29,11 @@ ASMSRC = common/i386/dct-a.asm common/i386/cpu-a.asm \
OBJASM = $(ASMSRC:%.asm=%.o)
ASFLAGS += -Icommon/i386/
endif
endif
# MMX/SSE optims
ifeq ($(ARCH),X86_64)
ifneq ($(AS),)
SRCS += common/i386/mc-c.c common/i386/predict-c.c
ASMSRC = common/amd64/dct-a.asm common/amd64/cpu-a.asm \
common/amd64/pixel-a.asm common/amd64/mc-a.asm \
......@@ -40,6 +43,7 @@ ASMSRC = common/amd64/dct-a.asm common/amd64/cpu-a.asm \
OBJASM = $(ASMSRC:%.asm=%.o)
ASFLAGS += -Icommon/amd64
endif
endif
# AltiVec optims
ifeq ($(ARCH),PPC)
......
......@@ -37,7 +37,7 @@
#include "common.h"
#if defined(ARCH_X86) || defined(ARCH_X86_64)
#if ( defined(ARCH_X86) || defined(ARCH_X86_64) ) && defined(HAVE_MMX)
extern int x264_cpu_cpuid_test( void );
extern uint32_t x264_cpu_cpuid( uint32_t op, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx );
extern void x264_emms( void );
......@@ -49,10 +49,6 @@ uint32_t x264_cpu_detect( void )
uint32_t eax, ebx, ecx, edx;
int b_amd;
#ifndef HAVE_MMX
return 0;
#endif
if( !x264_cpu_cpuid_test() )
{
/* No cpuid */
......
......@@ -147,7 +147,6 @@ esac
case "${MACHINE%%-*}" in
i*86)
ARCH="X86"
CFLAGS="$CFLAGS -DHAVE_MMX"
AS="yasm"
ASFLAGS="-O2"
if [ "$SYS" = MACOSX ]; then
......@@ -163,7 +162,6 @@ case "${MACHINE%%-*}" in
;;
x86_64)
ARCH="X86_64"
CFLAGS="$CFLAGS -DHAVE_MMX"
AS="yasm"
ASFLAGS="-f elf -m amd64"
;;
......@@ -215,19 +213,23 @@ then
then
echo "Your version of 'nasm' is too old."
echo "Please install Xcode 2.4.1 or later."
exit 1
AS=""
fi
fi
if [ $ARCH = X86 -o $ARCH = X86_64 ] ; then
if ! as_check ; then
echo "No assembler. Please install yasm."
exit 1
if as_check ; then
CFLAGS="$CFLAGS -DHAVE_MMX"
fi
if as_check "pabsw xmm0, xmm0" ; then
ASFLAGS="$ASFLAGS -DHAVE_SSE3"
CFLAGS="$CFLAGS -DHAVE_SSE3"
fi
if ! as_check ; then
echo "No suitable assembler found. x264 will be several times slower."
echo "Please install 'yasm' to get MMX/SSE optimized code."
AS=""
fi
fi
CFLAGS="$CFLAGS -DARCH_$ARCH -DSYS_$SYS"
......
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