@@ -12,6 +12,10 @@ red='\e[0;31m'
12
12
green=' \e[0;32m'
13
13
NC=' \e[0m' # No Color
14
14
15
+ DARWIN_CC=o64-clang
16
+ LINUX_CC=gcc
17
+ WIN_CC=i686-w64-mingw32-gcc
18
+
15
19
extractVersionFromMain ()
16
20
{
17
21
VERSION=` grep version main.go | cut -d " \" " -f2 | cut -d " \" " -f1 | head -1`
@@ -47,11 +51,11 @@ bootstrapPlatforms()
47
51
echo ' In bootstrapPlatforms'
48
52
# export PATH=$PATH:/opt/osxcross/target/bin
49
53
cd $GOROOT /src
50
- env CC_FOR_TARGET=o64-clang CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 ./make.bash --no-clean
51
- env CC_FOR_TARGET=gcc CGO_ENABLED=1 GOOS=linux GOARCH=amd64 ./make.bash --no-clean
52
- env CC_FOR_TARGET=gcc CGO_ENABLED=1 GOOS=linux GOARCH=386 ./make.bash --no-clean
54
+ env CC_FOR_TARGET=$DARWIN_CC CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 ./make.bash --no-clean
55
+ env CC_FOR_TARGET=$LINUX_CC CGO_ENABLED=1 GOOS=linux GOARCH=amd64 ./make.bash --no-clean
56
+ env CC_FOR_TARGET=$LINUX_CC CGO_ENABLED=1 GOOS=linux GOARCH=386 ./make.bash --no-clean
53
57
env CGO_ENABLED=0 GOOS=linux GOARCH=arm ./make.bash --no-clean
54
- env CC_FOR_TARGET=i686-w64-mingw32-gcc CGO_ENABLED=1 GOOS=windows GOARCH=386 ./make.bash --no-clean
58
+ env CC_FOR_TARGET=$WIN_CC CGO_ENABLED=1 GOOS=windows GOARCH=386 ./make.bash --no-clean
55
59
}
56
60
57
61
compilePlatform ()
@@ -80,11 +84,22 @@ compilePlatform()
80
84
}
81
85
82
86
extractVersionFromMain
83
- compilePlatform darwin amd64 o64-clang 1
84
- # compilePlatformLinux linux 386 gcc
85
- compilePlatform linux amd64 gcc 1
86
- compilePlatform linux arm 0
87
- compilePlatform windows 386 i686-w64-mingw32-gcc 1
88
-
87
+ if [ ! -z $( which $DARWIN_CC ) ]; then
88
+ compilePlatform darwin amd64 $DARWIN_CC 1
89
+ else
90
+ echo -e " ${red} $DARWIN_CC not available. Skipping...${NC} "
91
+ fi
92
+ if [ ! -z $( which $LINUX_CC ) ]; then
93
+ # compilePlatformLinux linux 386 $LINUX_CC
94
+ compilePlatform linux amd64 $LINUX_CC 1
95
+ compilePlatform linux arm 0
96
+ else
97
+ echo -e " ${red} $LINUX_CC not available. Skipping...${NC} "
98
+ fi
99
+ if [ ! -z $( which $WIN_CC ) ]; then
100
+ compilePlatform windows 386 $WIN_CC 1
101
+ else
102
+ echo -e " ${red} $WIN_CC not available. Skipping...${NC} "
103
+ fi
89
104
90
105
exit 0
0 commit comments