Permalink
Browse files

Started the portage to Dibrawi.

Installed the omake setup, and started removing the Batteries
dependency.
  • Loading branch information...
1 parent 226c013 commit 3e4f108e3a9a3a2630d498905ba2d5d94664a638 @smondet committed Dec 6, 2009
Showing with 222 additions and 122 deletions.
  1. +3 −0 .gitignore
  2. +47 −0 OMakefile
  3. +9 −0 OMakeroot
  4. +0 −76 myocamlbuild.ml
  5. +7 −0 src/app/OMakefile
  6. +10 −0 src/lib/OMakefile
  7. +89 −0 src/lib/Yaboon_PolyComp.ml
  8. +39 −38 src/lib/dibrawi.ml
  9. +18 −8 src/lib/dibrawi_std.ml
View
@@ -3,3 +3,6 @@ dbw
dbw.native
dbwpp
dbwpp.native
+*~
+*.omc
+.omake*
View
@@ -0,0 +1,47 @@
+
+
+
+.PHONY: clean update_yaboons
+
+USE_OCAMLFIND = true
+
+OCAMLPACKS[] =
+ xml-light
+ unix
+ extlib
+ pcre
+ sexplib.syntax
+
+
+if $(not $(OCAMLFIND_EXISTS))
+ eprintln(This project requires ocamlfind, but is was not found.)
+ eprintln(You need to install ocamlfind and run "omake --configure".)
+ exit 1
+
+NATIVE_ENABLED = $(OCAMLOPT_EXISTS)
+BYTE_ENABLED = $(not $(OCAMLOPT_EXISTS))
+
+OCAMLFLAGS +=
+OCAMLCFLAGS +=
+OCAMLOPTFLAGS +=
+OCAML_LINK_FLAGS +=
+OCAML_BYTE_LINK_FLAGS +=
+OCAML_NATIVE_LINK_FLAGS +=
+OCAMLFINDFLAGS += -syntax camlp4o
+
+
+clean:
+ rm -fr _build OMakefile.omc OMakeroot.omc .omakedb .omakedb.lock
+
+update_yaboons: # Go for the last version
+ svn export http\://yaboon.googlecode.com/svn/trunk/PolyComp/PolyComp.ml src/lib/Yaboon_PolyComp.ml
+
+
+if $(not $(file-exists _build/))
+ mkdir -p _build/lib _build/app
+
+vmount(-l, src/, _build/)
+
+
+.SUBDIRS: _build/lib _build/app
+
View
@@ -0,0 +1,9 @@
+
+#open build/C
+open build/OCaml
+#open build/LaTeX
+
+DefineCommandVars()
+
+
+.SUBDIRS: .
View
@@ -1,76 +0,0 @@
-
-(*
- * this ocamlbuild plugin allows to use ocamlfind with pkg_<packagename> tags
- *
- * found there:
- * http://brion.inria.fr/gallium/index.php/Using_ocamlfind_with_ocamlbuild
- * *)
-
-open Ocamlbuild_plugin
-open Command (* no longer needed for OCaml >= 3.10.2 *)
-
-(* these functions are not really officially exported *)
-let run_and_read = Ocamlbuild_pack.My_unix.run_and_read
-let blank_sep_strings = Ocamlbuild_pack.Lexers.blank_sep_strings
-
-(* this lists all supported packages *)
-let find_packages () =
- blank_sep_strings &
- Lexing.from_string &
- run_and_read "ocamlfind list | cut -d' ' -f1"
-
-(* this is supposed to list available syntaxes, but I don't know how to do it. *)
-let find_syntaxes () = ["camlp4o"; "camlp4r"]
-
-(* ocamlfind command *)
-let ocamlfind x = S[A"ocamlfind"; x]
-
-let _ = dispatch begin function
- | Before_options ->
- (* by using Before_options one let command line options have an higher priority *)
- (* on the contrary using After_options will guarantee to have the higher priority *)
-
- (* override default commands by ocamlfind ones *)
- Options.ocamlc := ocamlfind & A"ocamlc";
- Options.ocamlopt := ocamlfind & A"ocamlopt";
- Options.ocamldep := ocamlfind & A"ocamldep";
- Options.ocamldoc := ocamlfind & A"ocamldoc";
- Options.ocamlmktop := ocamlfind & A"ocamlmktop"
-
- | After_rules ->
-
- (* When one link an OCaml library/binary/package, one should use -linkpkg *)
- flag ["ocaml"; "link"] & A"-linkpkg";
-
- (* For each ocamlfind package one inject the -package option when
- * compiling, computing dependencies, generating documentation and
- * linking. *)
- List.iter begin fun pkg ->
- flag ["ocaml"; "compile"; "pkg_"^pkg] & S[A"-package"; A pkg];
- flag ["ocaml"; "ocamldep"; "pkg_"^pkg] & S[A"-package"; A pkg];
- flag ["ocaml"; "doc"; "pkg_"^pkg] & S[A"-package"; A pkg];
- flag ["ocaml"; "link"; "pkg_"^pkg] & S[A"-package"; A pkg];
- end (find_packages ());
-
- (* Like -package but for extensions syntax. Morover -syntax is useless
- * when linking. *)
- List.iter begin fun syntax ->
- flag ["ocaml"; "compile"; "syntax_"^syntax] & S[A"-syntax"; A syntax];
- flag ["ocaml"; "ocamldep"; "syntax_"^syntax] & S[A"-syntax"; A syntax];
- flag ["ocaml"; "doc"; "syntax_"^syntax] & S[A"-syntax"; A syntax];
- end (find_syntaxes ());
-
- (* The default "thread" tag is not compatible with ocamlfind.
- Indeed, the default rules add the "threads.cma" or "threads.cmxa"
- options when using this tag. When using the "-linkpkg" option with
- ocamlfind, this module will then be added twice on the command line.
-
- To solve this, one approach is to add the "-thread" option when using
- the "threads" package using the previous plugin.
- *)
- flag ["ocaml"; "pkg_threads"; "compile"] (S[A "-thread"]);
- flag ["ocaml"; "pkg_threads"; "link"] (S[A "-thread"])
-
- | _ -> ()
-end
-
View
@@ -0,0 +1,7 @@
+
+OCAML_LIBS += ../lib/dibrawi
+OCAMLINCLUDES += ../lib/
+
+test_dbw: $(OCamlProgram test_dbw, test_dbw)
+
+.DEFAULT: $(OCamlProgram dbw, dbw) $(OCamlProgram dbwpp, dbwpp)
View
@@ -0,0 +1,10 @@
+
+LIB_MODULES[] =
+ Yaboon_PolyComp
+ dibrawi_std
+ dibrawi_templating
+ dibrawi
+
+LIB_NAME = dibrawi
+
+.DEFAULT: $(OCamlLibrary $(LIB_NAME), $(LIB_MODULES))
View
@@ -0,0 +1,89 @@
+(******************************************************************************)
+(* Copyright (c) 2008, Sebastien Mondet *)
+(* *)
+(* Permission is hereby granted, free of charge, to any person *)
+(* obtaining a copy of this software and associated documentation *)
+(* files (the "Software"), to deal in the Software without *)
+(* restriction, including without limitation the rights to use, *)
+(* copy, modify, merge, publish, distribute, sublicense, and/or sell *)
+(* copies of the Software, and to permit persons to whom the *)
+(* Software is furnished to do so, subject to the following *)
+(* conditions: *)
+(* *)
+(* The above copyright notice and this permission notice shall be *)
+(* included in all copies or substantial portions of the Software. *)
+(* *)
+(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *)
+(* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *)
+(* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *)
+(* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *)
+(* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, *)
+(* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)
+(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR *)
+(* OTHER DEALINGS IN THE SOFTWARE. *)
+(******************************************************************************)
+
+module Comparisons = struct
+ let eqpoly = (=)
+ let nepoly = (<>)
+ let ltpoly = (<)
+ let gtpoly = (>)
+ let lepoly = (<=)
+ let gepoly = (>=)
+
+ let eqphy = (==)
+
+ let eqi (a:int) (b:int) = eqpoly a b
+ let eqf (a:float) (b:float) = eqpoly a b
+ let nei (a:int) (b:int) = nepoly a b
+ let nef (a:float) (b:float) = nepoly a b
+ let lti (a:int) (b:int) = ltpoly a b
+ let ltf (a:float) (b:float) = ltpoly a b
+ let gti (a:int) (b:int) = gtpoly a b
+ let gtf (a:float) (b:float) = gtpoly a b
+ let lei (a:int) (b:int) = lepoly a b
+ let lef (a:float) (b:float) = lepoly a b
+ let gei (a:int) (b:int) = gepoly a b
+ let gef (a:float) (b:float) = gepoly a b
+
+ let eqs (a:string) (b:string) = (String.compare a b) = 0
+
+ let minpoly = min
+ let maxpoly = max
+ let mini (a:int) (b:int) = minpoly a b
+ let minf (a:float) (b:float) = minpoly a b
+ let maxi (a:int) (b:int) = maxpoly a b
+ let maxf (a:float) (b:float) = maxpoly a b
+end
+module NoPolyPhy = struct
+ type shouldnt_be_used
+ let (==) (x:shouldnt_be_used) (y:shouldnt_be_used) = false
+ let (!=) (x:shouldnt_be_used) (y:shouldnt_be_used) = false
+end
+
+module CompAndNoPolyPhy = struct
+ include Comparisons
+ include NoPolyPhy
+end
+
+module CompAndOveridePoly = struct
+ include CompAndNoPolyPhy
+ let (=) = eqi
+ let (=.) = eqf
+ let (<>) = eqi
+ let (<>.) = eqf
+ let (<) = lti
+ let (<.) = ltf
+ let (>) = gti
+ let (>.) = gtf
+ let (<=) = lei
+ let (<=.)= lef
+ let (>=) = gei
+ let (>=.)= gef
+ let (=$=) = eqs
+ let (=@=) = eqpoly
+ let min = mini
+ let max = maxi
+end
+
+
Oops, something went wrong.

0 comments on commit 3e4f108

Please sign in to comment.