--- libx264-1.0.1.orig/configure	2014-01-22 11:20:21.000000000 +0100
+++ libx264-1.0.1/configure	2014-02-23 19:54:33.000000000 +0100
@@ -560,7 +560,7 @@ LDFLAGS="$LDFLAGS $libm"
 aligned_stack=1
 case $host_cpu in
     i*86)
-        ARCH="X86"
+        XARCH="X86"
         AS="yasm"
         ASFLAGS="$ASFLAGS -O2"
         if [ $compiler = GNU ]; then
@@ -600,7 +600,7 @@ case $host_cpu in
         fi
         ;;
     x86_64)
-        ARCH="X86_64"
+        XARCH="X86_64"
         AS="yasm"
         [ $compiler = GNU ] && CFLAGS="-m64 $CFLAGS" && LDFLAGS="-m64 $LDFLAGS"
         if [ "$SYS" = MACOSX ]; then
@@ -620,7 +620,7 @@ case $host_cpu in
         fi
         ;;
     powerpc|powerpc64)
-        ARCH="PPC"
+        XARCH="PPC"
         if [ $asm = auto ] ; then
             define HAVE_ALTIVEC
             AS="${AS-${cross_prefix}gcc}"
@@ -633,11 +633,11 @@ case $host_cpu in
         fi
         ;;
     sparc)
-        ARCH="SPARC"
+        XARCH="SPARC"
         case $(uname -m) in
             sun4u|sun4v)
                 if [ $asm = auto ]; then
-                    ARCH="UltraSPARC"
+                    XARCH="UltraSPARC"
                     if ! echo $CFLAGS | grep -Eq '\-mcpu' ; then
                         CFLAGS="$CFLAGS -mcpu=ultrasparc"
                         LDFLAGS="$LDFLAGS -mcpu=ultrasparc"
@@ -649,10 +649,10 @@ case $host_cpu in
         esac
         ;;
     mips|mipsel|mips64|mips64el)
-        ARCH="MIPS"
+        XARCH="MIPS"
         ;;
     arm*)
-        ARCH="ARM"
+        XARCH="ARM"
         if [ "$SYS" = MACOSX ] ; then
             AS="${AS-extras/gas-preprocessor.pl $CC}"
             ASFLAGS="$ASFLAGS -DPREFIX -DPIC"  # apple's ld doesn't support movw/movt relocations at all
@@ -662,23 +662,23 @@ case $host_cpu in
                 LDFLAGS="$LDFLAGS -arch armv7"
             fi
         else
-            AS="${AS-${cross_prefix}gcc}"
+            AS="${cross_prefix}gcc"
         fi
         ;;
     s390|s390x)
-        ARCH="S390"
+        XARCH="S390"
         ;;
     hppa*|parisc*)
-        ARCH="PARISC"
+        XARCH="PARISC"
         ;;
     ia64)
-        ARCH="IA64"
+        XARCH="IA64"
         ;;
     alpha*)
-        ARCH="ALPHA"
+        XARCH="ALPHA"
         ;;
     *)
-        ARCH="$(echo $host_cpu | tr a-z A-Z)"
+        XARCH="$(echo $host_cpu | tr a-z A-Z)"
         ;;
 esac
 ASFLAGS="$ASFLAGS -DHAVE_ALIGNED_STACK=${aligned_stack}"
@@ -713,11 +713,11 @@ if [ $compiler != ICL ]; then
     fi
 fi
 
-if [ $shared = yes -a \( $ARCH = "X86_64" -o $ARCH = "PPC" -o $ARCH = "ALPHA" -o $ARCH = "ARM" -o $ARCH = "IA64" -o $ARCH = "PARISC" -o $ARCH = "MIPS" \) ] ; then
+if [ $shared = yes -a \( $XARCH = "X86_64" -o $XARCH = "PPC" -o $XARCH = "ALPHA" -o $XARCH = "ARM" -o $XARCH = "IA64" -o $XARCH = "PARISC" -o $XARCH = "MIPS" \) ] ; then
     pic="yes"
 fi
 
-if [ $asm = auto -a \( $ARCH = X86 -o $ARCH = X86_64 \) ] ; then
+if [ $asm = auto -a \( $XARCH = X86 -o $XARCH = X86_64 \) ] ; then
     if ! as_check "vpmovzxwd ymm0, xmm0" ; then
         VER=`($AS --version || echo no assembler) 2>/dev/null | head -n 1`
         echo "Found $VER"
@@ -740,7 +740,7 @@ if [ $asm = auto -a \( $ARCH = X86 -o $A
     fi
 fi
 
-if [ $asm = auto -a $ARCH = ARM ] ; then
+if [ $asm = auto -a $XARCH = ARM ] ; then
     # set flags so neon is built by default
     echo $CFLAGS | grep -Eq '(-mcpu|-march|-mfpu)' || CFLAGS="$CFLAGS -mcpu=cortex-a8 -mfpu=neon"
 
@@ -758,7 +758,7 @@ fi
 [ $asm = no ] && AS=""
 [ "x$AS" = x ] && asm="no" || asm="yes"
 
-define ARCH_$ARCH
+define ARCH_$XARCH
 define SYS_$SYS
 
 # skip endianness check for Intel Compiler, as all supported platforms are little. the -ipo flag will also cause the check to fail
@@ -834,7 +834,7 @@ if cc_check "math.h" "-Werror" "return l
     define HAVE_LOG2F
 fi
 
-if [ "$SYS" = "LINUX" -a \( "$ARCH" = "X86" -o "$ARCH" = "X86_64" \) ] && cc_check "sys/mman.h" "" "MADV_HUGEPAGE;" ; then
+if [ "$SYS" = "LINUX" -a \( "$XARCH" = "X86" -o "$XARCH" = "X86_64" \) ] && cc_check "sys/mman.h" "" "MADV_HUGEPAGE;" ; then
     define HAVE_THP
 fi
 
@@ -990,7 +990,7 @@ if [ "$pic" = "yes" ] ; then
     ASFLAGS="$ASFLAGS -DPIC"
     # resolve textrels in the x86 asm
     cc_check stdio.h "-shared -Wl,-Bsymbolic" && SOFLAGS="$SOFLAGS -Wl,-Bsymbolic"
-    [ $SYS = SunOS -a "$ARCH" = "X86" ] && SOFLAGS="$SOFLAGS -mimpure-text"
+    [ $SYS = SunOS -a "$XARCH" = "X86" ] && SOFLAGS="$SOFLAGS -mimpure-text"
 fi
 
 if [ "$debug" != "yes" -a "$gprof" != "yes" ]; then
@@ -1004,19 +1004,19 @@ fi
 
 if [ "$debug" = "yes" ]; then
     CFLAGS="-O1 -g $CFLAGS"
-elif [ $ARCH = ARM ]; then
+elif [ $XARCH = ARM ]; then
     # arm-gcc-4.2 produces incorrect output with -ffast-math
     # and it doesn't save any speed anyway on 4.4, so disable it
-    CFLAGS="-O3 -fno-fast-math $CFLAGS"
+    CFLAGS="-fno-fast-math $CFLAGS"
 else
-    CFLAGS="-O3 -ffast-math $CFLAGS"
+    CFLAGS="-ffast-math $CFLAGS"
 fi
 
 if cc_check '' -fno-tree-vectorize ; then
     CFLAGS="$CFLAGS -fno-tree-vectorize"
 fi
 
-if [ $SYS = WINDOWS -a $ARCH = X86 -a $compiler = GNU ] ; then
+if [ $SYS = WINDOWS -a $XARCH = X86 -a $compiler = GNU ] ; then
     # workaround gcc/ld bug with alignment of static variables/arrays that are initialized to zero
     cc_check '' -fno-zero-initialized-in-bss && CFLAGS="$CFLAGS -fno-zero-initialized-in-bss"
 fi
@@ -1117,7 +1117,7 @@ if [ $compiler = GNU ]; then
 else
     CFLAGS="$(intel_cflags $CFLAGS)"
     # icc does not define __SSE__ until SSE2 optimization and icl never defines it or _M_IX86_FP
-    [ \( $ARCH = X86_64 -o $ARCH = X86 \) -a $asm = yes ] && ! cpp_check "" "" "defined(__SSE__)" && define __SSE__
+    [ \( $XARCH = X86_64 -o $XARCH = X86 \) -a $asm = yes ] && ! cpp_check "" "" "defined(__SSE__)" && define __SSE__
     PROF_GEN_CC="${QPRE}prof-gen ${QPRE}prof-dir."
     PROF_GEN_LD=
     PROF_USE_CC="${QPRE}prof-use ${QPRE}prof-dir."
@@ -1146,7 +1146,7 @@ exec_prefix=$exec_prefix
 bindir=$bindir
 libdir=$libdir
 includedir=$includedir
-ARCH=$ARCH
+XARCH=$XARCH
 SYS=$SYS
 CC=$CC
 CFLAGS=$CFLAGS
@@ -1260,7 +1260,7 @@ gpl_filters=""
 [ $gpl = yes ] && filters="$filters $gpl_filters"
 
 cat > conftest.log <<EOF
-platform:      $ARCH
+platform:      $XARCH
 system:        $SYS
 cli:           $cli
 libx264:       $cli_libx264
