diff options
| author | Xavier Clerc <xavier.clerc@inria.fr> | 2013-09-09 09:32:00 +0000 |
|---|---|---|
| committer | Xavier Clerc <xavier.clerc@inria.fr> | 2013-09-09 09:32:00 +0000 |
| commit | e82104a755463d481667650ba4f00de535048f39 (patch) | |
| tree | 054c7de9b2992be063de2dd22b56ee5993d5a374 /myocamlbuild.ml | |
| parent | 83ca86dd2309914aa458bc25fd265f0bcadaa337 (diff) | |
| download | ocaml-e82104a755463d481667650ba4f00de535048f39.tar.gz | |
Remove labltk from the distribution (will be available as a third-party library).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14077 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'myocamlbuild.ml')
| -rw-r--r-- | myocamlbuild.ml | 239 |
1 files changed, 0 insertions, 239 deletions
diff --git a/myocamlbuild.ml b/myocamlbuild.ml index eabb24c634..bd6eb17d19 100644 --- a/myocamlbuild.ml +++ b/myocamlbuild.ml @@ -452,10 +452,6 @@ flag ["ocaml"; "compile"; "bootstrap_thread"] flag ["ocaml"; "link"; "bootstrap_thread"] (S[A"-I"; P systhreads_dir; A"-I"; P threads_dir]);; -flag ["ocaml"; "compile"; "otherlibs_labltk"] (S[A"-I"; P unix_dir]);; - -flag ["c"; "compile"; "otherlibs_labltk"] (S[A"-Ibyterun"; Sh C.tk_defs; Sh C.sharedcccompopts]);; - (* Sys threads *) let systhreads_stubs_headers = @@ -844,241 +840,6 @@ mk_camlp4 "camlp4oof" mk_camlp4 "camlp4orf" [pa_r; pa_o; pa_rp; pa_op; pa_qc; pa_rq; pa_g; pa_macro; pa_l] [pr_a] [];; - -(* Labltk *) - -Pathname.define_context "otherlibs/labltk/support" ["otherlibs/labltk/support"; "stdlib"];; -Pathname.define_context "otherlibs/labltk/compiler" ["otherlibs/labltk/compiler"; "otherlibs/labltk/support"; "stdlib"];; -Pathname.define_context "otherlibs/labltk/labltk" ["otherlibs/labltk/labltk"; "otherlibs/labltk/support"; "stdlib"];; -Pathname.define_context "otherlibs/labltk/camltk" ["otherlibs/labltk/camltk"; "otherlibs/labltk/support"; "stdlib"];; -Pathname.define_context "otherlibs/labltk/lib" - ["otherlibs/labltk/labltk"; "otherlibs/labltk/camltk"; "otherlibs/labltk/support"; "stdlib"];; -Pathname.define_context "otherlibs/labltk/jpf" - ["otherlibs/labltk/jpf"; "otherlibs/labltk/labltk"; "otherlibs/labltk/support"; "stdlib"];; -Pathname.define_context "otherlibs/labltk/frx" - ["otherlibs/labltk/frx"; "otherlibs/labltk/camltk"; "otherlibs/labltk/support"; "stdlib"];; -Pathname.define_context "otherlibs/labltk/browser" - ["otherlibs/labltk/browser"; "otherlibs/labltk/labltk"; "otherlibs/labltk/support"; "parsing"; "utils"; "typing"; "stdlib"];; - -rule "otherlibs/labltk/compiler/copyright" - ~dep:"otherlibs/labltk/compiler/copyright" - ~prod:"otherlibs/labltk/compiler/copyright.ml" - begin fun _ _ -> - Echo(["let copyright = \""; - Pathname.read "otherlibs/labltk/compiler/copyright"; - "\";;\nlet write ~w = w copyright;;"], - "otherlibs/labltk/compiler/copyright.ml") - end;; - -copy_rule "labltk tkcompiler" "otherlibs/labltk/compiler/maincompile.byte" "otherlibs/labltk/compiler/tkcompiler";; -copy_rule "labltk pp" "otherlibs/labltk/compiler/pp.byte" "otherlibs/labltk/compiler/pp";; -copy_rule "labltk ocamlbrowser" "otherlibs/labltk/browser/main.byte" "otherlibs/labltk/browser/ocamlbrowser";; - -let builtins = - let dir = "otherlibs/labltk/builtin" in - List.filter (fun f -> not (Pathname.is_directory f)) - (List.map (fun f -> dir/f) (Array.to_list (Pathname.readdir dir)));; - -let labltk_support = - ["support"; "rawwidget"; "widget"; "protocol"; "textvariable"; "timer"; "fileevent"; "camltkwrap"];; - -let labltk_generated_modules = - ["place"; "wm"; "imagephoto"; "canvas"; "button"; "text"; "label"; "scrollbar"; - "image"; "encoding"; "pixmap"; "palette"; "font"; "message"; "menu"; "entry"; - "listbox"; "focus"; "menubutton"; "pack"; "option"; "toplevel"; "frame"; - "dialog"; "imagebitmap"; "clipboard"; "radiobutton"; "tkwait"; "grab"; - "selection"; "scale"; "optionmenu"; "winfo"; "grid"; "checkbutton"; "bell"; "tkvars"];; - -let labltk_generated_files = - let dir = "otherlibs/labltk/labltk" in - List.fold_right (fun x acc -> dir/x-.-"ml" :: dir/x-.-"mli" :: acc) - labltk_generated_modules [] in - -rule "labltk/_tkgen.ml" - ~deps:(["otherlibs/labltk/Widgets.src"; "otherlibs/labltk/compiler/tkcompiler"] @ builtins) - ~prods:("otherlibs/labltk/labltk/_tkgen.ml" :: "otherlibs/labltk/labltk/labltk.ml" :: labltk_generated_files) - begin fun env _ -> - Cmd(S[A"cd"; A"otherlibs/labltk"; Sh"&&"; full_ocamlrun; - A"compiler/tkcompiler"; A"-outdir"; Px"labltk"]) - end;; - -let camltk_generated_modules = - ["cPlace"; "cResource"; "cWm"; "cImagephoto"; "cCanvas"; "cButton"; "cText"; "cLabel"; - "cScrollbar"; "cImage"; "cEncoding"; "cPixmap"; "cPalette"; "cFont"; "cMessage"; - "cMenu"; "cEntry"; "cListbox"; "cFocus"; "cMenubutton"; "cPack"; "cOption"; "cToplevel"; - "cFrame"; "cDialog"; "cImagebitmap"; "cClipboard"; "cRadiobutton"; "cTkwait"; "cGrab"; - "cSelection"; "cScale"; "cOptionmenu"; "cWinfo"; "cGrid"; "cCheckbutton"; "cBell"; "cTkvars"];; - -let camltk_generated_files = - let dir = "otherlibs/labltk/camltk" in - List.fold_right (fun x acc -> dir/x-.-"ml" :: dir/x-.-"mli" :: acc) - camltk_generated_modules [] in - -rule "camltk/_tkgen.ml" - ~deps:(["otherlibs/labltk/Widgets.src"; "otherlibs/labltk/compiler/tkcompiler"] @ builtins) - ~prods:("otherlibs/labltk/camltk/_tkgen.ml" :: "otherlibs/labltk/camltk/camltk.ml" :: camltk_generated_files) - begin fun env _ -> - Cmd(S[A"cd"; A"otherlibs/labltk"; Sh"&&"; full_ocamlrun; - A"compiler/tkcompiler"; A"-camltk"; A"-outdir"; Px"camltk"]) - end;; - -rule "tk.ml" - ~prod:"otherlibs/labltk/labltk/tk.ml" - ~deps:(["otherlibs/labltk/labltk/_tkgen.ml"; - "otherlibs/labltk/compiler/pp.byte"] - @ builtins) - begin fun _ _ -> - Seq[Cmd(Sh"\ - (echo 'open StdLabels'; \ - echo 'open Widget'; \ - echo 'open Protocol'; \ - echo 'open Support'; \ - echo 'open Textvariable'; \ - cat otherlibs/labltk/builtin/report.ml; \ - cat otherlibs/labltk/builtin/builtin_*.ml; \ - cat otherlibs/labltk/labltk/_tkgen.ml; \ - echo ; \ - echo ; \ - echo 'module Tkintf = struct'; \ - cat otherlibs/labltk/builtin/builtini_*.ml; \ - cat otherlibs/labltk/labltk/_tkigen.ml; \ - echo 'end (* module Tkintf *)'; \ - echo ; \ - echo ; \ - echo 'open Tkintf' ;\ - echo ; \ - echo ; \ - cat otherlibs/labltk/builtin/builtinf_*.ml; \ - cat otherlibs/labltk/labltk/_tkfgen.ml; \ - echo ; \ - ) > otherlibs/labltk/labltk/_tk.ml"); - Cmd(S[ocamlrun; P"otherlibs/labltk/compiler/pp.byte"; Sh"<"; P"otherlibs/labltk/labltk/_tk.ml"; - Sh">"; Px"otherlibs/labltk/labltk/tk.ml"]); - rm_f "otherlibs/labltk/labltk/_tk.ml"] - end;; - -rule "cTk.ml" - ~prod:"otherlibs/labltk/camltk/cTk.ml" - ~deps:(["otherlibs/labltk/camltk/_tkgen.ml"; - "otherlibs/labltk/compiler/pp.byte"] - @ builtins) - begin fun _ _ -> - Seq[Cmd(Sh"\ - (echo '##define CAMLTK'; \ - echo 'include Camltkwrap'; \ - echo 'open Widget'; \ - echo 'open Protocol'; \ - echo 'open Textvariable'; \ - echo ; \ - cat otherlibs/labltk/builtin/report.ml; \ - echo ; \ - cat otherlibs/labltk/builtin/builtin_*.ml; \ - echo ; \ - cat otherlibs/labltk/camltk/_tkgen.ml; \ - echo ; \ - echo ; \ - echo 'module Tkintf = struct'; \ - cat otherlibs/labltk/builtin/builtini_*.ml; \ - cat otherlibs/labltk/camltk/_tkigen.ml; \ - echo 'end (* module Tkintf *)'; \ - echo ; \ - echo ; \ - echo 'open Tkintf' ;\ - echo ; \ - echo ; \ - cat otherlibs/labltk/builtin/builtinf_*.ml; \ - cat otherlibs/labltk/camltk/_tkfgen.ml; \ - echo ; \ - ) > otherlibs/labltk/camltk/_cTk.ml"); - Cmd(S[ocamlrun; P"otherlibs/labltk/compiler/pp.byte"; Sh"<"; P"otherlibs/labltk/camltk/_cTk.ml"; - Sh">"; Px"otherlibs/labltk/camltk/cTk.ml"]); - rm_f "otherlibs/labltk/camltk/_cTk.ml"] - end;; - -let labltk_lib_contents = - labltk_support - @ "tk" - :: labltk_generated_modules - @ "cTk" - :: camltk_generated_modules - @ ["labltk"; "camltk"];; - -let labltk_contents obj_ext = - List.map (fun x -> "otherlibs/labltk/support"/x-.-obj_ext) labltk_support - @ "otherlibs/labltk/labltk/tk"-.-obj_ext - :: List.map (fun x -> "otherlibs/labltk/labltk"/x-.-obj_ext) labltk_generated_modules - @ "otherlibs/labltk/camltk/cTk"-.-obj_ext - :: List.map (fun x -> "otherlibs/labltk/camltk"/x-.-obj_ext) camltk_generated_modules - @ ["otherlibs/labltk/labltk/labltk"-.-obj_ext; - "otherlibs/labltk/camltk/camltk"-.-obj_ext] -;; - -let labltk_cma_contents = labltk_contents "cmo" in -rule "labltk.cma" - ~prod:"otherlibs/labltk/lib/labltk.cma" - ~deps:labltk_cma_contents - (Ocamlbuild_pack.Ocaml_compiler.byte_library_link_modules - labltk_lib_contents "otherlibs/labltk/lib/labltk.cma");; - -let labltk_cmxa_contents = labltk_contents "cmx" in -rule "labltk.cmxa" - ~prods:["otherlibs/labltk/lib/labltk.cmxa"; "otherlibs/labltk/lib/labltk"-.-C.a] - ~deps:labltk_cmxa_contents - (Ocamlbuild_pack.Ocaml_compiler.native_library_link_modules - labltk_lib_contents "otherlibs/labltk/lib/labltk.cmxa");; - -rule "labltktop" - ~prod:(add_exe "otherlibs/labltk/lib/labltktop") - ~deps:["toplevel/toplevellib.cma"; "toplevel/topstart.cmo"; - "otherlibs/labltk/lib/labltk.cma"; "otherlibs/labltk/support/liblabltk"-.-C.a] - begin fun _ _ -> - Cmd(S[!Options.ocamlc; A"-verbose"; A"-linkall"; A"-o"; Px(add_exe "otherlibs/labltk/lib/labltktop"); - A"-I"; P"otherlibs/labltk/support"; A"-I"; P"toplevel"; P"toplevellib.cma"; - A"-I"; P"otherlibs/labltk/labltk"; A"-I"; P"otherlibs/labltk/camltk"; - A"-I"; P"otherlibs/labltk/lib"; P"labltk.cma"; A"-I"; P unix_dir; P"unix.cma"; - A"-I"; P"otherlibs/str"; A"-I"; P "stdlib"; P"str.cma"; P"topstart.cmo"]) - end;; - -let labltk_installdir = C.libdir/"labltk" in -rule "labltk" - ~prod:"otherlibs/labltk/lib/labltk" - begin fun _ _ -> - Echo(["#!/bin/sh\n"; - Printf.sprintf "exec %s -I %s \"$@\"\n" (labltk_installdir/"labltktop") labltk_installdir], - "otherlibs/labltk/lib/labltk") - end;; - -use_lib "otherlibs/labltk/browser/main" "toplevel/toplevellib";; -use_lib "otherlibs/labltk/browser/main" "otherlibs/labltk/browser/jglib";; -use_lib "otherlibs/labltk/browser/main" "otherlibs/labltk/lib/labltk";; - -if windows then begin - - dep ["ocaml"; "link"; "program"; "ocamlbrowser"] ["otherlibs/labltk/browser/winmain"-.-C.o]; - flag ["ocaml"; "link"; "program"; "ocamlbrowser"] (S[A"-custom"; A"threads.cma"]); - - match ccomptype with - | "cc" -> flag ["ocaml"; "link"; "program"; "ocamlbrowser"] (S[A"-ccopt"; A"-Wl,--subsystem,windows"]) - | "msvc" -> flag ["ocaml"; "link"; "program"; "ocamlbrowser"] (S[A"-ccopt"; A"/link /subsystem:windows"]) - | _ -> assert false - -end;; - -let space_sep_strings s = Ocamlbuild_pack.Lexers.space_sep_strings (Lexing.from_string s);; - -flag [(* "ocaml" or "c"; *) "ocamlmklib"; "otherlibs_labltk"] - (if windows then begin - S(List.fold_right (fun s acc -> A"-cclib" :: A s :: acc) (space_sep_strings C.tk_link) []) - end else Sh C.tk_link);; - -flag ["ocaml"; "link"; "program"; "otherlibs_labltk"] (S[A"-I"; A"otherlibs/labltk/support"]);; - -flag ["c"; "compile"; "otherlibs_labltk"] (A"-Iotherlibs/labltk/support");; - -copy_rule "ocamlbrowser dummy module" - ("otherlibs/labltk/browser"/(if windows then "dummyWin.mli" else "dummyUnix.mli")) - "otherlibs/labltk/browser/dummy.mli";; - end in () | _ -> () end |
