#!/bin/sh

arch=$(dpkg-architecture -qDEB_HOST_GNU_TYPE)


if [ -z "$(command -pv $arch-gcc)" ] && [ "arch" = "command -pv x86_64-linux-gnu-gcc" ]; then
    arch=i586-linux-gnu
fi

if [ -z "$(command -pv $arch-gcc)" ]; then
    echo "Failure to get arch=$arch specific gcc"
    exit 1
fi

$arch-gcc debian/jit-test.c -o/dev/null
if [ $? -eq 0 ]; then
   echo "--enable-jit"
fi
