diff options
author | Sven Gothel <[email protected]> | 2020-10-16 16:08:23 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-10-16 16:08:23 +0200 |
commit | d5c6787a8d7e9c123b6c30dd877af58057df4204 (patch) | |
tree | d719b90b1a374de02f354faa2fdeac19e762b7ce /scripts | |
parent | da13a199446d143732cc6d0d996501bac1c1d4f8 (diff) |
Move jaucpp files to root-folder
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/build-doc.sh | 43 | ||||
-rw-r--r-- | scripts/build.sh | 45 | ||||
-rw-r--r-- | scripts/rebuild.sh | 38 | ||||
-rw-r--r-- | scripts/setup-machine-arch.sh | 41 |
4 files changed, 167 insertions, 0 deletions
diff --git a/scripts/build-doc.sh b/scripts/build-doc.sh new file mode 100644 index 0000000..ae4c816 --- /dev/null +++ b/scripts/build-doc.sh @@ -0,0 +1,43 @@ +#! /bin/sh + +sdir=`dirname $(readlink -f $0)` +rootdir=`dirname $sdir` +bname=`basename $0 .sh` +logfile=$bname.log +rm -f $logfile + +. $sdir/setup-machine-arch.sh + +export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-$archabi +if [ ! -e $JAVA_HOME ] ; then + echo $JAVA_HOME does not exist + exit 1 +fi + +buildit() { + echo rootdir $rootdir + echo logfile $logfile + + cd $rootdir + rm -rf dist-$archabi + mkdir -p dist-$archabi/bin + rm -rf build-$archabi + mkdir -p build-$archabi + cd build-$archabi + # cmake -DCMAKE_INSTALL_PREFIX=$rootdir/dist-$archabi -DBUILDJAVA=ON -DBUILDEXAMPLES=ON -DBUILD_TESTING=ON .. + cmake -DCMAKE_INSTALL_PREFIX=$rootdir/dist-$archabi -DBUILDJAVA=ON -DBUILDEXAMPLES=ON -DBUILD_TESTING=ON -DDEBUG=ON .. + # cmake -DCMAKE_INSTALL_PREFIX=$rootdir/dist-$archabi -DSKIP_TINYB=ON -DBUILDJAVA=ON -DBUILDEXAMPLES=ON -DBUILD_TESTING=ON -DDEBUG=ON .. + #make install test + make doc + if [ $? -eq 0 ] ; then + echo "BUILD SUCCESS $bname $archabi" + cd $rootdir + return 0 + else + echo "BUILD FAILURE $bname $archabi" + cd $rootdir + return 1 + fi +} + +buildit 2>&1 | tee $logfile diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100644 index 0000000..1a4da03 --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,45 @@ +#! /bin/sh + +sdir=`dirname $(readlink -f $0)` +rootdir=`dirname $sdir` +bname=`basename $0 .sh` +logfile=$bname.log +rm -f $logfile + +. $sdir/setup-machine-arch.sh + +export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-$archabi +if [ ! -e $JAVA_HOME ] ; then + echo $JAVA_HOME does not exist + exit 1 +fi + +CPU_COUNT=`getconf _NPROCESSORS_ONLN` + +buildit() { + echo rootdir $rootdir + echo logfile $logfile + echo CPU_COUNT $CPU_COUNT + + cd $rootdir + rm -rf dist-$archabi + mkdir -p dist-$archabi/bin + rm -rf build-$archabi + mkdir -p build-$archabi + cd build-$archabi + # CLANG_ARGS="-DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++" + cmake $CLANG_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/dist-$archabi -DBUILDJAVA=ON -DBUILDEXAMPLES=ON -DBUILD_TESTING=ON .. + # cmake $CLANG_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/dist-$archabi -DBUILDJAVA=ON -DBUILDEXAMPLES=ON -DBUILD_TESTING=ON -DDEBUG=ON .. + make -j $CPU_COUNT install test + if [ $? -eq 0 ] ; then + echo "BUILD SUCCESS $bname $archabi" + cd $rootdir + return 0 + else + echo "BUILD FAILURE $bname $archabi" + cd $rootdir + return 1 + fi +} + +buildit 2>&1 | tee $logfile diff --git a/scripts/rebuild.sh b/scripts/rebuild.sh new file mode 100644 index 0000000..b41214a --- /dev/null +++ b/scripts/rebuild.sh @@ -0,0 +1,38 @@ +#! /bin/sh + +sdir=`dirname $(readlink -f $0)` +rootdir=`dirname $sdir` +bname=`basename $0 .sh` +logfile=$bname.log +rm -f $logfile + +. $sdir/setup-machine-arch.sh + +export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-$archabi +if [ ! -e $JAVA_HOME ] ; then + echo $JAVA_HOME does not exist + exit 1 +fi + +CPU_COUNT=`getconf _NPROCESSORS_ONLN` + +buildit() { + echo rootdir $rootdir + echo logfile $logfile + echo CPU_COUNT $CPU_COUNT + + cd $rootdir/build-$archabi + make -j $CPU_COUNT install test + if [ $? -eq 0 ] ; then + echo "REBUILD SUCCESS $bname $archabi" + cd $rootdir + return 0 + else + echo "REBUILD FAILURE $bname $archabi" + cd $rootdir + return 1 + fi +} + +buildit 2>&1 | tee $logfile + diff --git a/scripts/setup-machine-arch.sh b/scripts/setup-machine-arch.sh new file mode 100644 index 0000000..df6c644 --- /dev/null +++ b/scripts/setup-machine-arch.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +machine=`uname -m` + +case "$machine" in + "arm") + cpu="arm" + cpufamily="arm" + archabi="armhf" + syslibdir="arm-linux-gnueabihf" + ;; + "armv7l") + cpu="armv7l" + cpufamily="arm" + archabi="armhf" + syslibdir="arm-linux-gnueabihf" + ;; + "aarch64") + cpu="aarch64" + cpufamily="arm" + archabi="arm64" + syslibdir="aarch64-linux-gnu" + ;; + "x86_64") + cpu="x86_64" + cpufamily="x86" + archabi="amd64" + syslibdir="x86_64-linux-gnu" + ;; + *) + echo "Unsupported machine $machine" + exit 1 + ;; +esac + +echo machine $machine +echo cpu $cpu +echo cpufamily $cpufamily +echo archabi $archabi +echo syslibdir $syslibdir + |