Commits

camlspotter committed e729148

applied the patch

  • Participants
  • Parent commits fbe8692
  • Branches android

Comments (0)

Files changed (11)

 	    -e 's|%%MKDLL%%|$(MKDLL)|' \
 	    -e 's|%%MKEXE%%|$(MKEXE)|' \
 	    -e 's|%%MKMAINDLL%%|$(MKMAINDLL)|' \
-	    utils/config.mlp > utils/config.ml
+	    -e 's|%%MKDLL_EXTRA%%|$(MKDLL_EXTRA)|' \
+	    -e 's|%%MKEXE_EXTRA%%|$(MKEXE_EXTRA)|' \
+	    -e 's|%%MKMAINDLL_EXTRA%%|$(MKMAINDLL_EXTRA)|' \
+        -e 's|%%AR%%|$(AR)|' \
+        utils/config.mlp > utils/config.ml
 	@chmod -w utils/config.ml
 
 partialclean::
 	cd asmrun; $(MAKE) meta.o dynlink.o
 	$(CAMLOPT) $(LINKFLAGS) -ccopt "$(BYTECCLINKOPTS)" -o ocamlc.opt \
 	  $(COMPOBJS:.cmo=.cmx) \
-	  asmrun/meta.o asmrun/dynlink.o -cclib "$(BYTECCLIBS)"
+	  asmrun/meta.o asmrun/dynlink.o
 	@sed -e 's|@compiler@|$$topdir/ocamlc.opt|' \
 	  driver/ocamlcomp.sh.in > ocamlcomp.sh
 	@chmod +x ocamlcomp.sh
 
 libasmrun.a: $(OBJS)
 	rm -f libasmrun.a
-	ar rc libasmrun.a $(OBJS)
+	$(AR) rc libasmrun.a $(OBJS)
 	$(RANLIB) libasmrun.a
 
 libasmrund.a: $(DOBJS)
 	rm -f libasmrund.a
-	ar rc libasmrund.a $(DOBJS)
+	$(AR) rc libasmrund.a $(DOBJS)
 	$(RANLIB) libasmrund.a
 
 all-noprof:
 
 libasmrunp.a: $(POBJS)
 	rm -f libasmrunp.a
-	ar rc libasmrunp.a $(POBJS)
+	$(AR) rc libasmrunp.a $(POBJS)
 	$(RANLIB) libasmrunp.a
 
 install: install-default install-$(PROFILING)

asmrun/signals_osdep.h

 
 /****************** ARM, Linux */
 
-#elif defined(TARGET_arm) && defined (SYS_linux)
+#elif defined(TARGET_arm) && defined (SYS_linux) && !defined (ANDROID)
 
   #include <sys/ucontext.h>
 
 		  prims.o libcamlrund.a $(BYTECCLIBS)
 
 libcamlrun.a: $(OBJS)
-	ar rc libcamlrun.a $(OBJS)
+	$(AR) rc libcamlrun.a $(OBJS)
 	$(RANLIB) libcamlrun.a
 
 libcamlrund.a: $(DOBJS)
-	ar rc libcamlrund.a $(DOBJS)
+	$(AR) rc libcamlrund.a $(DOBJS)
 	$(RANLIB) libcamlrund.a
 
 libcamlrun_shared.so: $(PICOBJS)
 #include "stacks.h"
 #include "sys.h"
 
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(ANDROID)
 extern int errno;
 #endif
 

ocamldoc/Makefile

 	../otherlibs/bigarray/bigarray.mli \
 	../otherlibs/num/num.mli
 
-all: exe lib manpages
+all: exe lib
 
 exe: $(OCAMLDOC)
 lib: $(OCAMLDOC_LIBCMA) $(OCAMLDOC_LIBCMI) $(ODOC_TEST)

otherlibs/unix/termios.c

   return Val_unit;
 }
 
+#if defined(ANDROID)
+
+CAMLprim value unix_tcdrain(value fd)
+{ invalid_argument("tcdrain not implemented"); }
+
+#else
+
 CAMLprim value unix_tcdrain(value fd)
 {
   if (tcdrain(Int_val(fd)) == -1) uerror("tcdrain", Nothing);
   return Val_unit;
 }
 
+#endif
+
 static int queue_flag_table[] = {
   TCIFLUSH, TCOFLUSH, TCIOFLUSH
 };
                              quoted_archive (quote_files file_list))
   | _ ->
       let r1 =
-        command(Printf.sprintf "ar rc %s %s"
+        command(Config.ar ^ Printf.sprintf " rc %s %s"
                 quoted_archive (quote_files file_list)) in
       if r1 <> 0 || String.length Config.ranlib = 0
       then r1
         files
         extra
     else
-      Printf.sprintf "%s -o %s %s %s %s %s %s %s"
+      Printf.sprintf "%s -o %s %s %s %s %s %s %s %s"
         (match !Clflags.c_compiler, mode with
         | Some cc, _ -> cc
         | None, Exe -> Config.mkexe
         (String.concat " " (List.rev !Clflags.ccopts))
         files
         extra
+        (match mode with
+        | Exe -> Config.exe_extra
+        | Dll -> Config.dll_extra
+        | MainDll -> Config.maindll_extra
+        | Partial -> assert false)
   in
   command cmd = 0
         (* Whether the system thread library is implemented *)
 
 val print_config : out_channel -> unit;;
+
+val ar : string
+val exe_extra : string
+val dll_extra : string
+val maindll_extra : string
   p_bool "systhread_supported" systhread_supported;
   flush oc;
 ;;
+
+let ar = "%%AR%%"
+let exe_extra = "%%MKEXE_EXTRA%%"
+let dll_extra = "%%MKDLL_EXTRA%%"
+let maindll_extra = "%%MKMAINDLL_EXTRA%%"
 all: ocamlyacc$(EXE)
 
 ocamlyacc$(EXE): $(OBJS)
-	$(CC) $(CFLAGS) $(CCLINKFLAGS) -o ocamlyacc $(OBJS)
+	$(MKEXE) $(BYTECCLINKOPTS) -o ocamlyacc $(OBJS) $(BYTECCLIBS)
 
 version.h : ../VERSION
 	echo "#define OCAML_VERSION \"`sed -e 1q ../VERSION`\"" >version.h