[x264-devel] [PATCH 4/4] configure: switch to POSIX sh
Diego Biurrun
diego at biurrun.de
Thu Jan 16 18:15:14 CET 2020
On 14/01/2020 18.18, Ethan Sommer wrote:
> remove use of test's -o and -a operators, they are poorly defined
> switch shebange to #!/bin/sh now that script is fully POSIX
> --- a/configure
> +++ b/configure
> @@ -77,7 +77,7 @@ log_msg() {
> # suppress them by reducing the warning level rather than having to use #pragmas
> - for arg in $*; do
> + for arg do
> [ "${arg#-falign-loops}" = "$arg" ] || arg=
> @@ -117,7 +117,7 @@ cl_ldflags() {
>
> - arg=${arg/pthreadGC/pthreadVC}
> + [ "${arg#*pthreadGC}" = "$arg" ] || arg="${arg%%pthreadGC*}pthreadVC${arg#*pthreadGC}"
> [ "$arg" = avifil32.lib ] && arg=vfw32.lib
> @@ -278,12 +278,12 @@ pkg_check() {
> define() {
> - echo "#define $1$([ -n "$2" ] && echo " $2" || echo " 1")" >> config.h
> + printf '#define %s %s\n' "$1" "${2:-1}" >> config.h
> }
>
> die() {
> - log_msg "DIED: $@"
> - echo "$@"
> + log_msg "DIED: $*"
> + echo "$*"
> exit 1
> @@ -336,7 +336,7 @@ rm -rf conftest*
> base="${PWD%/}"
> - path="$(cd "$1" >/dev/null; printf '%s/.' "${PWD%/}")"
> + path="$(cd "$1" >/dev/null || exit; printf '%s/.' "${PWD%/}")"
> up=''
> @@ -555,7 +564,7 @@ else
>
> -if [ "x$host" = x ]; then
> +if [ -z "$host" ]; then
> host="$(${SRCPATH}/config.guess)"
> @@ -564,7 +573,6 @@ host="$(${SRCPATH}/config.sub $host)"
> # split $host
> host_cpu="${host%%-*}"
> host="${host#*-}"
> -host_vendor="${host%%-*}"
> host_os="${host#*-}"
>
> @@ -876,7 +884,7 @@ fi
> msg="Command line options:"
> - for i in $@; do
> + for i do
> msg="$msg \"$i\""
> @@ -1001,7 +1015,7 @@ if [ $asm = auto -a $ARCH = MIPS ] ; then
> [ $asm = no ] && AS=""
> -[ "x$AS" = x ] && asm="no" || asm="yes"
> +[ -z "$AS" ] && asm="no" || asm="yes"
>
> @@ -1013,7 +1027,7 @@ ASFLAGS="$ASFLAGS -DSTACK_ALIGNMENT=$stack_alignment"
> echo "int i[2] = {0x42494745,0}; double f[2] = {0x1.0656e6469616ep+102,0};" > conftest.c
> - $CC $CFLAGS conftest.c -c -o conftest.o 2>/dev/null || die "endian test failed"
> + $CC $CFLAGS -fno-lto conftest.c -c -o conftest.o 2>/dev/null || die "endian test failed"
> if (${cross_prefix}strings -a conftest.o | grep -q BIGE) && (${cross_prefix}strings -a conftest.o | grep -q FPendian) ; then
Unrelated changes galore, these have to be split out.
Diego
More information about the x264-devel
mailing list