check-flags.sh: add lock around installing SDE
I think this is what was causing the occasional failures about
libunwind-dynamic.so not being found.
# run the tests if the extension is supported, but skip them if it
# isn't. Currently this only works on x86.
-echo "WD: $PWD" > ~/wd.txt
-
if [ -z "${SDE_PATH}" ]; then
SDE_PATH="/opt/intel/sde"
fi
@@ -16,8 +14,15 @@ fi
NATIVE_SUPPORT=1
for FLAG in $CFLAGS; do
- echo $FLAG | grep -qP '^\-m[0-9a-zA-V\.]+$' || continue
+ echo $FLAG | grep -qP '^\-m[0-9a-zA-Z\.]+$' || continue
+ case "${FLAG:2}" in
+ # sse3 doesn't show up in /proc/cpuinfo (?!?!)
+ "sse3")
+ ;;
+ *)
grep -qP " ${FLAG:2} " /proc/cpuinfo || NATIVE_SUPPORT=0
+ ;;
+ esac
done
COMMAND="$1"
@@ -39,9 +44,12 @@ elif [ $NATIVE_SUPPORT -eq 1 ]; then
$@
exit $?
elif [ "$COMMAND" = "sde" ]; then
+ (
+ flock 9
if [ ! -e "${SDE_PATH}/sde64" ]; then
"$(dirname "$0")"/download-sde.sh "${SDE_PATH}"
fi
+ ) 9>/tmp/sde-download.lock
"${SDE_PATH}/sde64" -- $@
exit $?
else
