mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +00:00
Merge pull request #399 from bigfatbrowncat/avian-pack
Added okhttp and Bouncy Castle libraries back #2
This commit is contained in:
commit
6b12c87e52
92
README.md
92
README.md
@ -353,93 +353,14 @@ but have not yet been tested.
|
|||||||
|
|
||||||
Building with the Android Class Library
|
Building with the Android Class Library
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
|
||||||
As an alternative to both the Avian and OpenJDK class libaries, you
|
As an alternative to both the Avian and OpenJDK class libaries, you
|
||||||
can also build with the Android class library on some platforms
|
can also build with the Android class library. Now it should work on Linux, OS X and Windows.
|
||||||
(currently Linux works and OS X mostly works). To build this way, do
|
|
||||||
the following, starting from the Avian directory:
|
|
||||||
|
|
||||||
cd ..
|
The simpliest way to build Avian with Android classpath is to use `avian-pack` project: https://github.com/bigfatbrowncat/avian-pack
|
||||||
mkdir -p android/system android/external
|
|
||||||
cd android
|
|
||||||
|
|
||||||
git clone https://android.googlesource.com/platform/bionic
|
Avian-pack consists of Avian itself with some Android components (such as libcore and icu4c).
|
||||||
(cd bionic && \
|
|
||||||
git checkout 84983592ade3ec7d72d082262fb6646849979bfc)
|
|
||||||
|
|
||||||
git clone https://android.googlesource.com/platform/system/core \
|
Note that we use the upstream OpenSSL repository and apply the
|
||||||
system/core
|
|
||||||
(cd system/core && \
|
|
||||||
git checkout 373c77583f9d8eab88e4321d1a2e2af8f5ae8ea7)
|
|
||||||
|
|
||||||
git clone https://android.googlesource.com/platform/external/fdlibm \
|
|
||||||
external/fdlibm
|
|
||||||
(cd external/fdlibm && \
|
|
||||||
git checkout 0da5f683c9ddc9442af3b389b4220e91ccffb320)
|
|
||||||
|
|
||||||
git clone https://android.googlesource.com/platform/external/icu4c \
|
|
||||||
external/icu4c
|
|
||||||
(cd external/icu4c && \
|
|
||||||
git checkout e5311394ca22b280da41cd17059288dab3fb1ea6)
|
|
||||||
|
|
||||||
git clone https://android.googlesource.com/platform/libnativehelper
|
|
||||||
(cd libnativehelper && \
|
|
||||||
git checkout b14825c7c75420049e03849994265be651cc4a4e)
|
|
||||||
|
|
||||||
git clone https://android.googlesource.com/platform/external/openssl \
|
|
||||||
external/openssl
|
|
||||||
(cd external/openssl && \
|
|
||||||
git checkout 1417357d893849c4b6afdd98c32b6ca1b4b19a8b)
|
|
||||||
|
|
||||||
git clone https://android.googlesource.com/platform/external/zlib \
|
|
||||||
external/zlib
|
|
||||||
(cd external/zlib && \
|
|
||||||
git checkout 15b6223aa57a347ce113729253802cb2fdeb4ad0)
|
|
||||||
|
|
||||||
git clone https://github.com/dicej/android-conscrypt external/conscrypt
|
|
||||||
(cd external/conscrypt && \
|
|
||||||
git checkout a96719f834232634e9160873bd4c44834b84eb15)
|
|
||||||
|
|
||||||
git clone git://git.openssl.org/openssl.git openssl-upstream
|
|
||||||
(cd openssl-upstream && git checkout OpenSSL_1_0_1h)
|
|
||||||
|
|
||||||
git clone https://github.com/dicej/android-libcore64 libcore
|
|
||||||
(cd libcore && \
|
|
||||||
git checkout 69a1fd8623b85f978ead36dcf1c6c78c5ff79932)
|
|
||||||
|
|
||||||
curl -Of http://oss.readytalk.com/avian-web/expat-2.1.0.tar.gz
|
|
||||||
(cd external && tar xzf ../expat-2.1.0.tar.gz && mv expat-2.1.0 expat)
|
|
||||||
|
|
||||||
(cd external/expat && CFLAGS=-fPIC CXXFLAGS=-fPIC ./configure \
|
|
||||||
--enable-static && make)
|
|
||||||
|
|
||||||
(cd external/fdlibm && (mv makefile.in Makefile.in || true) \
|
|
||||||
&& CFLAGS=-fPIC bash configure && make)
|
|
||||||
|
|
||||||
(cd external/icu4c && CFLAGS=-fPIC CXXFLAGS=-fPIC ./configure \
|
|
||||||
--enable-static && make)
|
|
||||||
|
|
||||||
NB: use 'CC="gcc -fPIC" ./Configure darwin64-x86_64-cc' when building
|
|
||||||
for x86_64 OS X instead of 'CC="gcc -fPIC" ./config':
|
|
||||||
|
|
||||||
(cd openssl-upstream \
|
|
||||||
&& (for x in ../external/openssl/patches/*.patch; \
|
|
||||||
do patch -p1 < $x; done) \
|
|
||||||
&& CC="gcc -fPIC" ./config && make)
|
|
||||||
|
|
||||||
cd ../avian
|
|
||||||
make android=$(pwd)/../android test
|
|
||||||
|
|
||||||
Note that we use https://github.com/dicej/android-libcore64 above
|
|
||||||
instead of the upstream
|
|
||||||
https://android.googlesource.com/platform/libcore repository, since
|
|
||||||
the former has patches to provide better support for non-Linux
|
|
||||||
platforms. We have also forked
|
|
||||||
https://android.googlesource.com/platform/external/conscrypt as
|
|
||||||
https://github.com/dicej/android-conscrypt to patch that project as
|
|
||||||
well.
|
|
||||||
|
|
||||||
Also note that we use the upstream OpenSSL repository and apply the
|
|
||||||
Android patches to it. This is because it is not clear how to build
|
Android patches to it. This is because it is not clear how to build
|
||||||
the Android fork of OpenSSL directly without checking out and building
|
the Android fork of OpenSSL directly without checking out and building
|
||||||
the entire platform. As of this writing, the patches apply cleanly
|
the entire platform. As of this writing, the patches apply cleanly
|
||||||
@ -447,11 +368,6 @@ against OpenSSL 1.0.1h, so that's the tag we check out, but this may
|
|||||||
change in the future when the Android fork rebases against a new
|
change in the future when the Android fork rebases against a new
|
||||||
OpenSSL version.
|
OpenSSL version.
|
||||||
|
|
||||||
Finally, we specify specific commit hashes for each repository which
|
|
||||||
are known to work. Later versions may also work, but have not been
|
|
||||||
tested.
|
|
||||||
|
|
||||||
|
|
||||||
Installing
|
Installing
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
29
makefile
29
makefile
@ -343,13 +343,35 @@ ifneq ($(android),)
|
|||||||
|
|
||||||
xml-java = $(android)/libcore/xml/src/main/java
|
xml-java = $(android)/libcore/xml/src/main/java
|
||||||
xml-javas := $(shell find $(xml-java) -name '*.java')
|
xml-javas := $(shell find $(xml-java) -name '*.java')
|
||||||
|
|
||||||
|
okhttp-android-java = $(android)/external/okhttp/android/main/java
|
||||||
|
okhttp-android-javas := $(shell find $(okhttp-android-java) -name '*.java')
|
||||||
|
|
||||||
|
okhttp-java = $(android)/external/okhttp/okhttp/src/main/java
|
||||||
|
okhttp-javas := $(shell find $(okhttp-java) -name '*.java')
|
||||||
|
|
||||||
|
okio-java = $(android)/external/okhttp/okio/src/main/java
|
||||||
|
okio-javas := $(shell find $(okio-java) -name '*.java')
|
||||||
|
|
||||||
|
bcpkix-java = $(android)/external/bouncycastle/bcpkix/src/main/java
|
||||||
|
bcpkix-javas := $(shell find $(bcpkix-java) -name '*.java')
|
||||||
|
|
||||||
|
bcprov-java = $(android)/external/bouncycastle/bcprov/src/main/java
|
||||||
|
bcprov-javas := $(shell find $(bcprov-java) -name '*.java')
|
||||||
|
|
||||||
android-classes = \
|
android-classes = \
|
||||||
$(call java-classes,$(luni-javas),$(luni-java),$(build)/android) \
|
$(call java-classes,$(luni-javas),$(luni-java),$(build)/android) \
|
||||||
$(call java-classes,$(crypto-javas),$(crypto-java),$(build)/android) \
|
$(call java-classes,$(crypto-javas),$(crypto-java),$(build)/android) \
|
||||||
$(call java-classes,$(crypto-platform-javas),$(crypto-platform-java),$(build)/android) \
|
$(call java-classes,$(crypto-platform-javas),$(crypto-platform-java),$(build)/android) \
|
||||||
$(call java-classes,$(dalvik-javas),$(dalvik-java),$(build)/android) \
|
$(call java-classes,$(dalvik-javas),$(dalvik-java),$(build)/android) \
|
||||||
$(call java-classes,$(libart-javas),$(libart-java),$(build)/android) \
|
$(call java-classes,$(libart-javas),$(libart-java),$(build)/android) \
|
||||||
$(call java-classes,$(xml-javas),$(xml-java),$(build)/android)
|
$(call java-classes,$(xml-javas),$(xml-java),$(build)/android) \
|
||||||
|
$(call java-classes,$(okhttp-javas),$(okhttp-java),$(build)/android) \
|
||||||
|
$(call java-classes,$(okhttp-android-javas),$(okhttp-android-java),$(build)/android) \
|
||||||
|
$(call java-classes,$(okio-javas),$(okio-java),$(build)/android) \
|
||||||
|
$(call java-classes,$(bcpkix-javas),$(bcpkix-java),$(build)/android) \
|
||||||
|
$(call java-classes,$(bcprov-javas),$(bcprov-java),$(build)/android)
|
||||||
|
|
||||||
classpath = android
|
classpath = android
|
||||||
|
|
||||||
javahome-files = tzdata
|
javahome-files = tzdata
|
||||||
@ -1684,7 +1706,8 @@ $(build)/%.o: $(build)/android-src/%.cpp $(build)/android.dep
|
|||||||
$$($(windows-path) $(<)) $(call output,$(@))
|
$$($(windows-path) $(<)) $(call output,$(@))
|
||||||
|
|
||||||
$(build)/android.dep: $(luni-javas) $(dalvik-javas) $(libart-javas) \
|
$(build)/android.dep: $(luni-javas) $(dalvik-javas) $(libart-javas) \
|
||||||
$(xml-javas) $(luni-nonjavas) $(crypto-javas) $(crypto-platform-javas)
|
$(xml-javas) $(okhttp-android-javas) $(okhttp-javas) $(okio-javas) \
|
||||||
|
$(bcpkix-javas) $(bcprov-javas) $(luni-nonjavas) $(crypto-javas) $(crypto-platform-javas)
|
||||||
@echo "compiling luni classes"
|
@echo "compiling luni classes"
|
||||||
@mkdir -p $(classpath-build)
|
@mkdir -p $(classpath-build)
|
||||||
@mkdir -p $(build)/android
|
@mkdir -p $(build)/android
|
||||||
@ -1692,7 +1715,7 @@ $(build)/android.dep: $(luni-javas) $(dalvik-javas) $(libart-javas) \
|
|||||||
@mkdir -p $(build)/android-src/libexpat
|
@mkdir -p $(build)/android-src/libexpat
|
||||||
cp $(android)/external/fdlibm/fdlibm.h $(build)/android-src/external/fdlibm/
|
cp $(android)/external/fdlibm/fdlibm.h $(build)/android-src/external/fdlibm/
|
||||||
cp $(android)/external/expat/lib/expat*.h $(build)/android-src/libexpat/
|
cp $(android)/external/expat/lib/expat*.h $(build)/android-src/libexpat/
|
||||||
cp -a $(luni-java)/* $(xml-java)/* $(build)/android-src/
|
cp -a $(luni-java)/* $(xml-java)/* $(okhttp-android-java)/* $(okhttp-java)/* $(okio-java)/* $(bcpkix-java)/* $(bcprov-java)/* $(build)/android-src/
|
||||||
rm $(call noop-files,$(luni-blacklist),$(luni-java),$(build)/android-src)
|
rm $(call noop-files,$(luni-blacklist),$(luni-java),$(build)/android-src)
|
||||||
(cd $(dalvik-java) && \
|
(cd $(dalvik-java) && \
|
||||||
$(jar) c $(call noop-files,$(dalvik-javas),$(dalvik-java),.)) \
|
$(jar) c $(call noop-files,$(dalvik-javas),$(dalvik-java),.)) \
|
||||||
|
Loading…
Reference in New Issue
Block a user