Aurel Bílý 5 سال پیش
والد
کامیت
6a24d1bb9c
5فایلهای تغییر یافته به همراه12 افزوده شده و 46 حذف شده
  1. 3 6
      libs/uv/Makefile
  2. 7 0
      libs/uv/dune
  3. 0 39
      libs/uv/test.ml
  4. 1 0
      opam
  5. 1 1
      src/dune

+ 3 - 6
libs/uv/Makefile

@@ -1,17 +1,14 @@
 ALL_CFLAGS = $(CFLAGS)
 OCAMLOPT=ocamlopt
 OCAMLC=ocamlc
-SRC = uv.ml uv_stubs.c test.ml
+SRC = uv.ml uv_stubs.c
 
-all: bytecode native test
+all: bytecode native
 
 bytecode: uv.cma
 
 native: uv.cmxa
 
-test: test.ml uv.ml uv.cmxa uv_stubs.o
-	ocamlfind $(OCAMLOPT) -o test -safe-string -package extlib -cclib uv_stubs.o -cclib -luv uv.cmxa test.ml
-
 uv.cma: uv_stubs.o uv.ml
 	ocamlfind $(OCAMLC) -safe-string -a -o uv.cma uv.ml
 
@@ -22,7 +19,7 @@ uv_stubs.o: uv_stubs.c
 	ocamlfind $(OCAMLC) -safe-string $(ALL_CFLAGS) uv_stubs.c
 
 clean:
-	rm -f test $(wildcard *.cmo) $(wildcard *.cma)  $(wildcard *.cmx) $(wildcard *.cmxa) $(wildcard *.a) $(wildcard *.obj) $(wildcard *.o) $(wildcard *.cmi)
+	rm -f $(wildcard *.cmo) $(wildcard *.cma)  $(wildcard *.cmx) $(wildcard *.cmxa) $(wildcard *.a) $(wildcard *.obj) $(wildcard *.o) $(wildcard *.cmi)
 
 .PHONY: all bytecode native clean
 Makefile: ;

+ 7 - 0
libs/uv/dune

@@ -0,0 +1,7 @@
+(include_subdirs no)
+
+(library
+	(name uv)
+	(c_names uv_stubs)
+	(wrapped false)
+)

+ 0 - 39
libs/uv/test.ml

@@ -1,39 +0,0 @@
-open Uv
-
-;;
-
-print_string "init loop...\n"; flush_all ();
-let loop = Uv.loop_init () in
-(*let cb_c () = print_string "closed\n" in
-let cb file = print_string "hey I got a file I guess\n"; flush_all (); Uv.fs_close loop file cb_c in*)
-let cb = function
-	| CbError err -> print_string ("got an error: " ^ err ^ "\n"); flush_all ();
-	| CbSuccess file ->
-		print_string "hey I got a file I guess\n"; flush_all ();
-		let stat = Uv.fs_fstat_sync loop file in
-		print_string ("length: " ^ (Int64.to_string stat.size) ^ "\n"); flush_all ();
-		Uv.fs_close_sync loop file;
-		print_string "closed\n"; flush_all ();
-in
-print_string "open files...\n"; flush_all ();
-Uv.fs_open loop "uv.ml" 0 511 cb;
-Uv.fs_open loop "non-ext" 0 511 cb;
-print_string "sync open...\n"; flush_all ();
-let other_file = Uv.fs_open_sync loop "Makefile" 0 511 in
-print_string "run gc...\n"; flush_all ();
-Gc.full_major ();
-Uv.fs_close_sync loop other_file;
-print_string "scandir...\n"; flush_all ();
-let dirs = Uv.fs_scandir_sync loop "." 0 in
-let rec pdirs = function
-	| [] -> ()
-	| (name, kind) :: rest -> print_string ("entry: " ^ name ^ "\n"); pdirs rest
-in
-pdirs dirs;
-print_string "run loop...\n"; flush_all ();
-while (Uv.loop_alive loop) do
-	ignore (Uv.run loop 0)
-done;
-print_string "close loop...\n"; flush_all ();
-Uv.loop_close loop;
-print_string "done\n"

+ 1 - 0
opam

@@ -29,6 +29,7 @@ depends: [
   "ptmap"               {build}
   "sha"                 {build}
   "conf-libpcre"
+  "conf-libuv"
   "conf-zlib"
   "conf-neko"
 ]

+ 1 - 1
src/dune

@@ -11,7 +11,7 @@
 	(public_name haxe)
 	(package haxe)
 	(libraries
-		extc extproc extlib_leftovers ilib javalib neko objsize pcre swflib ttflib ziplib
+		extc extproc extlib_leftovers ilib javalib neko objsize pcre swflib ttflib uv ziplib
 		json
 		unix str threads dynlink
 		xml-light extlib ptmap sha