summaryrefslogtreecommitdiff
path: root/embedded-test.sh
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2016-12-10 00:13:39 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2016-12-10 00:13:39 +0100
commit770a45593274985a7f56948555e381ef09b0fb67 (patch)
tree5383800d4a44f570c5cff816ca5cc268f98f00cb /embedded-test.sh
parent9019fbf4ab0883b1b2bdf727153fe196a2a3aa5f (diff)
add C++ basic testing of toolchain
Diffstat (limited to 'embedded-test.sh')
-rwxr-xr-xembedded-test.sh34
1 files changed, 25 insertions, 9 deletions
diff --git a/embedded-test.sh b/embedded-test.sh
index 681206e..e4d11b9 100755
--- a/embedded-test.sh
+++ b/embedded-test.sh
@@ -101,6 +101,7 @@ Explanation:
--cleandir clean OpenADK build directories before build
--clean clean OpenADK build directory for single arch
--no-clean do not clean OpenADK build directory for single arch
+ --cxx enable C++ toolchain
--static use static compilation
--ssp use smack stashing protection
--debug make debug build
@@ -120,6 +121,7 @@ update=0
verbose=0
create=0
static=0
+cxx=0
ssp=0
debug=0
skipnsim=0
@@ -135,6 +137,7 @@ while [[ $1 != -- && $1 = -* ]]; do case $1 {
(--update) update=1; shift ;;
(--create) create=1; shift ;;
(--static) static=1; shift ;;
+ (--cxx) cxx=1; shift ;;
(--ssp) ssp=1; shift ;;
(--debug) debug=1; shift ;;
(--continue) cont=1; shift ;;
@@ -185,6 +188,9 @@ fi
if [ $debug -eq 1 ]; then
rsuffix=${rsuffix}.debug
fi
+if [ $cxx -eq 1 ]; then
+ rsuffix=${rsuffix}.cxx
+fi
if [ ! -d openadk ]; then
git clone $giturl
@@ -1011,16 +1017,21 @@ EOF
cat >> $file << EOF
if [ -x /usr/bin/file ]; then
file /bin/busybox $tee
+ file /usr/bin/helloworld* $tee
fi
if [ -x /usr/bin/size ]; then
size /bin/busybox $tee
else
ls -la /bin/busybox $tee
fi
+helloworld
+helloworld.static
+helloworld-cxx
+helloworld-cxx.static
EOF
if [ $static -eq 0 ]; then
cat >> $file << EOF
-for i in \$(ls /lib/*.so|grep -v libgcc);do
+for i in \$(ls /lib/*.so 2>/dev/null|grep -v libgcc);do
if [ -x /usr/bin/size ]; then
size \$i $tee
else
@@ -1320,31 +1331,36 @@ build() {
make $DEFAULT defconfig
if [ $create -eq 1 ]; then
- printf "ADK_CREATE_TOOLCHAIN_ARCHIVE=y" >> .config
+ printf "ADK_CREATE_TOOLCHAIN_ARCHIVE=y\n" >> .config
fi
if [ $static -eq 1 ]; then
- printf "ADK_TARGET_USE_STATIC_LIBS_ONLY=y" >> .config
+ printf "ADK_TARGET_USE_STATIC_LIBS_ONLY=y\n" >> .config
+ fi
+ if [ $cxx -eq 1 ]; then
+ printf "ADK_TOOLCHAIN_WITH_CXX=y\n" >> .config
+ printf "ADK_COMPILE_LIBSTDCXX=y\n" >> .config
+ printf "ADK_PACKAGE_LIBSTDCXX=y\n" >> .config
fi
if [ $ssp -eq 1 ]; then
- printf "ADK_TARGET_USE_SSP=y" >> .config
+ printf "ADK_TARGET_USE_SSP=y\n" >> .config
fi
if [ $debug -eq 1 ]; then
- printf "ADK_DEBUG=y" >> .config
+ printf "ADK_DEBUG=y\n" >> .config
fi
if [ ! -z $threads ]; then
if [ $threads = "none" ]; then
- printf "ADK_TARGET_WITHOUT_THREADS=y" >> .config
+ printf "ADK_TARGET_WITHOUT_THREADS=y\n" >> .config
fi
if [ $threads = "lt" ]; then
- printf "ADK_TARGET_WITH_LT=y" >> .config
+ printf "ADK_TARGET_WITH_LT=y\n" >> .config
fi
if [ $threads = "nptl" ]; then
- printf "ADK_TARGET_WITH_NPTL=y" >> .config
+ printf "ADK_TARGET_WITH_NPTL=y\n" >> .config
fi
fi
for pkg in $packages; do
- p=$(echo $pkg|tr '[:lower:]' '[:upper:]'|tr - _);printf "ADK_COMPILE_$p=y\nADK_PACKAGE_$p=y" >> .config
+ p=$(echo $pkg|tr '[:lower:]' '[:upper:]'|tr - _);printf "ADK_COMPILE_$p=y\nADK_PACKAGE_$p=y\n" >> .config
done
# refresh after any changes to config