#!/bin/bash # this script fetches the sources / binaries and makes basic preparations if [ "X$BASEDIR" == "X" ]; then BASEDIR=$HOME/testing fi set -e export BASEDIR cd $BASEDIR if [ ! -e $BASEDIR/config ]; then echo "ERROR: no config file '$BASEDIR/config' found." exit 1 fi . $BASEDIR/config RAW_LOG=$BASEDIR/output/compile-install.rawlog ############### echo echo $SEPARATOR echo "BINARIES FROM SOURCES '$SOURCES_LIST' will be build and installed." echo for SOURCE in $SOURCES_LIST; do echo "Configuring, making and installing $SOURCE sources." cd $BASEDIR/sources/$SOURCE case "$SOURCE" in sablevm) echo "Sources recognized as SableVM." for FLAVOR in $FLAVORS_LIST; do if [ -e $BASEDIR/stamps/compiled-$SOURCE-$FLAVOR ]; then echo "Stamp compiled-$SOURCE exists - skipping compilation!" else echo "Running configure ($FLAVOR)..." case "$FLAVOR" in default) ./configure --prefix=$BASEDIR/runtimes/sablevm-$FLAVOR >>$RAW_LOG 2>&1 ;; switch) ./configure --prefix=$BASEDIR/runtimes/sablevm-$FLAVOR \ --with-threading=switch >>$RAW_LOG 2>&1 ;; direct) ./configure --prefix=$BASEDIR/runtimes/sablevm-$FLAVOR \ --with-threading=direct >>$RAW_LOG 2>&1 ;; inlined) ./configure --prefix=$BASEDIR/runtimes/sablevm-$FLAVOR \ --with-threading=inlined >>$RAW_LOG 2>&1 ;; inlined-testing) ./configure --prefix=$BASEDIR/runtimes/sablevm-$FLAVOR \ --enable-inlinability-testing >>$RAW_LOG 2>&1 ;; switch-nosig) ./configure --prefix=$BASEDIR/runtimes/sablevm-$FLAVOR \ --with-threading=switch --disable-signals-for-exceptions \ >>$RAW_LOG 2>&1 ;; direct-nosig) ./configure --prefix=$BASEDIR/runtimes/sablevm-$FLAVOR \ --with-threading=direct --disable-signals-for-exceptions \ >>$RAW_LOG 2>&1 ;; inlined-nosig) ./configure --prefix=$BASEDIR/runtimes/sablevm-$FLAVOR \ --with-threading=inlined --disable-signals-for-exceptions \ >>$RAW_LOG 2>&1 ;; inlined-testing-nosig) ./configure --prefix=$BASEDIR/runtimes/sablevm-$FLAVOR \ --enable-inlinability-testing --disable-signals-for-exceptions \ >>$RAW_LOG 2>&1 ;; debug) ./configure --prefix=$BASEDIR/runtimes/sablevm-$FLAVOR \ --enable-debugging-features --disable-errors-on-warnings \ >>$RAW_LOG 2>&1 ;; *) echo "ERROR: unknown flavor $FLAVOR." exit 1 ;; esac echo "Running 'make clean'..." make clean >>$RAW_LOG 2>&1 echo "Running 'make'..." make >>$RAW_LOG 2>&1 touch $BASEDIR/stamps/compiled-$SOURCE-$FLAVOR fi echo "Running 'make install'" make install >>$RAW_LOG 2>&1 unlink $BASEDIR/runtimes/sablevm-$FLAVOR/lib/sablevm &>/dev/null || true (cd $BASEDIR/runtimes/sablevm-$FLAVOR/lib && \ ln -sf ../../classpath ./sablevm ) >>$RAW_LOG 2>&1 unlink $BASEDIR/runtimes/sablevm-$FLAVOR/bin/sablevm-$FLAVOR &>/dev/null || true (cd $BASEDIR/runtimes/sablevm-$FLAVOR/bin; \ ln -sf ./sablevm ./sablevm-$FLAVOR ) >>$RAW_LOG 2>&1 echo "SableVM ($FLAVOR) installed." done echo echo "ALL SableVM flavors compiled and installed." echo ;; sablevm-classpath) echo "Sources recognized as SableVM GNU Classpath branch." if [ -e $BASEDIR/stamps/compiled-$SOURCE ]; then echo "Stamp compiled-$SOURCE exists - skipping compilation!" else echo "Running configure..." SYSNAME=`uname -m`; case "$SYSNAME" in arm*) echo "Working around jikes on ARM problems..." NOT_JIKES=--disable-java ;; *);; esac ./configure --enable-jni --without-zip --prefix=$BASEDIR/runtimes/classpath \ --libdir=$BASEDIR/runtimes/classpath --datadir=$BASEDIR/runtimes/classpath \ --disable-gtk-peer "$NOT_JIKES" \ >>$RAW_LOG 2>&1 echo "Running 'make clean'..." make clean >>$RAW_LOG 2>&1 echo "Running 'make'..." make >>$RAW_LOG 2>&1 touch $BASEDIR/stamps/compiled-$SOURCE fi echo "Sources recognized as SableVM GNU Classpath branch." if [ -e $BASEDIR/stamps/installed-$SOURCE ]; then echo "Stamp installed-$SOURCE exists - skipping compilation!" else echo "Running 'make install'" make install >>$RAW_LOG 2>&1 # working around problem w/ jikes on arm SYSNAME=`uname -m`; case "$SYSNAME" in arm*) echo "Working around jikes on ARM problems..." cd $BASEDIR/binaries if [ ! -f classpath.tgz ]; then wget http://gadek.debian.net/classpath.tgz fi cd $BASEDIR/runtimes/classpath tar zxvf $BASEDIR/binaries/classpath.tgz ;; *);; esac fi touch $BASEDIR/stamps/installed-$SOURCE echo "SableVM GNU Classpath binaries installed." ;; *) echo "Unknown sources $SOURCE" exit 1 ;; esac echo "Binaries from $SOURCE sources installed properly." echo done cd $BASEDIR echo "ALL '$SOURCES_LIST' binaries compiled and installed properly." echo $SEPARATOR echo exit 0