From 7d6e8074bb64ca75f03bb3923c8e8492b72096d5 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 2 May 2015 23:11:55 +0200 Subject: fix clang issues with -lgcc check --- scripts/scan-tools.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'scripts/scan-tools.sh') 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) -- cgit v1.2.3