linux-packaging-mono/debian/postinst-monoaot
Joseph Shields 42d2967bd0 Revert "Disable LLVM, loadedllvm is dead upstream"
This reverts commit 64a34572b9f05ef5bc27ffce566817b3c3f670a6 [formerly ea9992b951f20ed31fe080d1b8f27ac4eaf6ba78].


Former-commit-id: 0954a3e617a8347a7b6727b4f3af74a776dd400a
2020-05-18 14:29:38 -04:00

27 lines
881 B
Plaintext

if [ "$1" = "configure" ]
then
TEMPDIR=`mktemp -d -t monoaot.XXXXXXXXX`
MONOARCH=`mono --version | grep Architecture | sed 's/.*: //' | sed 's/el,.*//'`
HASSSE41=`grep sse4_1 /proc/cpuinfo || true`
TRYLLVM=""
LLVMNOTE=""
if [ -e "/usr/lib/libmono-llvm.so.0" ]
then
TRYLLVM="try-llvm,"
LLVMNOTE=" (trying with LLVM, this might take a few minutes)"
fi
if [ -z "$HASSSE41" ]
then
TRYLLVM=""
LLVMNOTE=" (LLVM disabled due to missing SSE4.1)"
fi
echo "Mono precompiling #FILE# for ${MONOARCH}${LLVMNOTE}..."
mkdir -p /usr/lib/mono/aot-cache/${MONOARCH}/
/usr/bin/mono --aot=${TRYLLVM}temp-path=${TEMPDIR},outfile=/usr/lib/mono/aot-cache/${MONOARCH}/`basename #FILE#.so` -O=all #FILE# > /dev/null 2>&1 || true
if [ -n "${TEMPDIR}" -a "${TEMPDIR}" != "/tmp" -a "${TEMPDIR}" != "/tmp/" -a "${TEMPDIR}" != "/" ]
then
rm -f ${TEMPDIR}/*
rmdir ${TEMPDIR}
fi
fi