aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMatias Elo <matias.elo@nokia.com>2020-12-04 08:18:51 +0200
committerPetri Savolainen <petri.savolainen@nokia.com>2020-12-04 16:27:31 +0200
commitbc7014fe308c9f8d221c5788177e3455d60d7930 (patch)
tree53cc0adf603e326339e4c00c909525468359f0eb /scripts
parentba686ce20a3132ffb8a18689496267f2b46353e4 (diff)
ci: add build script for riscv64 architecture
Add build script for 64-bit RISC-V architecture. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/ci/build_riscv64.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/ci/build_riscv64.sh b/scripts/ci/build_riscv64.sh
new file mode 100755
index 000000000..474633727
--- /dev/null
+++ b/scripts/ci/build_riscv64.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+set -e
+
+export TARGET_ARCH=riscv64-linux-gnu
+if [ "${CC#clang}" != "${CC}" ] ; then
+ export CC="clang --target=${TARGET_ARCH}"
+ export CXX="clang++ --target=${TARGET_ARCH}"
+else
+ export CC="${TARGET_ARCH}-gcc"
+ export CXX="${TARGET_ARCH}-g++"
+fi
+
+# Use target libraries
+export PKG_CONFIG_PATH=
+export PKG_CONFIG_LIBDIR=/usr/lib/${TARGET_ARCH}/pkgconfig
+
+cd "$(dirname "$0")"/../..
+./bootstrap
+./configure \
+ --host=${TARGET_ARCH} --build=x86_64-linux-gnu \
+ --prefix=/opt/odp \
+ ${CONF}
+
+make clean
+
+make -j $(nproc)
+
+make install
+
+pushd ${HOME}
+${CC} ${CFLAGS} ${OLDPWD}/example/hello/odp_hello.c -o odp_hello_inst_dynamic `PKG_CONFIG_PATH=/opt/odp/lib/pkgconfig:${PKG_CONFIG_PATH} pkg-config --cflags --libs libodp-linux`
+popd