Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5903ffd

Browse files
committedJan 13, 2016
compile_webidebridge.sh: don't require all platforms compilers
So one can build the tool without preparing all cross compilers. Signed-off-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
1 parent b2fd478 commit 5903ffd

File tree

1 file changed

+25
-10
lines changed

1 file changed

+25
-10
lines changed
 

‎compile_webidebridge.sh

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ red='\e[0;31m'
1212
green='\e[0;32m'
1313
NC='\e[0m' # No Color
1414

15+
DARWIN_CC=o64-clang
16+
LINUX_CC=gcc
17+
WIN_CC=i686-w64-mingw32-gcc
18+
1519
extractVersionFromMain()
1620
{
1721
VERSION=`grep version main.go | cut -d "\"" -f2 | cut -d "\"" -f1 | head -1`
@@ -47,11 +51,11 @@ bootstrapPlatforms()
4751
echo 'In bootstrapPlatforms'
4852
#export PATH=$PATH:/opt/osxcross/target/bin
4953
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
5357
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
5559
}
5660

5761
compilePlatform()
@@ -80,11 +84,22 @@ compilePlatform()
8084
}
8185

8286
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
89104

90105
exit 0

0 commit comments

Comments
 (0)
Please sign in to comment.