~ubuntu-branches/ubuntu/lucid/mtasc/lucid

« back to all changes in this revision

Viewing changes to ocaml/mtasc/doc/install.ml

  • Committer: Bazaar Package Importer
  • Author(s): Paul Wise
  • Date: 2007-05-23 19:17:16 UTC
  • mfrom: (1.1.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20070523191716-4lrirvywkykkzsp2
Tags: 1.13-1
* New upstream release (Closes: #425530)
  - drop changes to install.ml - use new Makefile instead
  - drop HelloWorld.as, mtasc.1 - included upstream
  - remove new copy of zlib when generating the tarball
* Generate a ChangeLog when creating the tarball and install it
* The Windows compiled version is updated more, watch it
* Change my email address now that I'm a Debian Developer
* Bump Standards-Version (no changes)
* Bump debhelper compatibility level
* Split all changes into quilt patches
* Place packaging in the public domain
* Install CHANGES.txt as a NEWS file and also install Future.txt
* Test-build HelloWorld.as

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
(* ----- BEGIN CONFIGURATION ---- *)
24
24
 
25
 
let zlib = "/usr/lib/libz.so"
26
 
let bytecode = ref false
27
 
let native = ref false
 
25
let zlib = match Sys.os_type with "Win32" -> "zlib.lib" | _ -> "-lz"
 
26
let bytecode = true
 
27
let native = true
28
28
 
29
29
(* ------ END CONFIGURATION ----- *)
30
30
 
43
43
        command ("cvs -z3 -d" ^ root ^ " " ^ cmd)
44
44
 
45
45
let ocamlc file =
46
 
        if !bytecode then command ("ocamlfind ocamlc -c " ^ file);
47
 
        if !native then command ("ocamlfind ocamlopt -c " ^ file)
 
46
        if bytecode then command ("ocamlc -c " ^ file);
 
47
        if native then command ("ocamlopt -c " ^ file)
48
48
 
49
49
let modules l ext =
50
50
        String.concat " " (List.map (fun f -> f ^ ext) l)
51
51
 
52
52
;;
53
53
 
54
 
(*
55
 
let sourceforge = ":pserver:anonymous@cvs.sourceforge.net:/cvsroot/ocaml-lib" in
56
54
let motiontwin = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot" in
57
55
 
58
56
let download () =
59
57
 
60
58
        msg "*** Please hit enter on login (empty password) ***";
61
 
        cvs sourceforge "login";
62
 
        cvs sourceforge "co extlib-dev";
63
 
 
64
 
        msg "*** Please hit enter on login (empty password) ***";
65
59
        cvs motiontwin "login";
 
60
        cvs motiontwin "co ocaml/extlib-dev";
66
61
        cvs motiontwin "co ocaml/mtasc";
67
62
        cvs motiontwin "co ocaml/swflib";
68
63
        cvs motiontwin "co ocaml/extc";
69
64
        
70
65
in
71
 
*)
72
66
 
73
67
let compile() =
74
68
 
75
 
        (* (try Unix.mkdir "bin" 0o740 with Unix.Unix_error(Unix.EEXIST,_,_) -> ()); *)
 
69
        (try Unix.mkdir "bin" 0o740 with Unix.Unix_error(Unix.EEXIST,_,_) -> ());
76
70
 
77
71
        (* EXTLIB *)
78
 
        (*
79
 
        Sys.chdir "extlib-dev";
80
 
        command ("ocaml install.ml -nodoc -d ../ocaml " ^ (if bytecode then "-b " else "") ^ (if native then "-n" else ""));
 
72
        Sys.chdir "ocaml/extlib-dev";
 
73
        command ("ocaml install.ml -nodoc -d .. " ^ (if bytecode then "-b " else "") ^ (if native then "-n" else ""));
81
74
        msg "";
82
 
        Sys.chdir "..";
83
 
        *)
 
75
        Sys.chdir "../..";
84
76
 
85
77
        (* EXTC *)
86
78
        Sys.chdir "ocaml/extc";
87
79
        let c_opts = (if Sys.ocaml_version < "3.08" then " -ccopt -Dcaml_copy_string=copy_string " else " ") in
88
 
        command ("ocamlfind ocamlc" ^ c_opts ^ "extc_stubs.c");
 
80
        command ("ocamlc" ^ c_opts ^ "extc_stubs.c");
89
81
 
90
82
        let options = "-cclib ../extc/extc_stubs" ^ obj_ext ^ " -cclib " ^ zlib ^ " extc.mli extc.ml" in
91
 
        if !bytecode then command ("ocamlfind ocamlc -a -o extc.cma " ^ options);
92
 
        if !native then command ("ocamlfind ocamlopt -a -o extc.cmxa " ^ options);
 
83
        if bytecode then command ("ocamlc -a -o extc.cma " ^ options);
 
84
        if native then command ("ocamlopt -a -o extc.cmxa " ^ options);
93
85
        Sys.chdir "../..";
94
86
 
95
87
        (* SWFLIB *)
96
88
        Sys.chdir "ocaml/swflib";
97
 
        let files = "-I .. -I ../extc swf.ml swfZip.ml actionScript.ml swfParser.ml" in
98
 
        if !bytecode then command ("ocamlfind ocamlc -package extlib -a -o swflib.cma " ^ files);
99
 
        if !native then command ("ocamlfind ocamlopt -package extlib -a -o swflib.cmxa " ^ files);
 
89
        let files = "-I .. -I ../extc as3.mli as3code.ml as3parse.ml swf.ml swfZip.ml actionScript.ml swfParser.ml" in
 
90
        if bytecode then command ("ocamlc -a -o swflib.cma " ^ files);
 
91
        if native then command ("ocamlopt -a -o swflib.cmxa " ^ files);
100
92
        Sys.chdir "../..";
101
93
 
102
94
        (* MTASC *)
104
96
        command "ocamllex lexer.mll";
105
97
        ocamlc "expr.ml lexer.ml";
106
98
        ocamlc "-pp camlp4o parser.ml";
107
 
        ocamlc "-package extlib -I .. -I ../extc -I ../swflib typer.ml class.ml plugin.ml genSwf.ml main.ml";
 
99
        ocamlc "-I .. -I ../extc -I ../swflib typer.ml class.ml plugin.ml genSwf.ml main.ml";
108
100
        let mlist = ["expr";"lexer";"parser";"typer";"class";"plugin";"genSwf";"main"] in
109
 
        if !bytecode then command ("ocamlfind ocamlc -package extlib -custom -o mtasc" ^ exe_ext ^ " extLib.cma ../extc/extc.cma ../swflib/swflib.cma " ^ modules mlist ".cmo");
110
 
        if !native then command ("ocamlfind ocamlopt -package extlib -o mtasc" ^ exe_ext ^ " extLib.cmxa ../extc/extc.cmxa ../swflib/swflib.cmxa " ^ modules mlist ".cmx");
 
101
        if bytecode then command ("ocamlc -custom -o ../../bin/mtasc-byte" ^ exe_ext ^ " ../extLib.cma ../extc/extc.cma ../swflib/swflib.cma " ^ modules mlist ".cmo");
 
102
        if native then command ("ocamlopt -o ../../bin/mtasc" ^ exe_ext ^ " ../extLib.cmxa ../extc/extc.cmxa ../swflib/swflib.cmxa " ^ modules mlist ".cmx");
111
103
 
112
104
in
113
105
let startdir = Sys.getcwd() in
114
106
try
115
 
        let args = ref [] in
116
 
        Arg.parse [
117
 
                "-b", Arg.Set bytecode, "build bytecode version";
118
 
                "-n", Arg.Set native, "native code version";
119
 
        ] (fun argi -> args := argi :: !args) "Usage:";
 
107
        download();
120
108
        compile();
121
109
        Sys.chdir startdir;
122
110
with