/
mvm
executable file
·51 lines (46 loc) · 1.62 KB
/
mvm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env bash
set -ex
# PharoVM with VM profiler and threaded heartbeat
THIRDPARTYLIBS="libsdl2 openssl libssh2 libgit2"
INSTALLDIR=phcogspur64linuxht
# Some gcc versions create a broken VM using -O2
case $(c99 -dumpversion) in
3.4.*) OPT="-g -O1 -fwrapv -DNDEBUG -DDEBUGVM=0";;
*) OPT="-g -O2 -DNDEBUG -DDEBUGVM=0";;
esac
OPT="$OPT -DPharoVM"
if [ $# -ge 1 ]; then
INSTALLDIR="$1"; shift
fi
echo -n "clean? "
read a
case $a in
n|no|N|NO) echo "ok but this isn't safe!!";;
*) test -f Makefile && make reallyclean
# for lib in ${THIRDPARTYLIBS}; do
# ../../third-party/mvm ${lib} clean
# done
esac
test -f plugins.int || (test -f ../plugins.int && cp -p ../plugins.int . || cp -p ../../plugins.int .)
test -f plugins.ext || (test -f ../plugins.ext && cp -p ../plugins.ext . || cp -p ../../plugins.ext .)
for lib in ${THIRDPARTYLIBS}; do
../../third-party/mvm ${lib}
done
test -f config.h || ../../../platforms/unix/config/configure \
--without-npsqueak \
--with-vmversion=5.0 \
--with-src=spur64src \
TARGET_ARCH="-m64" \
CFLAGS="$OPT -msse2 -DCOGMTVM=0" \
LDFLAGS="-Wl,-rpath,'\$\$ORIGIN' "
rm -f vm/sqUnixMain.o # nuke version info
rm -rf ../../../products/$INSTALLDIR
# prefer make install prefix=`readlink -f \`pwd\`/../../../products/$INSTALLDIR`
# but older linux readlinks lack the -f flag
make install-squeak install-plugins prefix=`(cd ../../../;pwd)`/products/$INSTALLDIR 2>&1 | tee LOG
productDir=`find ../../../products/$INSTALLDIR -name "5.0*"`
productDir=`(cd $productDir;pwd)`
for lib in ${THIRDPARTYLIBS}; do
../../third-party/mvm ${lib} install $productDir
done
../../editpharoinstall.sh ../../../products/$INSTALLDIR "$@"