summaryrefslogtreecommitdiff
path: root/scripts/scan-tools.sh
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2015-05-02 23:11:55 +0200
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2015-05-02 23:11:55 +0200
commit7d6e8074bb64ca75f03bb3923c8e8492b72096d5 (patch)
treeeb326ab11edccadde2c0d3705eaffc0b657f657f /scripts/scan-tools.sh
parentcde74d4ade7cb739a35a0cfc3e3e3465a9b14669 (diff)
fix clang issues with -lgcc check
Diffstat (limited to 'scripts/scan-tools.sh')
-rw-r--r--scripts/scan-tools.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/scripts/scan-tools.sh b/scripts/scan-tools.sh
index 7c0e89cea..b5d35183a 100644
--- a/scripts/scan-tools.sh
+++ b/scripts/scan-tools.sh
@@ -5,6 +5,7 @@ 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!
@@ -60,6 +61,7 @@ OpenBSD)
fi
;;
Darwin*)
+ clang=1
;;
*)
# unsupported
@@ -96,15 +98,20 @@ cat >test.c <<-'EOF'
return (0);
}
EOF
-X=$($makecmd ADK_TOPDIR=$topdir LDADD=-lgcc 2>&1)
-if [[ $X != *@(Native compiler works)* ]]; then
+if [[ $clang -eq 0 ]]; then
+ 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
+ else
echo "HOST_CFLAGS:=-O0 -g0" >> $topdir/prereq.mk
echo "HOST_CXXFLAGS:=-O0 -g0" >> $topdir/prereq.mk
+ fi
+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)