diff --git a/README.md b/README.md index a608867aec..b4d47e1183 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/makefile b/makefile index b6a64695b5..b5599dbe89 100755 --- a/makefile +++ b/makefile @@ -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) \