Skip to content

Commit

Permalink
ocp-build: bootstrap for Cygwin
Browse files Browse the repository at this point in the history
  • Loading branch information
lefessan committed Oct 23, 2012
1 parent fd01f62 commit 0854222
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 6 deletions.
Binary file modified boot/ocp-build.boot
Binary file not shown.
2 changes: 1 addition & 1 deletion libs/stubs/win32/win32_fileinfo_c.c
Expand Up @@ -11,7 +11,7 @@
/* */
/******************************************************************************/

#ifdef __CYGWIN__
#ifdef ALSO__CYGWIN__
#define _WIN32
#endif

Expand Down
2 changes: 1 addition & 1 deletion libs/stubs/win32/win32_waitpids_c.c
Expand Up @@ -11,7 +11,7 @@
/* */
/******************************************************************************/

#ifdef __CYGWIN__
#ifdef ALSO__CYGWIN__
#define _WIN32
#endif

Expand Down
Binary file modified ocp-build/ocp-build.boot
Binary file not shown.
30 changes: 28 additions & 2 deletions ocp-build/win32_c.c
@@ -1,4 +1,17 @@
#ifdef __CYGWIN__
/******************************************************************************/
/* */
/* TypeRex OCaml Tools */
/* */
/* OCamlPro */
/* */
/* Copyright 2011-2012 OCamlPro */
/* All rights reserved. See accompanying files for the terms under */
/* which this file is distributed. In doubt, contact us at */
/* contact@ocamlpro.com (http://www.ocamlpro.com/) */
/* */
/******************************************************************************/

#ifdef ALSO__CYGWIN__
#define _WIN32
#endif

Expand Down Expand Up @@ -78,7 +91,20 @@ CAMLprim value win32_waitpids_ml(value ncount_v, value pid_reqs_v){
}

#endif
#ifdef __CYGWIN__
/******************************************************************************/
/* */
/* TypeRex OCaml Tools */
/* */
/* OCamlPro */
/* */
/* Copyright 2011-2012 OCamlPro */
/* All rights reserved. See accompanying files for the terms under */
/* which this file is distributed. In doubt, contact us at */
/* contact@ocamlpro.com (http://www.ocamlpro.com/) */
/* */
/******************************************************************************/

#ifdef ALSO__CYGWIN__
#define _WIN32
#endif

Expand Down
4 changes: 2 additions & 2 deletions tools/ocp-build/buildOCP.ml
Expand Up @@ -429,13 +429,13 @@ let magic = magic_head ^ magic_kind ^ magic_version
let magic_len = String.length magic

let save_project_state state filename =
let oc = File.X.open_out filename in
let oc = File.X.open_out_bin filename in
output_string oc magic;
output_value oc (state : project);
close_out oc

let load_project_state filename =
let ic = File.X.open_in filename in
let ic = File.X.open_in_bin filename in
let possible_magic = String.create magic_len in
begin try
really_input ic possible_magic 0 magic_len;
Expand Down
23 changes: 23 additions & 0 deletions tools/ocp-build/files/TODO.txt
Expand Up @@ -168,3 +168,26 @@ Fix problems with atomicity of copy of files on Windows

.mlpp files do not have a dependency to the version of the compiler ?
--> changing the version of the compiler should trigger a rebuild

------------------------------------------

From the "Shake" paper:
- add some time measurements on commands executed by the build system:
- can be used to compare the current compilation time with the
optimal compilation time
- can be used to display a nice colored graph showing which commands
have been executed in parallel (ocamlc, ocamlopt, ocamldep, camlp4, etc.)

Some questions that "Shake" can reply to:
- why some particular file was rebuilt ?
- If I modify a file, what will be rebuilt ?
- What's the most expensive file to modify ?
- Do my dependencies follow some good practices ? (we could tag some
modules as "internal" and verify that they are never used outside)

-----------------------------------------------

Can we use ocp-build as a one-liner to call ocamlc/ocamlopt to replace
ocamlfind ?

ocp-build ocamlc -c toto.ml ?

0 comments on commit 0854222

Please sign in to comment.