mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +00:00
a few tweaks to fix the OS X Android class library build
With corresponding changes to libcore, all the tests are passing except Datagrams, which fails with a NPE in NetworkInterface.getNetworkInterfacesList due to OS X not having /sys/class/net. Porting that class to OS X looks like a non-trivial task.
This commit is contained in:
parent
b409bba318
commit
625c04e786
12
README.md
12
README.md
@ -350,9 +350,9 @@ 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 on some platforms
|
||||||
(currently just Linux, but possibly others in the future). To build
|
(currently Linux works and OS X mostly works). To build this way, do
|
||||||
this way, do the following, starting from the Avian directory:
|
the following, starting from the Avian directory:
|
||||||
|
|
||||||
$ cd ..
|
$ cd ..
|
||||||
$ mkdir android
|
$ mkdir android
|
||||||
@ -368,10 +368,14 @@ this way, do the following, starting from the Avian directory:
|
|||||||
$ git clone https://github.com/dicej/android-libcore64 libcore
|
$ git clone https://github.com/dicej/android-libcore64 libcore
|
||||||
$ (cd expat && CFLAGS=-fPIC CXXFLAGS=-fPIC ./configure --enable-static \
|
$ (cd expat && CFLAGS=-fPIC CXXFLAGS=-fPIC ./configure --enable-static \
|
||||||
&& make)
|
&& make)
|
||||||
$ (cd fdlibm && ln -sf makefile.in Makefile.in \
|
$ (cd fdlibm && (mv makefile.in Makefile.in || true) \
|
||||||
&& CFLAGS=-fPIC bash configure && make)
|
&& CFLAGS=-fPIC bash configure && make)
|
||||||
$ (cd icu4c && CFLAGS=-fPIC CXXFLAGS=-fPIC ./configure --enable-static \
|
$ (cd icu4c && CFLAGS=-fPIC CXXFLAGS=-fPIC ./configure --enable-static \
|
||||||
&& make)
|
&& 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 && git checkout OpenSSL_1_0_1e \
|
$ (cd openssl-upstream && git checkout OpenSSL_1_0_1e \
|
||||||
&& (for x in ../openssl/patches/*.patch; do patch -p1 < $x; done) \
|
&& (for x in ../openssl/patches/*.patch; do patch -p1 < $x; done) \
|
||||||
&& CC="gcc -fPIC" ./config && make)
|
&& CC="gcc -fPIC" ./config && make)
|
||||||
|
5
makefile
5
makefile
@ -169,8 +169,7 @@ ifneq ($(android),)
|
|||||||
-D_FILE_OFFSET_BITS=64 \
|
-D_FILE_OFFSET_BITS=64 \
|
||||||
-g3 \
|
-g3 \
|
||||||
-Werror \
|
-Werror \
|
||||||
-fPIC \
|
-fPIC
|
||||||
-fvisibility=hidden
|
|
||||||
classpath-lflags := \
|
classpath-lflags := \
|
||||||
$(android)/icu4c/lib/libicui18n.a \
|
$(android)/icu4c/lib/libicui18n.a \
|
||||||
$(android)/icu4c/lib/libicuuc.a \
|
$(android)/icu4c/lib/libicuuc.a \
|
||||||
@ -1442,7 +1441,7 @@ $(build)/android.dep: $(luni-javas) $(dalvik-javas) $(xml-javas)
|
|||||||
cp $(android)/fdlibm/fdlibm.h $(build)/android-src/external/fdlibm/
|
cp $(android)/fdlibm/fdlibm.h $(build)/android-src/external/fdlibm/
|
||||||
cp $(android)/expat/lib/expat.h $(build)/android-src/libexpat/
|
cp $(android)/expat/lib/expat.h $(build)/android-src/libexpat/
|
||||||
cp -a $(luni-java)/* $(dalvik-java)/* $(xml-java)/* $(build)/android-src/
|
cp -a $(luni-java)/* $(dalvik-java)/* $(xml-java)/* $(build)/android-src/
|
||||||
sed -i 's/return ordinal - o.ordinal;/return ordinal - o.ordinal();/' \
|
sed -i -e 's/return ordinal - o.ordinal;/return ordinal - o.ordinal();/' \
|
||||||
$(build)/android-src/java/lang/Enum.java
|
$(build)/android-src/java/lang/Enum.java
|
||||||
find $(build)/android-src -name '*.java' > $(build)/android.txt
|
find $(build)/android-src -name '*.java' > $(build)/android.txt
|
||||||
$(javac) -Xmaxerrs 1000 -d $(build)/android -sourcepath $(luni-java) \
|
$(javac) -Xmaxerrs 1000 -d $(build)/android -sourcepath $(luni-java) \
|
||||||
|
Loading…
Reference in New Issue
Block a user