[lfs-patches] r3283 - trunk/x264

igor at higgs.linuxfromscratch.org igor at higgs.linuxfromscratch.org
Wed Oct 14 01:22:40 PDT 2015


Author: igor
Date: Wed Oct 14 01:22:40 2015
New Revision: 3283

Log:
patch x264 configure script for systems without bash

Added:
   trunk/x264/x264-snapshot-20150908-2245-stable-no_bash-1.patch

Added: trunk/x264/x264-snapshot-20150908-2245-stable-no_bash-1.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/x264/x264-snapshot-20150908-2245-stable-no_bash-1.patch	Wed Oct 14 01:22:40 2015	(r3283)
@@ -0,0 +1,141 @@
+Submitted By:            Igor Živković
+Date:                    2014-07-31
+Initial Package Version: snapshot-20140709-2245-stable
+Upstream Status:         Unknown
+Origin:                  Self
+Description:             Improves configure shell script portability and removes
+                         dependency on bash.
+
+diff -Naur x264-snapshot-20150908-2245-stable.orig/configure x264-snapshot-20150908-2245-stable/configure
+--- x264-snapshot-20150908-2245-stable.orig/configure	2015-09-08 22:45:12.000000000 +0200
++++ x264-snapshot-20150908-2245-stable/configure	2015-10-14 10:16:37.955250282 +0200
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ 
+ if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
+ cat <<EOF
+@@ -78,13 +78,13 @@
+     # suppress them by disabling all warnings rather than having to use #pragmas to disable most of them
+     for arg in $*; do
+         [ "$arg" = -ffast-math ] && arg=
+-        [[ "$arg" = -falign-loops* ]] && arg=
++        [ ! "${arg##-falign-loops*}" ] && arg=
+         [ "$arg" = -fno-tree-vectorize ] && arg=
+         [ "$arg" = -Wshadow ] && arg=
+         [ "$arg" = -Wno-maybe-uninitialized ] && arg=
+-        [[ "$arg" = -mpreferred-stack-boundary* ]] && arg=
+-        [[ "$arg" = -l* ]] && arg=
+-        [[ "$arg" = -L* ]] && arg=
++        [ ! "${arg##-mpreferred-stack-boundary*}" ] && arg=
++        [ ! "${arg##-l*}" ] && arg=
++        [ ! "${arg##-L*}" ] && arg=
+         if [ $compiler_style = MS ]; then
+             [ "$arg" = -Wall ] && arg=-W0
+             [ "$arg" = -Werror ] && arg="-W3 -WX"
+@@ -104,8 +104,8 @@
+ 
+ cl_ldflags() {
+     for arg in $*; do
+-        arg=${arg/LIBPATH/libpath}
+-        [ "${arg#-libpath:}" == "$arg" -a "${arg#-l}" != "$arg" ] && arg=${arg#-l}.lib
++        arg=$(echo $arg | sed -e "s/LIBPATH/libpath/")
++        [ ${arg#-libpath:} = $arg -a ${arg#-l} != $arg ] && arg=${arg#-l}.lib
+         [ "${arg#-L}" != "$arg" ] && arg=-libpath:${arg#-L}
+         [ "$arg" = -Wl,--large-address-aware ] && arg=-largeaddressaware
+         [ "$arg" = -s ] && arg=
+@@ -114,9 +114,9 @@
+         [ "$arg" = -Werror ] && arg=
+         [ "$arg" = -Wshadow ] && arg=
+         [ "$arg" = -Wmaybe-uninitialized ] && arg=
+-        [[ "$arg" = -Qdiag-error* ]] && arg=
++        [ ! "${arg##-Qdiag-error*}" ] && arg=
+ 
+-        arg=${arg/pthreadGC/pthreadVC}
++        arg=$(echo $arg | sed -e "s/pthreadGC/pthreadVC/")
+         [ "$arg" = avifil32.lib ] && arg=vfw32.lib
+         [ "$arg" = gpac_static.lib ] && arg=libgpac_static.lib
+         [ "$arg" = x264.lib ] && arg=libx264.lib
+@@ -178,7 +178,7 @@
+     for arg in $1; do
+         echo "#include <$arg>" >> conftest.c
+     done
+-    echo -e "#if !($3) \n#error $4 \n#endif " >> conftest.c
++    printf "#if !($3) \n#error $4 \n#endif \n" >> conftest.c
+     if [ $compiler_style = MS ]; then
+         cpp_cmd="$CC conftest.c $(cc_cflags $CFLAGS $2) -P"
+     else
+@@ -510,10 +510,10 @@
+ # test for use of compilers that require specific handling
+ cc_base=`basename "$CC"`
+ QPRE="-"
+-if [[ $host_os = mingw* || $host_os = cygwin* ]]; then
+-    if [[ "$cc_base" = icl || "$cc_base" = icl[\ .]* ]]; then
++if [ ! "${host_os##mingw*}" ] || [ ! "${host_os##cygwin*}" ]; then
++    if [ "$cc_base" = icl ] || [ ! "${cc_base##icl.*}" ]; then
+         # Windows Intel Compiler creates dependency generation with absolute Windows paths, Cygwin's make does not support Windows paths.
+-        [[ $host_os = cygwin* ]] && die "Windows Intel Compiler support requires MSYS"
++        [ ! "${host_os##cygwin*}" ] && die "Windows Intel Compiler support requires MSYS"
+         compiler=ICL
+         compiler_style=MS
+         CFLAGS="$CFLAGS -Qstd=c99 -nologo -Qms0 -DHAVE_STRING_H -I\$(SRCPATH)/extras"
+@@ -524,10 +524,10 @@
+         if cc_check '' -Qdiag-error:10006,10157 ; then
+             CHECK_CFLAGS="$CHECK_CFLAGS -Qdiag-error:10006,10157"
+         fi
+-    elif [[ "$cc_base" = cl || "$cc_base" = cl[\ .]* ]]; then
++    elif [ "$cc_base" = cl ] || [ ! "${cc_base##cl.*}" ]; then
+         # Standard Microsoft Visual Studio
+         # Dependency creation includes absolute windows paths, Cygwin's make does not support Windows paths.
+-        [[ $host_os = cygwin* ]] && die "Microsoft Visual Studio support requires MSYS"
++        [ ! "${host_os##cygwin*}" ] && die "Microsoft Visual Studio support requires MSYS"
+         compiler=CL
+         compiler_style=MS
+         CFLAGS="$CFLAGS -nologo -DHAVE_STRING_H -I\$(SRCPATH)/extras"
+@@ -536,13 +536,13 @@
+         cpp_check '' '' '_MSC_VER > 1800 || (_MSC_VER == 1800 && _MSC_FULL_VER >= 180030324)' || die "Microsoft Visual Studio support requires Visual Studio 2013 Update 2 or newer"
+     fi
+ else
+-    if [[ "$cc_base" = icc || "$cc_base" = icc[\ .]* ]]; then
++    if [ "$cc_base" = icc ] || [ ! "${cc_base##icc.*}" ]; then
+         AR="xiar"
+         compiler=ICC
+     fi
+ fi
+ 
+-if [[ "$cc_base" = clang || "$cc_base" = clang[\ .]* ]]; then
++if [ "$cc_base" = clang ] || [ ! "${cc_base##clang.*}" ]; then
+     if cc_check '' -Werror=unknown-warning-option ; then
+         CHECK_CFLAGS="$CHECK_CFLAGS -Werror=unknown-warning-option"
+     fi
+@@ -653,10 +653,10 @@
+         AS_EXT=".asm"
+         ASFLAGS="$ASFLAGS -O2 -DARCH_X86_64=0 -I\$(SRCPATH)/common/x86/"
+         if [ $compiler = GNU ]; then
+-            if [[ "$asm" == auto && "$CFLAGS" != *-march* ]]; then
++            if [ "$asm" = auto ] && [ "${CFLAGS##*-march*}" ]; then
+                 CFLAGS="$CFLAGS -march=i686"
+             fi
+-            if [[ "$asm" == auto && "$CFLAGS" != *-mfpmath* ]]; then
++            if [ "$asm" = auto ] && [ "${CFLAGS##*-mfpmath*}" ]; then
+                 CFLAGS="$CFLAGS -mfpmath=sse -msse"
+             fi
+             CFLAGS="-m32 $CFLAGS"
+@@ -1200,7 +1200,7 @@
+ # generate exported config file
+ 
+ config_chroma_format="X264_CSP_I$chroma_format"
+-[ "$config_chroma_format" == "X264_CSP_Iall" ] && config_chroma_format="0"
++[ "$config_chroma_format" = "X264_CSP_Iall" ] && config_chroma_format="0"
+ cat > x264_config.h << EOF
+ #define X264_BIT_DEPTH     $bit_depth
+ #define X264_GPL           $x264_gpl
+@@ -1414,7 +1414,7 @@
+ cat conftest.log
+ 
+ [ "$SRCPATH" != "." ] && ln -sf ${SRCPATH}/Makefile ./Makefile
+-mkdir -p common/{aarch64,arm,ppc,x86} encoder extras filters/video input output tools
++mkdir -p common/aarch64 common/arm common/ppc common/x86 encoder extras filters/video input output tools
+ 
+ echo
+ echo "You can run 'make' or 'make fprofiled' now."


More information about the patches mailing list