Commits

camlspotter committed 63c88fb

added a workaround for memory.h problem

  • Participants
  • Parent commits e8a85c4
  • Branches android

Comments (0)

Files changed (5)

 utils/config\.ml$
 yacc/ocamlyacc$
 yacc/version\.h$
+
+\#.*#$
+byterun/stdlib\.h$
+byterun/ocamlrun\.target$
+yacc/ocamlyacc\.target$
 # - Host OCaml system must be built at $HOST_OCAML_DIR
 # - config/Makefile.config must be edited properly
 
+cp $HOME/.share/opt/android-ndk-r8/platforms/android-14/arch-arm/usr/include/stdlib.h byterun/
+patch -p1 < ocaml-android-3.12.1-stdlib_h.patch
+
 # Make tools written in C for the target and rename them
 (cd byterun; make all; mv ocamlrun ocamlrun.target)
 (cd yacc; make all; mv ocamlyacc ocamlyacc.target)

File byterun/Makefile.common

 
 PUBLIC_INCLUDES=\
   alloc.h callback.h config.h custom.h fail.h intext.h \
-  memory.h misc.h mlvalues.h printexc.h signals.h compatibility.h
+  memory.h misc.h mlvalues.h printexc.h signals.h compatibility.h \
+  stdlib.h
 
 
 all:: ocamlrun$(EXE) ld.conf libcamlrun.$(A)

File config/Makefile

 
 ### 1. EDIT BELOW ------------------------------------
 PREFIX=/home/jun/.share/prefix/ocaml-android
-
-ANDROID_NDK_HOME=/home/jun/android-ndk-r8
+ANDROID_NDK_HOME=/home/jun/.share/opt/android-ndk-r8
 HOST_ARCH=linux-x86
 
 ## the directory where gcc stays
 ANDROID_PLATFORM=$(ANDROID_NDK_HOME)/platforms/android-14/arch-arm
 
 # The following lines with `ml' prefixes must be configured!!!
-#ml let android_ndk_home = "/home/jun/android-ndk-r8"
+#ml let android_ndk_home = "/home/jun/.share/opt/android-ndk-r8"
 #ml let host_arch = "linux-x86"
 #ml let android_eabi_gcc = Printf.sprintf "%s/toolchains/arm-linux-androideabi-4.4.3/prebuilt/%s" android_ndk_home host_arch
 #ml let mklib out files opts = Printf.sprintf "%s/bin/arm-linux-androideabi-ar rc %s %s %s; %s/bin/arm-linux-androideabi-ranlib %s" android_eabi_gcc out opts files android_eabi_gcc out;;

File ocaml-android-3.12.1-stdlib_h.patch

+diff -c byterun-back/stdlib.h byterun/stdlib.h
+*** ocaml-3.12.1_old/byterun/stdlib.h	Mon Jun  4 12:49:29 2012
+--- ocaml-3.12.1/byterun/stdlib.h	Mon Jun  4 12:50:11 2012
+***************
+*** 40,46 ****
+  #include <string.h>
+  #include <alloca.h>
+  #include <strings.h>
+! #include <memory.h>
+  
+  __BEGIN_DECLS
+  
+--- 40,46 ----
+  #include <string.h>
+  #include <alloca.h>
+  #include <strings.h>
+! // #include <memory.h> // memory.h exists also in OCaml byterun... We must avoid the name clash.
+  
+  __BEGIN_DECLS
+