From: Loren Merritt Date: Mon, 25 May 2009 07:03:10 +0000 (+0000) Subject: configure check for ssse3-capable binutils X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ba39abd8f25ac9a094bbd9e89692e9f52de9d1ce;p=libx264 configure check for ssse3-capable binutils --- diff --git a/configure b/configure index f02d3e70..5c9eb1fb 100755 --- a/configure +++ b/configure @@ -26,10 +26,9 @@ exit 1 fi cc_check() { - cat > conftest.c << EOF -#include <$1> -int main () { $3 return 0; } -EOF + rm -f conftest.c + [ -n "$1" ] && echo "#include <$1>" > conftest.c + echo "int main () { $3 return 0; }" >> conftest.c $CC conftest.c $CFLAGS $LDFLAGS $2 -o conftest 2>$DEVNULL } @@ -38,6 +37,11 @@ as_check() { $AS conftest.asm $ASFLAGS $2 -o conftest.o 2>$DEVNULL } +die() { + echo "$@" + exit 1 +} + rm -f config.h config.mak x264.pc conftest* prefix='/usr/local' @@ -222,8 +226,7 @@ case $host_os in HAVE_GETOPT_LONG=0 ;; *) - echo "Unknown system $host, edit the configure" - exit 1 + die "Unknown system $host, edit the configure" ;; esac @@ -300,15 +303,22 @@ if [ $shared = yes -a \( $ARCH = "X86_64" -o $ARCH = "PPC" -o $ARCH = "ALPHA" \) fi if [ $asm = yes -a \( $ARCH = X86 -o $ARCH = X86_64 \) ] ; then - if as_check "pinsrd xmm0, [esp], 0" ; then - CFLAGS="$CFLAGS -DHAVE_MMX" - else + if ! as_check "pinsrd xmm0, [esp], 0" ; then VER=`($AS --version || echo no assembler) 2>$DEVNULL | head -n 1` echo "Found $VER" echo "Minimum version is yasm-0.6.1" echo "If you really want to compile without asm, configure with --disable-asm." exit 1 fi + if ! cc_check '' '' 'asm("pabsw %xmm0, %xmm0");' ; then + VER=`(as --version || echo no gnu as) 2>$DEVNULL | head -n 1` + echo "Found $VER" + echo "Minimum version is binutils-2.17" + echo "Your compiler can't handle inline SSSE3 asm." + echo "If you really want to compile without asm, configure with --disable-asm." + exit 1 + fi + CFLAGS="$CFLAGS -DHAVE_MMX" fi [ $asm = no ] && AS="" [ "x$AS" = x ] && asm="no"