Permalink
Browse files

sync build files for new cstruct with revised syntax

  • Loading branch information...
1 parent 8a8878b commit 89920e7ce1f2bcc391034391ad4701ec7397cf42 @avsm committed Sep 17, 2012
Showing with 50 additions and 30 deletions.
  1. +0 −13 unix/META.in
  2. +1 −1 unix/Makefile
  3. +5 −3 unix/_oasis
  4. +4 −5 unix/_tags
  5. +12 −8 unix/setup.ml
  6. +28 −0 unix/test.sh
View
@@ -1,13 +0,0 @@
-version = "@VERSION@"
-description = "Syntax extension to map C structs onto Bigarray buffers"
-archive(byte) = "cstruct.cma"
-archive(native) = "cstruct.cmxa"
-exists_if = "cstruct.cma"
-requires = "bigarray"
-package "syntax" (
- description = "Syntax extension for cstruct"
- requires = "camlp4"
- archive(syntax, preprocessor) = "cstruct-syntax.cma"
- archive(syntax, toploop) = "cstruct-syntax.cma"
- exists_if = "cstruct-syntax.cma"
-)
View
@@ -19,7 +19,7 @@ install: setup.data setup.ml
ocaml setup.ml -install
test: setup.ml build
- ocaml setup.ml -test
+ ./test.sh
reinstall: setup.ml
ocamlfind remove $(NAME) || true
View
@@ -1,10 +1,11 @@
-OASISFormat: 0.2
+OASISFormat: 0.3
Name: cstruct
Version: 0.4.1
Synopsis: Manipulate external buffers as C-like structs
Authors: Anil Madhavapeddy, Richard Mortier
License: ISC
-Plugins: META (0.2)
+Plugins: META (0.3)
+BuildTools: ocamlbuild
Library cstruct
Path: lib/
@@ -19,8 +20,9 @@ Library "cstruct-syntax"
FindlibParent: cstruct
BuildTools: ocamlbuild
Path: syntax
- BuildDepends: camlp4.lib, camlp4.quotations.o, camlp4.extend, bigarray
+ BuildDepends: camlp4.lib, camlp4.quotations.r, camlp4.extend, bigarray
Modules: Pa_cstruct
+ XMETAEnable: true
XMETAType: syntax
XMETADescription: Syntax extension for Cstruct
XMETARequires: camlp4
View
@@ -1,5 +1,5 @@
# OASIS_START
-# DO NOT EDIT (digest: 7a2a636dbc479dab875834a7a3f75927)
+# DO NOT EDIT (digest: 8638544cff7c44b188030d7179d64c58)
# Ignore VCS directories, you can use the same kind of rule outside
# OASIS_START/STOP if you want to exclude directories that contains
# useless stuff for the build process
@@ -23,11 +23,10 @@
# Library cstruct-syntax
"syntax/cstruct-syntax.cmxs": use_cstruct-syntax
<syntax/*.ml{,i}>: pkg_camlp4.lib
-<syntax/*.ml{,i}>: pkg_camlp4.quotations.o
+<syntax/*.ml{,i}>: pkg_camlp4.quotations.r
<syntax/*.ml{,i}>: pkg_camlp4.extend
<syntax/*.ml{,i}>: pkg_bigarray
# OASIS_STOP
-<**/*.ml>: syntax_camlp4o, pkg_camlp4
-<**/*.ml>: pa_lwt_options, pa_lwt, pa_lwt_log, pa_optcomp
-<syntax/*.ml>: -pa_lwt_options, -pa_lwt, -pa_lwt_log, -pa_optcomp
+<syntax/*.ml>: syntax_camlp4o, pkg_camlp4
+<lib_test/*.ml{i}>: syntax_camlp4o, pkg_camlp4, pkg_cstruct.syntax
true: annot
View
@@ -1,7 +1,7 @@
(* setup.ml generated for the first time by OASIS v0.3.0 *)
(* OASIS_START *)
-(* DO NOT EDIT (digest: 3686fd59fe598c924beb97c14354d951) *)
+(* DO NOT EDIT (digest: 4c38a25e7a65c0ed72430b9e48832c3c) *)
(*
Regenerated by OASIS v0.3.0
Visit http://oasis.forge.ocamlcore.org for more information and
@@ -5574,7 +5574,7 @@ let setup_t =
distclean_doc = [];
package =
{
- oasis_version = "0.2";
+ oasis_version = "0.3";
ocaml_version = None;
findlib_version = None;
name = "cstruct";
@@ -5643,7 +5643,9 @@ let setup_t =
bs_path = "lib/";
bs_compiled_object = Best;
bs_build_depends = [FindlibPackage ("bigarray", None)];
- bs_build_tools = [ExternalTool "ocamlbuild"];
+ bs_build_tools =
+ [ExternalTool "ocamlbuild"; ExternalTool "ocamlbuild"
+ ];
bs_c_sources = ["cstruct_stubs.c"];
bs_data_files = [];
bs_ccopt = [(OASISExpr.EBool true, ["-O3"])];
@@ -5675,11 +5677,13 @@ let setup_t =
bs_build_depends =
[
FindlibPackage ("camlp4.lib", None);
- FindlibPackage ("camlp4.quotations.o", None);
+ FindlibPackage ("camlp4.quotations.r", None);
FindlibPackage ("camlp4.extend", None);
FindlibPackage ("bigarray", None)
];
- bs_build_tools = [ExternalTool "ocamlbuild"];
+ bs_build_tools =
+ [ExternalTool "ocamlbuild"; ExternalTool "ocamlbuild"
+ ];
bs_c_sources = [];
bs_data_files = [];
bs_ccopt = [(OASISExpr.EBool true, [])];
@@ -5698,20 +5702,20 @@ let setup_t =
lib_findlib_containers = [];
})
];
- plugins = [(`Extra, "META", Some "0.2")];
+ plugins = [(`Extra, "META", Some "0.3")];
schema_data = PropList.Data.create ();
plugin_data = [];
};
oasis_fn = Some "_oasis";
oasis_version = "0.3.0";
- oasis_digest = Some "\011aÿÎ\127NTÓ \151ó8\tÜ\159Î";
+ oasis_digest = Some "\022ÚÝê\016)\146+Zý\131\148\000\028";
oasis_exec = None;
oasis_setup_args = [];
setup_update = false;
};;
let setup () = BaseSetup.setup setup_t;;
-# 5716 "setup.ml"
+# 5720 "setup.ml"
(* OASIS_STOP *)
let () = setup ();;
View
@@ -0,0 +1,28 @@
+#!/bin/sh -e
+
+function test {
+echo $1
+mkdir -p _build/lib_test
+cp lib_test/$1.ml _build/lib_test/$1.ml
+camlp4orf -printer o _build/syntax/cstruct-syntax.cma lib_test/$1.ml > _build/lib_test/$1.gen.ml
+camlp4orf -printer o _build/syntax/cstruct-syntax.cma lib_test/$1.mli > _build/lib_test/$1.gen.mli
+ocamlc -pp 'camlp4orf -printer o _build/syntax/cstruct-syntax.cma' -I _build/lib -i lib_test/$1.ml > _build/lib_test/$1.inferred.mli
+cp _build/lib_test/$1.inferred.mli _build/lib_test/$1.mli
+rm -f _build/lib_test/$1.cmi
+cd _build/lib_test
+ocamlc -pp 'camlp4orf ../syntax/cstruct-syntax.cma' -I ../lib -c $1.mli
+ocamlc -pp 'camlp4orf ../syntax/cstruct-syntax.cma' -I ../lib -c $1.ml
+ocamlc -custom -I ../lib unix.cma bigarray.cma cstruct.cma $1.cmo -o $1.byte
+./$1.byte
+cp $1.gen.mli $1.mli
+ocamlc -pp 'camlp4orf ../syntax/cstruct-syntax.cma' -I ../lib -c $1.mli
+ocamlc -pp 'camlp4orf ../syntax/cstruct-syntax.cma' -I ../lib -c $1.ml
+ocamlc -custom -I ../lib unix.cma bigarray.cma cstruct.cma $1.cmo -o $1.byte
+./$1.byte
+cd ../..
+}
+
+test basic
+test enum
+cp lib_test/http.cap _build/lib_test/http.cap
+test pcap

0 comments on commit 89920e7

Please sign in to comment.