|
@@ -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)
|