build/qemu-wrap

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rwxr-xr-x

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 #!/bin/bash
     2 # this script creates a wrapper shell script for an executable.  The idea is the actual executable cannot be
     3 # executed natively (it was cross compiled), but we want to run tests natively.  Running this script
     4 # as part of the compilation process will move the non-native executable to a new location, and replace it
     5 # with a script that will run it under qemu.
     6 while [[ -n $1 ]]; do
     7     case $1 in
     8         --qemu) QEMU="$2"; shift 2;;
     9         --libdir) LIBDIR="$2"; shift 2;;
    10         --ld) LD="$2"; shift 2;;
    11         *) exe="$1"; shift;;
    12     esac
    13 done
    14 if [[ -z $LIBDIR ]]; then
    15     echo "You need to specify a directory for the cross libraries when you configure the shell"
    16     echo "You can do this with --with-cross-lib="
    17     exit 1
    18 fi
    19 LD=${LD:-$LIBDIR/ld-linux.so.3}
    20 mv $exe $exe.target
    21 # Just hardcode the path to the executable.  It'll be pretty obvious if it is doing the wrong thing.
    23 echo $'#!/bin/bash\n' $QEMU -E LD_LIBRARY_PATH="${LIBDIR}" "$LD" "$(readlink -f "$exe.target")" '"$@"' >"$exe"
    24 chmod +x $exe

mercurial