aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.vscode/jaulib.code-workspace_example5
-rw-r--r--.vscode/settings.json12
-rw-r--r--CMakePresets.json48
-rw-r--r--README.md58
-rw-r--r--scripts/build-clang.sh92
-rwxr-xr-xscripts/build-preset-cross.sh (renamed from scripts/build-cross.sh)12
-rwxr-xr-xscripts/build-preset.sh81
-rw-r--r--scripts/build.sh92
-rw-r--r--scripts/rebuild-clang.sh57
-rwxr-xr-xscripts/rebuild-preset-cross.sh (renamed from scripts/rebuild-cross.sh)12
-rwxr-xr-x[-rw-r--r--]scripts/rebuild-preset.sh (renamed from scripts/rebuild.sh)31
11 files changed, 195 insertions, 305 deletions
diff --git a/.vscode/jaulib.code-workspace_example b/.vscode/jaulib.code-workspace_example
index 6350256..280acea 100644
--- a/.vscode/jaulib.code-workspace_example
+++ b/.vscode/jaulib.code-workspace_example
@@ -29,7 +29,7 @@
// "java.format.settings.profile": "GoogleStyle",
"java.codeGeneration.useBlocks": true,
"java.inlayHints.parameterNames.enabled": "literals",
- "java.configuration.runtimes": [
+ "java.configuration.runtimes": [
{
"name": "JavaSE-17",
"path": "/usr/lib/jvm/java-17-openjdk-amd64",
@@ -67,7 +67,8 @@
"ShortcutMenuBar.userButton02Command": "clangd.memoryUsage",
"ShortcutMenuBar.userButton03Command": "workbench.action.reloadWindow",
"ShortcutMenuBar.userButton04Command": "clangd.restart",
- "clang-tidy.buildPath": "${workspaceFolder}/build-vscode",
+ // "clang-tidy.buildPath": "${workspaceFolder}/build/default",
+ // "C_Cpp.default.cppStandard": "c++20",
},
"extensions": {
"recommendations": [
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 42d13e6..80f33b5 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -7,18 +7,8 @@
"cmake.configureOnOpen": true,
"cmake.copyCompileCommands": "${workspaceFolder}/compile_commands.json",
"cmake.sourceDirectory": "${workspaceFolder}",
- "cmake.buildDirectory": "${workspaceFolder}/build-vscode",
"cmake.configureArgs": [
- "-DCMAKE_INSTALL_PREFIX=${workspaceFolder}/dist-vscode",
- "-DCMAKE_C_COMPILER=/usr/bin/clang",
- "-DCMAKE_CXX_COMPILER=/usr/bin/clang++",
- "-DCMAKE_CXX_STANDARD=20",
- "-DCMAKE_CXX_CLANG_TIDY=/usr/bin/clang-tidy;-p;${workspaceFolder}/build-vscode",
- "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON",
- "-DBUILD_TESTING=ON",
- "-DBUILDJAVA=ON",
- "-DUSE_LIBUNWIND=ON",
- "-DUSE_LIBCURL=ON"
+ "-DJAU_CMAKE_ENFORCE_PRESETS=ON"
],
"clangd.arguments": [
"--background-index",
diff --git a/CMakePresets.json b/CMakePresets.json
index 1e59945..e88a812 100644
--- a/CMakePresets.json
+++ b/CMakePresets.json
@@ -29,6 +29,7 @@
"displayName": "Debug (clang, clang-tidy, C++20, java)",
"binaryDir": "${sourceDir}/build/preset-debug-clang",
"cacheVariables": {
+ "CMAKE_INSTALL_PREFIX": "dist/preset-debug-clang",
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++",
"CMAKE_CXX_CLANG_TIDY": "clang-tidy;-p;${sourceDir}/build/preset-debug-clang"
@@ -40,6 +41,7 @@
"displayName": "Debug (gcc, C++20, java)",
"binaryDir": "${sourceDir}/build/preset-debug-gcc",
"cacheVariables": {
+ "CMAKE_INSTALL_PREFIX": "dist/preset-debug-gcc",
"CMAKE_C_COMPILER": "gcc",
"CMAKE_CXX_COMPILER": "g++"
}
@@ -62,6 +64,7 @@
"displayName": "Release (clang, clang-tidy, C++20, java)",
"binaryDir": "${sourceDir}/build/preset-release-clang",
"cacheVariables": {
+ "CMAKE_INSTALL_PREFIX": "dist/preset-release-clang",
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++",
"CMAKE_CXX_CLANG_TIDY": "clang-tidy;-p;${sourceDir}/build/preset-release-clang"
@@ -73,9 +76,20 @@
"displayName": "Release (gcc, C++20, java)",
"binaryDir": "${sourceDir}/build/preset-release-gcc",
"cacheVariables": {
+ "CMAKE_INSTALL_PREFIX": "dist/preset-release-gcc",
"CMAKE_C_COMPILER": "gcc",
"CMAKE_CXX_COMPILER": "g++"
}
+ },
+ {
+ "name": "default",
+ "inherits": "debug-clang",
+ "displayName": "Default (debug-clang)",
+ "binaryDir": "${sourceDir}/build/default",
+ "cacheVariables": {
+ "CMAKE_INSTALL_PREFIX": "dist/default",
+ "CMAKE_CXX_CLANG_TIDY": "clang-tidy;-p;${sourceDir}/build/default"
+ }
}
],
"buildPresets": [
@@ -84,24 +98,28 @@
"configurePreset": "debug"
},
{
- "name": "debug-gcc",
- "configurePreset": "debug-gcc"
- },
- {
"name": "debug-clang",
"configurePreset": "debug-clang"
},
{
+ "name": "debug-gcc",
+ "configurePreset": "debug-gcc"
+ },
+ {
"name": "release",
"configurePreset": "release"
},
{
+ "name": "release-clang",
+ "configurePreset": "release-clang"
+ },
+ {
"name": "release-gcc",
"configurePreset": "release-gcc"
},
{
- "name": "release-clang",
- "configurePreset": "release-clang"
+ "name": "default",
+ "configurePreset": "default"
}
],
"testPresets": [
@@ -112,14 +130,14 @@
"execution": {"noTestsAction": "error", "stopOnFailure": true}
},
{
- "name": "debug-gcc",
- "configurePreset": "debug-gcc",
+ "name": "debug-clang",
+ "configurePreset": "debug-clang",
"output": {"outputOnFailure": true},
"execution": {"noTestsAction": "error", "stopOnFailure": true}
},
{
- "name": "debug-clang",
- "configurePreset": "debug-clang",
+ "name": "debug-gcc",
+ "configurePreset": "debug-gcc",
"output": {"outputOnFailure": true},
"execution": {"noTestsAction": "error", "stopOnFailure": true}
},
@@ -130,14 +148,20 @@
"execution": {"noTestsAction": "error", "stopOnFailure": true}
},
{
+ "name": "release-clang",
+ "configurePreset": "release-clang",
+ "output": {"outputOnFailure": true},
+ "execution": {"noTestsAction": "error", "stopOnFailure": true}
+ },
+ {
"name": "release-gcc",
"configurePreset": "release-gcc",
"output": {"outputOnFailure": true},
"execution": {"noTestsAction": "error", "stopOnFailure": true}
},
{
- "name": "release-clang",
- "configurePreset": "release-clang",
+ "name": "default",
+ "configurePreset": "default",
"output": {"outputOnFailure": true},
"execution": {"noTestsAction": "error", "stopOnFailure": true}
}
diff --git a/README.md b/README.md
index 9c588a3..dc065cd 100644
--- a/README.md
+++ b/README.md
@@ -238,24 +238,40 @@ Following debug presets are defined in `CMakePresets.json`
- libcurl (if available)
- testing on
- testing with sudo off
-- `debug-gcc`
- - inherits from `debug`
- - compiler: `gcc`
- - disabled `clang-tidy`
+ - binary-dir `build/preset-debug`
+ - install-dir `dist/preset-debug`
- `debug-clang`
- inherits from `debug`
- compiler: `clang`
- enabled `clang-tidy`
+ - binary-dir `build/preset-debug-clang`
+ - install-dir `dist/preset-debug-clang`
+- `debug-gcc`
+ - inherits from `debug`
+ - compiler: `gcc`
+ - disabled `clang-tidy`
+ - binary-dir `build/preset-debug-gcc`
+ - install-dir `dist/preset-debug-gcc`
- `release`
- inherits from `debug`
- debug disabled
- testing with sudo on
-- `release-gcc`
- - compiler: `gcc`
- - disabled `clang-tidy`
+ - binary-dir `build/preset-release`
+ - install-dir `dist/preset-release`
- `release-clang`
- compiler: `clang`
- enabled `clang-tidy`
+ - binary-dir `build/preset-release-gcc`
+ - install-dir `dist/preset-release-gcc`
+- `release-gcc`
+ - compiler: `gcc`
+ - disabled `clang-tidy`
+ - binary-dir `build/preset-release-gcc`
+ - install-dir `dist/preset-release-gcc`
+- **`default`**
+ - inherits from `debug-clang`
+ - binary-dir `build/default`
+ - install-dir `dist/default`
Kick-off the workflow by e.g. using preset `release-gcc` to configure, build, test, install and building documentation.
You may skip `install` and `doc_jau` by dropping it from `--target`.
@@ -265,6 +281,8 @@ cmake --build --preset release-gcc --parallel
cmake --build --preset release-gcc --target test install doc_jau
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+You may utilize `scripts/build-preset.sh` for an initial build, install and test workflow.
+
<a name="cmake_presets_hardcoded"></a>
#### CMake Build via Hardcoded Presets
@@ -398,20 +416,21 @@ Override default javac debug arguments `source,lines`:
-DJAVAC_DEBUG_ARGS="none"
~~~~~~~~~~~~~
-#### Deprecated Build Scripts
-You may also invoke `scripts/build.sh`,
-which resolves installed environment variables like `JAVA_HOME` and `JUNIT_CP`
-as well as building and distributing using `os_arch` type folders.
+#### Build Scripts
+Build scripts use the recommended [cmake presets](README.md#cmake_presets_optional),
+supported via e.g. `scripts/build-preset.sh`.
+
- `scripts/setup-machine-arch.sh` .. generic setup for all scripts
-- `scripts/build.sh` .. initial build incl. install and unit testing
-- `scripts/rebuild.sh` .. rebuild
-- `scripts/build-cross.sh` .. [cross-build](#cross-build)
-- `scripts/rebuild-cross.sh` .. [cross-build](#cross-build)
+- `scripts/setup-emscripten.sh` .. emscripten setup
+- `scripts/build-preset.sh` .. initial build incl. install and unit testing using [presets](README.md#cmake_presets_optional)
+- `scripts/rebuild-preset.sh` .. rebuild using [presets](README.md#cmake_presets_optional)
+- `scripts/build-preset-cross.sh` .. [cross-build](#cross-build) using [presets](README.md#cmake_presets_optional)
+- `scripts/rebuild-preset-cross.sh` .. [cross-build](#cross-build) using [presets](README.md#cmake_presets_optional)
- `scripts/test_java.sh` .. invoke a java unit test
- `scripts/test_exe_template.sh` .. invoke the symlink'ed files to invoke native unit tests
### Cross Build
-Also provided is a [cross-build script](https://jausoft.com/cgit/jaulib.git/tree/scripts/build-cross.sh)
+Also provided is a [cross-build script](https://jausoft.com/cgit/jaulib.git/tree/scripts/build-preset-cross.sh)
using chroot into a target system using [QEMU User space emulation](https://qemu-project.gitlab.io/qemu/user/main.html)
and [Linux kernel binfmt_misc](https://wiki.debian.org/QemuUserEmulation)
to run on other architectures than the host.
@@ -478,9 +497,10 @@ vi ../jaulib.code-workspace
~~~~~~~~~~~~~
Then you can open it via `File . Open Workspace from File...` menu item.
- All listed extensions are referenced in this workspace file to be installed via the IDE
-- The [local settings.json](.vscode/settings.json) has `clang-tidy` enabled
- - If using `clang-tidy` is too slow, just remove it from the settings file.
- - `clangd` will still contain a good portion of `clang-tidy` checks
+- Select one of the [CMake Presets](README.md#cmake_presets_optional) for
+ - Configuration
+ - Build
+ - Test
## Changes
diff --git a/scripts/build-clang.sh b/scripts/build-clang.sh
deleted file mode 100644
index ef40635..0000000
--- a/scripts/build-clang.sh
+++ /dev/null
@@ -1,92 +0,0 @@
-#! /bin/sh
-
-sdir=`dirname $(readlink -f $0)`
-rootdir=`dirname $sdir`
-bname=`basename $0 .sh`
-
-. $sdir/setup-machine-arch.sh
-
-tripleid="$os_name-$archabi-clang"
-
-logfile=$rootdir/$bname-$tripleid.log
-rm -f $logfile
-
-CPU_COUNT=`getconf _NPROCESSORS_ONLN`
-
-# run as root 'dpkg-reconfigure locales' enable 'en_US.UTF-8'
-# perhaps run as root 'update-locale LC_MEASUREMENT=en_US.UTF-8 LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8'
-export LC_MEASUREMENT=en_US.UTF-8
-export LC_ALL=en_US.UTF-8
-export LANG=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
-
- dist_dir="dist-$tripleid"
- build_dir="build-$tripleid"
- echo dist_dir $dist_dir
- echo build_dir $build_dir
-
- if [ -x /usr/bin/time ] ; then
- time_cmd="time"
- echo "time command available: ${time_cmd}"
- else
- time_cmd=""
- echo "time command not available"
- fi
-
- cd $rootdir
- rm -rf $dist_dir
- mkdir -p $dist_dir
- rm -rf $build_dir
- mkdir -p $build_dir
- cd $build_dir
- # CLANG_ARGS="-DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++"
- CLANG_ARGS="-DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_CXX_CLANG_TIDY=/usr/bin/clang-tidy;-p;$rootdir/$build_dir"
- CXX_ARGS="-DCMAKE_CXX_STANDARD=20"
-
- # cmake $CLANG_ARGS $CXX_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILD_TESTING=ON -DUSE_LIBUNWIND=ON ..
- # cmake $CLANG_ARGS $CXX_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILD_TESTING=ON -DUSE_LIBUNWIND=ON -DUSE_LIBCURL=ON ..
-
- cmake $CLANG_ARGS $CXX_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILD_TESTING=ON -DUSE_LIBUNWIND=ON -DUSE_LIBCURL=ON -DTEST_WITH_SUDO=ON ..
- # cmake $CLANG_ARGS $CXX_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILD_TESTING=ON -DUSE_LIBUNWIND=ON -DUSE_LIBCURL=ON -DTEST_WITH_SUDO=ON -DDONT_USE_RTTI=ON ..
- # cmake $CLANG_ARGS $CXX_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILD_TESTING=ON -DUSE_LIBUNWIND=ON -DUSE_LIBCURL=ON -DTEST_WITH_SUDO=ON -DDEBUG=ON ..
-
- # cmake $CLANG_ARGS $CXX_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILD_TESTING=ON ..
- # cmake $CLANG_ARGS $CXX_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILD_TESTING=ON -DDEBUG=ON ..
-
- # cmake $CLANG_ARGS $CXX_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILD_TESTING=ON -DUSE_STRIP=OFF ..
- # cmake $CLANG_ARGS $CXX_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILD_TESTING=ON -DUSE_STRIP=ON -DJAVAC_DEBUG_ARGS="none" ..
- # cmake $CLANG_ARGS $CXX_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILD_TESTING=ON -DGPROF=ON ..
- # cmake $CLANG_ARGS $CXX_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILD_TESTING=ON -DPERF_ANALYSIS=ON ..
- # cmake $CLANG_ARGS $CXX_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILD_TESTING=ON -DDEBUG=ON -DINSTRUMENTATION=ON ..
- # cmake $CLANG_ARGS $CXX_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILD_TESTING=ON -DDEBUG=ON -DINSTRUMENTATION_UNDEFINED=ON ..
- # cmake $CLANG_ARGS $CXX_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILD_TESTING=ON -DDEBUG=ON -DINSTRUMENTATION_THREAD=ON ..
- ${time_cmd} make -j $CPU_COUNT install
- if [ $? -eq 0 ] ; then
- echo "BUILD SUCCESS $bname $tripleid"
- ${time_cmd} make test
- if [ $? -eq 0 ] ; then
- echo "TEST SUCCESS $bname $tripleid"
- cd $rootdir
- return 0
- else
- echo "TEST FAILURE $bname $tripleid"
- cd $rootdir
- return 1
- fi
- else
- echo "BUILD FAILURE $bname $tripleid"
- cd $rootdir
- return 1
- fi
-}
-
-buildit 2>&1 | tee $logfile
diff --git a/scripts/build-cross.sh b/scripts/build-preset-cross.sh
index efae547..2ec2dfa 100755
--- a/scripts/build-cross.sh
+++ b/scripts/build-preset-cross.sh
@@ -3,11 +3,11 @@
#
# sudo mkdir -p /mnt/arm64
# sudo mount /data/diskimages/RaspiArm64LightDev-1.3-rw-deb11-arm64-litexdev.root-ext4.img /mnt/arm64
-# scripts/build-cross.sh /mnt/arm64
+# scripts/build-preset-cross.sh /mnt/arm64 debug-clang
#
# sudo mkdir -p /mnt/arm32
# sudo mount /data/diskimages/RaspiArm32LightDev-1.2-rw-deb10-armhf-litexdev.root-ext4.img /mnt/arm32
-# scripts/build-cross.sh /mnt/arm32
+# scripts/build-preset-cross.sh /mnt/arm32 debug-clang
#
sdir=`dirname $(readlink -f $0)`
@@ -20,12 +20,14 @@ echo parentdir ${parentdir}
export ROOTFS_DIR=$1
shift 1
+export preset_name=$1
+shift 1
-if [ -z "${ROOTFS_DIR}" ]; then
- echo Usage "$0 <rootfs-dir>"
+if [ -z "${ROOTFS_DIR}" -o -z "${preset_name}" ]; then
+ echo Usage "$0 <rootfs-dir> <preset_name-name>"
exit 1
fi
${sdir}/on_chroot.sh ${ROOTFS_DIR} << EOF
- sh ${sdir}/build.sh
+ sh ${sdir}/build-preset.sh ${preset_name}
EOF
diff --git a/scripts/build-preset.sh b/scripts/build-preset.sh
new file mode 100755
index 0000000..c2f3fd7
--- /dev/null
+++ b/scripts/build-preset.sh
@@ -0,0 +1,81 @@
+#! /bin/sh
+
+sdir=`dirname $(readlink -f $0)`
+rootdir=`dirname $sdir`
+bname=`basename $0 .sh`
+
+. $sdir/setup-machine-arch.sh
+
+tripleid="$os_name-$archabi-gcc"
+
+if [ ! -z "$1" ] ; then
+ preset_name=$1
+ shift 1
+else
+ echo "ERROR: No preset passed as 1st argument, use one of:"
+ cmake --list-presets
+ return 1
+fi
+
+logfile=$rootdir/${bname}-${preset_name}-${tripleid}.log
+rm -f $logfile
+
+CPU_COUNT=`getconf _NPROCESSORS_ONLN`
+
+# run as root 'dpkg-reconfigure locales' enable 'en_US.UTF-8'
+# perhaps run as root 'update-locale LC_MEASUREMENT=en_US.UTF-8 LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8'
+export LC_MEASUREMENT=en_US.UTF-8
+export LC_ALL=en_US.UTF-8
+export LANG=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
+
+ dist_dir="dist/preset-${preset_name}"
+ build_dir="build/preset-${preset_name}"
+ echo dist_dir $dist_dir
+ echo build_dir $build_dir
+
+ if [ -x /usr/bin/time ] ; then
+ time_cmd="time"
+ echo "time command available: ${time_cmd}"
+ else
+ time_cmd=""
+ echo "time command not available"
+ fi
+
+ cd $rootdir
+ rm -rf $dist_dir
+ mkdir -p $dist_dir
+ rm -rf $build_dir
+ mkdir -p $build_dir
+
+ cmake --preset ${preset_name}
+
+ # ${time_cmd} cmake --build --preset ${preset_name} --parallel $CPU_COUNT --target test install doc_jau
+ # ${time_cmd} cmake --build --preset ${preset_name} --parallel $CPU_COUNT
+ ${time_cmd} cmake --build --preset ${preset_name} --parallel $CPU_COUNT --target install
+ if [ $? -eq 0 ] ; then
+ echo "BUILD SUCCESS $bname $tripleid"
+ ${time_cmd} cmake --build --preset ${preset_name} --target test
+ if [ $? -eq 0 ] ; then
+ echo "TEST SUCCESS $bname $tripleid"
+ return 0
+ else
+ echo "TEST FAILURE $bname $tripleid"
+ return 1
+ fi
+ else
+ echo "BUILD FAILURE $bname $tripleid"
+ return 1
+ fi
+}
+
+buildit 2>&1 | tee $logfile
diff --git a/scripts/build.sh b/scripts/build.sh
deleted file mode 100644
index 82abc1f..0000000
--- a/scripts/build.sh
+++ /dev/null
@@ -1,92 +0,0 @@
-#! /bin/sh
-
-sdir=`dirname $(readlink -f $0)`
-rootdir=`dirname $sdir`
-bname=`basename $0 .sh`
-
-. $sdir/setup-machine-arch.sh
-
-tripleid="$os_name-$archabi-gcc"
-
-logfile=$rootdir/$bname-$tripleid.log
-rm -f $logfile
-
-CPU_COUNT=`getconf _NPROCESSORS_ONLN`
-
-# run as root 'dpkg-reconfigure locales' enable 'en_US.UTF-8'
-# perhaps run as root 'update-locale LC_MEASUREMENT=en_US.UTF-8 LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8'
-export LC_MEASUREMENT=en_US.UTF-8
-export LC_ALL=en_US.UTF-8
-export LANG=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
-
- dist_dir="dist-$tripleid"
- build_dir="build-$tripleid"
- echo dist_dir $dist_dir
- echo build_dir $build_dir
-
- if [ -x /usr/bin/time ] ; then
- time_cmd="time"
- echo "time command available: ${time_cmd}"
- else
- time_cmd=""
- echo "time command not available"
- fi
-
- cd $rootdir
- rm -rf $dist_dir
- mkdir -p $dist_dir
- rm -rf $build_dir
- mkdir -p $build_dir
- cd $build_dir
- # CLANG_ARGS="-DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++"
- # CLANG_ARGS="-DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_CXX_CLANG_TIDY=/usr/bin/clang-tidy;-p;$rootdir/$build_dir"
- CXX_ARGS="-DCMAKE_CXX_STANDARD=20"
-
- # cmake $CLANG_ARGS $CXX_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILD_TESTING=ON -DUSE_LIBUNWIND=ON ..
- # cmake $CLANG_ARGS $CXX_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILD_TESTING=ON -DUSE_LIBUNWIND=ON -DUSE_LIBCURL=ON ..
-
- cmake $CLANG_ARGS $CXX_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILD_TESTING=ON -DUSE_LIBUNWIND=ON -DUSE_LIBCURL=ON -DTEST_WITH_SUDO=ON ..
- # cmake $CLANG_ARGS $CXX_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILD_TESTING=ON -DUSE_LIBUNWIND=ON -DUSE_LIBCURL=ON -DTEST_WITH_SUDO=ON -DDONT_USE_RTTI=ON ..
- # cmake $CLANG_ARGS $CXX_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILD_TESTING=ON -DUSE_LIBUNWIND=ON -DUSE_LIBCURL=ON -DTEST_WITH_SUDO=ON -DDEBUG=ON ..
-
- # cmake $CLANG_ARGS $CXX_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILD_TESTING=ON ..
- # cmake $CLANG_ARGS $CXX_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILD_TESTING=ON -DDEBUG=ON ..
-
- # cmake $CLANG_ARGS $CXX_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILD_TESTING=ON -DUSE_STRIP=OFF ..
- # cmake $CLANG_ARGS $CXX_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILD_TESTING=ON -DUSE_STRIP=ON -DJAVAC_DEBUG_ARGS="none" ..
- # cmake $CLANG_ARGS $CXX_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILD_TESTING=ON -DGPROF=ON ..
- # cmake $CLANG_ARGS $CXX_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILD_TESTING=ON -DPERF_ANALYSIS=ON ..
- # cmake $CLANG_ARGS $CXX_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILD_TESTING=ON -DDEBUG=ON -DINSTRUMENTATION=ON ..
- # cmake $CLANG_ARGS $CXX_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILD_TESTING=ON -DDEBUG=ON -DINSTRUMENTATION_UNDEFINED=ON ..
- # cmake $CLANG_ARGS $CXX_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILD_TESTING=ON -DDEBUG=ON -DINSTRUMENTATION_THREAD=ON ..
- ${time_cmd} make -j $CPU_COUNT install
- if [ $? -eq 0 ] ; then
- echo "BUILD SUCCESS $bname $tripleid"
- ${time_cmd} make test
- if [ $? -eq 0 ] ; then
- echo "TEST SUCCESS $bname $tripleid"
- cd $rootdir
- return 0
- else
- echo "TEST FAILURE $bname $tripleid"
- cd $rootdir
- return 1
- fi
- else
- echo "BUILD FAILURE $bname $tripleid"
- cd $rootdir
- return 1
- fi
-}
-
-buildit 2>&1 | tee $logfile
diff --git a/scripts/rebuild-clang.sh b/scripts/rebuild-clang.sh
deleted file mode 100644
index cb94a0a..0000000
--- a/scripts/rebuild-clang.sh
+++ /dev/null
@@ -1,57 +0,0 @@
-#! /bin/sh
-
-sdir=`dirname $(readlink -f $0)`
-rootdir=`dirname $sdir`
-bname=`basename $0 .sh`
-
-. $sdir/setup-machine-arch.sh
-
-tripleid="$os_name-$archabi-clang"
-
-logfile=$rootdir/$bname-$tripleid.log
-rm -f $logfile
-
-CPU_COUNT=`getconf _NPROCESSORS_ONLN`
-
-# run 'dpkg-reconfigure locales' enable 'en_US.UTF-8'
-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
-
- dist_dir="dist-$tripleid"
- build_dir="build-$tripleid"
- echo dist_dir $dist_dir
- echo build_dir $build_dir
-
- if [ -x /usr/bin/time ] ; then
- time_cmd="time"
- echo "time command available: ${time_cmd}"
- else
- time_cmd=""
- echo "time command not available"
- fi
-
- cd $rootdir/$build_dir
- ${time_cmd} make -j $CPU_COUNT install
- if [ $? -eq 0 ] ; then
- echo "REBUILD SUCCESS $bname $tripleid"
- cd $rootdir
- return 0
- else
- echo "REBUILD FAILURE $bname $tripleid"
- cd $rootdir
- return 1
- fi
-}
-
-buildit 2>&1 | tee $logfile
-
diff --git a/scripts/rebuild-cross.sh b/scripts/rebuild-preset-cross.sh
index a28dbaa..0765679 100755
--- a/scripts/rebuild-cross.sh
+++ b/scripts/rebuild-preset-cross.sh
@@ -3,11 +3,11 @@
#
# sudo mkdir -p /mnt/arm64
# sudo mount /data/diskimages/RaspiArm64LightDev-1.2-rw-deb11-arm64-litexdev.root-ext4.img /mnt/arm64
-# scripts/build-cross.sh /mnt/arm64
+# scripts/build-preset-cross.sh /mnt/arm64 debug-clang
#
# sudo mkdir -p /mnt/arm32
# sudo mount /data/diskimages/RaspiArm32LightDev-1.2-rw-deb10-armhf-litexdev.root-ext4.img /mnt/arm32
-# scripts/build-cross.sh /mnt/arm32
+# scripts/build-preset-cross.sh /mnt/arm32 debug-clang
#
sdir=`dirname $(readlink -f $0)`
@@ -20,12 +20,14 @@ echo parentdir ${parentdir}
export ROOTFS_DIR=$1
shift 1
+export preset_name=$1
+shift 1
-if [ -z "${ROOTFS_DIR}" ]; then
- echo Usage "$0 <rootfs-dir>"
+if [ -z "${ROOTFS_DIR}" -o -z "${preset_name}" ]; then
+ echo Usage "$0 <rootfs-dir> <preset_name-name>"
exit 1
fi
${sdir}/on_chroot.sh ${ROOTFS_DIR} << EOF
- sh ${sdir}/rebuild.sh
+ sh ${sdir}/rebuild-preset.sh ${preset_name}
EOF
diff --git a/scripts/rebuild.sh b/scripts/rebuild-preset.sh
index 2a3c574..8cd45ac 100644..100755
--- a/scripts/rebuild.sh
+++ b/scripts/rebuild-preset.sh
@@ -8,14 +8,25 @@ bname=`basename $0 .sh`
tripleid="$os_name-$archabi-gcc"
-logfile=$rootdir/$bname-$tripleid.log
+if [ ! -z "$1" ] ; then
+ preset_name=$1
+ shift 1
+else
+ echo "ERROR: No preset passed as 1st argument, use one of:"
+ cmake --list-presets
+ return 1
+fi
+
+logfile=$rootdir/${bname}-${preset_name}-${tripleid}.log
rm -f $logfile
CPU_COUNT=`getconf _NPROCESSORS_ONLN`
-# run 'dpkg-reconfigure locales' enable 'en_US.UTF-8'
-export LANG=en_US.UTF-8
+# run as root 'dpkg-reconfigure locales' enable 'en_US.UTF-8'
+# perhaps run as root 'update-locale LC_MEASUREMENT=en_US.UTF-8 LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8'
export LC_MEASUREMENT=en_US.UTF-8
+export LC_ALL=en_US.UTF-8
+export LANG=en_US.UTF-8
buildit() {
if [ -z "$JAVA_HOME" -o ! -e "$JAVA_HOME" ] ; then
@@ -27,8 +38,8 @@ buildit() {
echo logfile $logfile
echo CPU_COUNT $CPU_COUNT
- dist_dir="dist-$tripleid"
- build_dir="build-$tripleid"
+ dist_dir="dist/preset-${preset_name}"
+ build_dir="build/preset-${preset_name}"
echo dist_dir $dist_dir
echo build_dir $build_dir
@@ -40,18 +51,18 @@ buildit() {
echo "time command not available"
fi
- cd $rootdir/$build_dir
- ${time_cmd} make -j $CPU_COUNT install
+ cd $rootdir
+
+ # ${time_cmd} cmake --build --preset ${preset_name} --parallel $CPU_COUNT --target test install doc_jau
+ # ${time_cmd} cmake --build --preset ${preset_name} --parallel $CPU_COUNT
+ ${time_cmd} cmake --build --preset ${preset_name} --parallel $CPU_COUNT --target install
if [ $? -eq 0 ] ; then
echo "REBUILD SUCCESS $bname $tripleid"
- cd $rootdir
return 0
else
echo "REBUILD FAILURE $bname $tripleid"
- cd $rootdir
return 1
fi
}
buildit 2>&1 | tee $logfile
-