summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2015-05-02 08:54:05 +0200
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2015-05-02 08:54:05 +0200
commitcde74d4ade7cb739a35a0cfc3e3e3465a9b14669 (patch)
tree1e1ecf472831191b110cbf8447643bf7bf11d89d /scripts
parentea8f054f819ba3461bf2caeb0a840476ee021d6a (diff)
parent7fddef375385fb46a27507472a5f9ca8b1d66fab (diff)
Merge branch 'master' of git+ssh://openadk.org/git/openadk
Diffstat (limited to 'scripts')
-rw-r--r--scripts/scan-tools.sh23
1 files changed, 14 insertions, 9 deletions
diff --git a/scripts/scan-tools.sh b/scripts/scan-tools.sh
index 1afdb6c64..7c0e89cea 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!
@@ -61,7 +60,6 @@ OpenBSD)
fi
;;
Darwin*)
- clang=1
;;
*)
# unsupported
@@ -79,16 +77,12 @@ else
makecmd=$(which gmake 2>/dev/null )
fi
-if [ $clang -ne 1 ];then
-HCFLAGS=-static-libgcc
-fi
-
cat >Makefile <<'EOF'
include ${ADK_TOPDIR}/prereq.mk
all: run-test
test: test.c
- ${HOST_CC} $(HCFLAGS) -o $@ $^ ${LDADD}
+ ${HOST_CC} ${HOST_CFLAGS} -o $@ $^ ${LDADD}
run-test: test
./test
@@ -102,7 +96,18 @@ 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
+ echo "HOST_CFLAGS:=-O0 -g0 -static-libgcc" >> $topdir/prereq.mk
+ echo "HOST_CXXFLAGS:=-O0 -g0 -static-libgcc" >> $topdir/prereq.mk
+else
+ echo "HOST_CFLAGS:=-O0 -g0" >> $topdir/prereq.mk
+ echo "HOST_CXXFLAGS:=-O0 -g0" >> $topdir/prereq.mk
+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.
@@ -154,7 +159,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.