summaryrefslogtreecommitdiff
path: root/scripts/scan-tools.sh
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2015-05-01 21:21:59 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2015-05-01 21:22:06 +0200
commitc183c3289ae64824a5b58810da27da6487c83ea1 (patch)
tree4ce7538c6e2a90b5d2b5af37b09fb24f6e952123 /scripts/scan-tools.sh
parenta97a53c61e818185dddf25352eb9b85aa3f2ff43 (diff)
add check for systems without shared libgcc, f.e. OpenADK musl systems
Diffstat (limited to 'scripts/scan-tools.sh')
-rw-r--r--scripts/scan-tools.sh13
1 files changed, 9 insertions, 4 deletions
diff --git a/scripts/scan-tools.sh b/scripts/scan-tools.sh
index fc2988d55..9ec5dcfc5 100644
--- a/scripts/scan-tools.sh
+++ b/scripts/scan-tools.sh
@@ -5,7 +5,6 @@ shopt -s extglob
topdir=$(pwd)
opath=$PATH
out=0
-clang=0
if [[ $NO_ERROR != @(0|1) ]]; then
echo Please do not invoke this script directly!
@@ -83,7 +82,7 @@ include ${ADK_TOPDIR}/prereq.mk
all: run-test
test: test.c
- ${HOST_CC} -o $@ $^ ${LDADD}
+ ${HOST_CC} ${HOST_CFLAGS} -o $@ $^ ${LDADD}
run-test: test
./test
@@ -97,7 +96,13 @@ cat >test.c <<-'EOF'
return (0);
}
EOF
-X=$($makecmd ADK_TOPDIR=$topdir 2>&1)
+X=$($makecmd ADK_TOPDIR=$topdir LDADD=-lgcc 2>&1)
+if [[ $X != *@(Native compiler works)* ]]; then
+ echo Cannot compile with shared libgcc use static one.
+ HOST_CFLAGS=-static-libgcc
+fi
+
+X=$($makecmd ADK_TOPDIR=$topdir HOST_CFLAGS=${HOST_CFLAGS} 2>&1)
if [[ $X != *@(Native compiler works)* ]]; then
echo "$X" | sed 's/^/| /'
echo Cannot compile a simple test programme.
@@ -149,7 +154,7 @@ cat >test.c <<-'EOF'
}
EOF
X=$(echo 'Yay! Native compiler works.' | gzip | \
- $makecmd ADK_TOPDIR=$topdir LDADD=-lz 2>&1)
+ $makecmd ADK_TOPDIR=$topdir LDADD=-lz HOST_CFLAGS=${HOST_CFLAGS} 2>&1)
if [[ $X != *@(Native compiler works)* ]]; then
echo "$X" | sed 's/^/| /'
echo Cannot compile a libz test programm.