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 <" >> 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."