forked from julienr/protobuf-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildProtobuf2.6.1-desktop.sh
executable file
·125 lines (97 loc) · 2.65 KB
/
buildProtobuf2.6.1-desktop.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/bin/bash
#
#
# 88""Yb 88""Yb dP"Yb 888888 dP"Yb 88""Yb 88 dP"Yb dP""b8 88 dP
# 88__dP 88__dP dP Yb 88 dP Yb 88__dP 88 dP Yb dP `" 88odP
# 88""" 88"Yb Yb dP 88 Yb dP 88""Yb 88 .o Yb dP Yb 88"Yb
# 88 88 Yb YbodP 88 YbodP 88oodP 88ood8 YbodP YboodP 88 Yb '
#
# 080 114 111 116 111 098 108 111 099 107
# 01010000 01110010 01101111 01110100 01101111 01000010 01101100 01101111 01100011 01101011
#
#
# FIXME make options to pass in for the following
# + ndk root location
# + android cross build usr path
# + Version of protobuf to build
#
#
# FIXME pkgconf is not working oob
#
printHelp(){
cat << _EOF_
#______________________________________________________________ #
# ____ #
# / ) / / / #
#---/____/---)__----__--_/_----__---/__---/----__----__---/-__- #
# / / ) / ) / / ) / ) / / ) / ' /( #
#_/________/_____(___/_(_ __(___/_(___/_/___(___/_(___ _/___\__ #
# #
#______________________________________________________________ #
# #
```````````````````````````````````````````````````````````
NOTE YOU CAN ONLY USE THIS TO BUILD PROTOBUF 2.6.1
This is to match our android toolkits
This installs to /usr/local/protobuf_2_6_1
```````````````````````````````````````````````````````````
Usage
$0 [option]
Options
[ --debug, -d , -v --verbose ]
Print std out in debug mode
[ --release, -r ]
Print std in release mode
[ --help, -h, h , ? ]
Print this help
Eample:
$0 -r
_EOF_
exit 1;
}
if [ $# -lt 1 ];
then
printHelp;
fi
DEBUG=0;
case "$1" in
-d|--debug|d|v|--verbose)
DEBUG=1
;;
-r|--release)
DEBUG=0
;;
-h|--help|h|?)
printHelp;
;;
*)
printHelp
;;
esac
# FIXME debug
if [ $DEBUG == 1 ];
then
set -x
fi
##########################################
# Download Protobuf
##########################################
cd /tmp
rm /tmp/protobuf-2.6.1.tar.*
if [ -d /tmp/protobuf-2.6.1 ];
then
rm -rf /tmp/protobuf-2.6.1
fi
wget https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz
echo "Extracting protobuf 2.6.1"
tar xf /tmp/protobuf-2.6.1.tar.gz
cd /tmp/protobuf-2.6.1/
if [ $DEBUG == 0 ];
then
./configure --prefix=/usr/local/protobuf_2_6_1
else
./configure --prefix=/usr/local/protobuf_2_6_1 \
CXXFLAGS="-m32 -g3 -ggdb3"
fi
make -j6
make install