Skip to content

Instantly share code, notes, and snippets.

@dpeek
Created December 5, 2013 11:41
Show Gist options
  • Save dpeek/7803958 to your computer and use it in GitHub Desktop.
Save dpeek/7803958 to your computer and use it in GitHub Desktop.
Building Haxe for Android
$ mkdir haxe-droid && cd haxe-droid
$ git clone https://github.com/vouillon/ocaml-android.git
$ git clone https://github.com/HaxeFoundation/haxe.git
$ http://dl.google.com/android/ndk/android-ndk-r9b-darwin-x86.tar.bz2
$ tar -vjxf android-ndk-r9b-darwin-x86.tar.bz2 && rm android-ndk-r9b-darwin-x86.tar.bz2 && mv android-ndk-r9b android-ndk
$ wget http://caml.inria.fr/pub/distrib/ocaml-4.01/ocaml-4.01.0.tar.gz
$ tar -xzf ocaml-4.01.0.tar.gz && rm ocaml-4.01.0.tar.gz && mv ocaml-4.01.0 ocaml-src
$ cp -r ocaml-src ocaml-cross && cd ocaml-cross
# build ocaml 32bit for your arch (examples in ocaml-src/INSTALL)
$ ./configure -host "i386-apple-darwin11.4.2" -cc "gcc -arch i386 -m32" -as "as -arch i386" -aspp "gcc -arch i386 -m32 -c"
$ make world
$ make opt
$ cd ../ocaml-android
# these patches have been merged into ocaml 4.01
$ rm patches/ocamlbuild.txt
$ rm patches/system.txt
# Edit Makefile.config, this was mine:
# Path of the Android NDK
ANDROID_NDK = /Users/dpeek/Projects/haxe-droid/android-ndk
# OCaml sources (will be copied)
OCAML_SRC = /Users/dpeek/Projects/haxe-droid/ocaml-src
# Where the cross-compiler libraries are installed
ANDROID_PREFIX = /Users/dpeek/Projects/haxe-droid/ocaml-cross/lib
# Where the cross-compiler binaries are installed
ANDROID_BINDIR = /Users/dpeek/Projects/haxe-droid/ocaml-cross
$ make
$ cd ../haxe
$ export PATH=/Users/dpeek/Projects/haxedroid/arm-linux-androideabi:$PATH
# important that working ocaml exists in PATH, as camlp4o does not
# seem to be compiled for arm (pre-processor for parser.ml)
$ make
@prazewa
Copy link

prazewa commented Apr 8, 2025

ybeu mena

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment