2
0
Nicolas Cannasse 18 жил өмнө
parent
commit
b4f6662f37
2 өөрчлөгдсөн 11 нэмэгдсэн , 5 устгасан
  1. 7 4
      Makefile
  2. 4 1
      genswf8.ml

+ 7 - 4
Makefile

@@ -3,15 +3,18 @@ SWFLIB=../../mtcvs/swflib
 EXTC=../../mtcvs/extc
 NEKO=../neko
 XML=../../mtcvs/xml-light
-LIBS_SRC=$(EXTLIB)/*.ml* -n $(EXTLIB)/install.ml $(SWFLIB)/*.ml* $(EXTC)/extc.ml* $(XML)/*.ml* -n $(XML)/test.ml
+LIBS_SRC=$(EXTLIB)/*.ml* -n $(EXTLIB)/install.ml $(SWFLIB)/*.ml* $(EXTC)/extc.ml*
 SRC=$(NEKO)/libs/include/ocaml/*.ml* *.ml*
-LIBS=unix.cmxa
-FLAGS=-o haxe -pp camlp4o -lp "-cclib extc_stubs.o -cclib -lz"
+LIBS=unix.cmxa $(XML)/xml-light.cmxa
+FLAGS=-o haxe -pp camlp4o -P $(XML)/dtd.mli -lp "-cclib extc_stubs.o -cclib -lz"
 
-all:
+all: xml
 	ocamlc -c $(EXTC)/extc_stubs.c
 	ocamake $(FLAGS) $(LIBS_SRC) $(SRC) $(LIBS)
 
+xml:
+	(cd ${XML} && make xml-light.cmxa)
+
 universal: clean_haxe all
 	mv haxe haxe.intel
 	scp macmt:prog/lang/haxe/haxe haxe.ppc

+ 4 - 1
genswf8.ml

@@ -1426,7 +1426,10 @@ let generate file ver header infile types hres =
 	let t = Plugin.timer "generate swf" in
 	let file , codeclip = (try let f , c = ExtString.String.split file "@" in f, Some c with _ -> file , None) in
 	let tag_code, boot_name , movieclips = (if ver = 9 then
-			let c, b = Genswf9.generate types hres in
+			(* hack for an ocaml bug *)
+			let f (h:(string,string) Hashtbl.t) = Genswf9.generate types h in
+			let tmp : (string,string) Hashtbl.t = hres in
+			let c, b = f (Obj.magic tmp) in
 			c,b,[]
 		else
 			let c, m = generate_code file ver types hres in