@@ -35,6 +35,9 @@ mkdir objdir
35
35
export OS=` uname -o || uname`
36
36
export TARGET_OS=$OS
37
37
38
+ START_GROUP=--Wl,--start-group
39
+ END_GROUP=--Wl,--end-group
40
+
38
41
function fetch_llvm {
39
42
fetched=` basename $1 `
40
43
if [ ! -f " $fetched " ]; then
@@ -64,10 +67,12 @@ if [[ $OS == "GNU/Linux" ]] ; then
64
67
if [[ $MACHINE == " x86_64" ]] ; then
65
68
fetch_llvm https://github.com/cmaglie/llvm-clang-build-scripts/releases/download/4.0.0/llvm-clang-4.0.0-ubuntu-14.04.5-x86_64.tar.xz
66
69
OUTPUT_TAG=x86_64-pc-linux-gnu
67
- # elif [[ $MACHINE == "i686" ]] ; then
68
- # OUTPUT_TAG=i686-pc-linux-gnu
69
- # elif [[ $MACHINE == "armv7l" ]] ; then
70
- # OUTPUT_TAG=armhf-pc-linux-gnu
70
+ elif [[ $MACHINE == " i686" ]] ; then
71
+ OUTPUT_TAG=i686-pc-linux-gnu
72
+ fetch_llvm https://github.com/cmaglie/llvm-clang-build-scripts/releases/download/4.0.0/llvm-clang-4.0.0-ubuntu-14.04.5-i686.tar.xz
73
+ elif [[ $MACHINE == " armv7l" ]] ; then
74
+ OUTPUT_TAG=armhf-pc-linux-gnu
75
+ fetch_llvm https://github.com/cmaglie/llvm-clang-build-scripts/releases/download/4.0.0/llvm-clang-4.0.0-linux-arm.tar.xz
71
76
else
72
77
echo Linux Machine not supported: $MACHINE
73
78
exit 1
@@ -90,12 +95,16 @@ elif [[ $OS == "Msys" || $OS == "Cygwin" ]] ; then
90
95
# sed -i "s/^#define _GLIBCXX_USE_FLOAT128 1$/\/\/#define _GLIBCXX_USE_FLOAT128 1/" include/bits/c++config.h
91
96
# CXXFLAGS="-Iinclude -I$GCC_INCLUDE/c++ -I$GCC_INCLUDE/c++/$OUTPUT_TAG -I$GCC_INCLUDE/c++/backward -I$GCC_INCLUDE"
92
97
93
- # elif [[ $OS == "Darwin" ]] ; then
94
- #
95
- # export PATH=/opt/local/libexec/gnubin/:/opt/local/bin:$PATH
96
- # export CC="gcc -arch i386 -mmacosx-version-min=10.5"
97
- # export CXX="g++ -arch i386 -mmacosx-version-min=10.5"
98
- # OUTPUT_TAG=i386-apple-darwin11
98
+ elif [[ $OS == " Darwin" ]] ; then
99
+
100
+ # export PATH=/opt/local/libexec/gnubin/:/opt/local/bin:$PATH
101
+ export CC=" gcc -arch x86_64 -mmacosx-version-min=10.9"
102
+ export CXX=" g++ -arch x86_64 -mmacosx-version-min=10.9"
103
+ OUTPUT_TAG=x86_64-apple-darwin11
104
+ export CXXFLAGS=" -stdlib=libc++ -std=c++11"
105
+ fetch_llvm https://github.com/cmaglie/llvm-clang-build-scripts/releases/download/4.0.0/llvm-clang-4.0.0-macosx-10.9-x86_64.tar.bz2
106
+ START_GROUP=" "
107
+ END_GROUP=" "
99
108
100
109
else
101
110
@@ -114,7 +123,7 @@ LDFLAGS="`clang/bin/llvm-config --ldflags` -static-libstdc++"
114
123
LLVMLIBS=` clang/bin/llvm-config --libs --system-libs`
115
124
CLANGLIBS=` ls clang/lib/libclang* .a | sed s/.* libclang/-lclang/ | sed s/.a$//`
116
125
SOURCES=" main.cpp ArduinoDiagnosticConsumer.cpp CommandLine.cpp IdentifiersList.cpp CodeCompletion.cpp"
117
- $CXX $SOURCES -o objdir/arduino-preprocessor $CXXFLAGS $LDFLAGS -Wl,--start-group $LLVMLIBS $CLANGLIBS -Wl,--end-group
126
+ $CXX $SOURCES -o objdir/arduino-preprocessor $CXXFLAGS $LDFLAGS $START_GROUP $LLVMLIBS $CLANGLIBS $END_GROUP
118
127
strip objdir/*
119
128
120
129
rm -f arduino-preprocessor-${OUTPUT_VERSION} -${OUTPUT_TAG} .tar.bz2
0 commit comments