Permalink
Browse files

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.
  • Loading branch information...
1 parent b409bba commit 625c04e78679cc3dabb3289c832ede3a0e5a1e62 @dicej dicej committed Feb 28, 2013
Showing with 10 additions and 7 deletions.
  1. +8 −4 README.md
  2. +2 −3 makefile
View
@@ -350,9 +350,9 @@ Building with the Android Class Library
---------------------------------------
As an alternative to both the Avian and OpenJDK class libaries, you
-can also build with the Android Class Library on some platforms
-(currently just Linux, but possibly others in the future). To build
-this way, do the following, starting from the Avian directory:
+can also build with the Android class library on some platforms
+(currently Linux works and OS X mostly works). To build this way, do
+the following, starting from the Avian directory:
$ cd ..
$ 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
$ (cd expat && CFLAGS=-fPIC CXXFLAGS=-fPIC ./configure --enable-static \
&& make)
- $ (cd fdlibm && ln -sf makefile.in Makefile.in \
+ $ (cd fdlibm && (mv makefile.in Makefile.in || true) \
&& CFLAGS=-fPIC bash configure && make)
$ (cd 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 && git checkout OpenSSL_1_0_1e \
&& (for x in ../openssl/patches/*.patch; do patch -p1 < $x; done) \
&& CC="gcc -fPIC" ./config && make)
View
@@ -169,8 +169,7 @@ ifneq ($(android),)
-D_FILE_OFFSET_BITS=64 \
-g3 \
-Werror \
- -fPIC \
- -fvisibility=hidden
+ -fPIC
classpath-lflags := \
$(android)/icu4c/lib/libicui18n.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)/expat/lib/expat.h $(build)/android-src/libexpat/
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
find $(build)/android-src -name '*.java' > $(build)/android.txt
$(javac) -Xmaxerrs 1000 -d $(build)/android -sourcepath $(luni-java) \

0 comments on commit 625c04e

Please sign in to comment.