From f3a04a46dacb5ae61d9fb8f8dc65bfb7e96a501b Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 26 Jul 2022 02:52:00 +0200 Subject: Update scripts, analog to jaulib v0.14.0-37-g8e76c99 - example symlinks: remove prefix 'run-' - can invoke from project root dir like in jaulib and cipherlib - using {build|dist}-OS_NAME-ARCHABI for multi OS support --- scripts/rebuild.sh | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'scripts/rebuild.sh') diff --git a/scripts/rebuild.sh b/scripts/rebuild.sh index 997a5f42..91ed854b 100644 --- a/scripts/rebuild.sh +++ b/scripts/rebuild.sh @@ -4,21 +4,11 @@ sdir=`dirname $(readlink -f $0)` rootdir=`dirname $sdir` bname=`basename $0 .sh` -. $sdir/setup-machine-arch.sh +. $rootdir/jaulib/scripts/setup-machine-arch.sh -logfile=$rootdir/$bname-$archabi.log +logfile=$rootdir/$bname-$os_name-$archabi.log rm -f $logfile -if [ -e /usr/lib/jvm/java-17-openjdk-$archabi ] ; then - export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-$archabi -elif [ -e /usr/lib/jvm/java-11-openjdk-$archabi ] ; then - export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-$archabi -fi -if [ ! -e $JAVA_HOME ] ; then - echo $JAVA_HOME does not exist - exit 1 -fi - CPU_COUNT=`getconf _NPROCESSORS_ONLN` # run 'dpkg-reconfigure locales' enable 'en_US.UTF-8' @@ -26,18 +16,28 @@ export LANG=en_US.UTF-8 export LC_MEASUREMENT=en_US.UTF-8 buildit() { + if [ -z "$JAVA_HOME" -o ! -e "$JAVA_HOME" ] ; then + echo "WARNING: JAVA_HOME $JAVA_HOME does not exist" + else + echo JAVA_HOME $JAVA_HOME + fi echo rootdir $rootdir echo logfile $logfile echo CPU_COUNT $CPU_COUNT - cd $rootdir/build-$archabi + dist_dir="dist-$os_name-$archabi" + build_dir="build-$os_name-$archabi" + echo dist_dir $dist_dir + echo build_dir $build_dir + + cd $rootdir/$build_dir make -j $CPU_COUNT install if [ $? -eq 0 ] ; then - echo "REBUILD SUCCESS $bname $archabi" + echo "REBUILD SUCCESS $bname $os_name $archabi" cd $rootdir return 0 else - echo "REBUILD FAILURE $bname $archabi" + echo "REBUILD FAILURE $bname $os_name $archabi" cd $rootdir return 1 fi -- cgit v1.2.3