Skip to content

Commit

Permalink
[enhance] mlstate_platform: mlstate_platform.h is now build in root b…
Browse files Browse the repository at this point in the history
…uild folder to avoid path related C source code
  • Loading branch information
Frederic Ye authored and Frederic Ye committed Oct 26, 2012
1 parent 3ef445b commit e41be99
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion compiler/passes/pass_CompileTimeDirective.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(*
Copyright © 2011 MLstate
Copyright © 2011, 2012 MLstate
This file is part of Opa.
Expand Down
2 changes: 1 addition & 1 deletion ocamllib/appruntime/io/binding_epoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <caml/fail.h>
#include <caml/threads.h>

#include "ocamllib/libbase/mlstate_platform.h"
#include "mlstate_platform.h"

#define EXPORT(name,v) \
CAMLprim value ep_##name() \
Expand Down
2 changes: 1 addition & 1 deletion ocamllib/appruntime/io/binding_iocp.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include <stdio.h>
#include <stdlib.h>

#include "ocamllib/libbase/mlstate_platform.h"
#include "mlstate_platform.h"

#ifdef MLSTATE_WINDOWS
#include <Winsock2.h>
Expand Down
4 changes: 2 additions & 2 deletions ocamllib/appruntime/io/dns.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2011 MLstate
Copyright © 2011, 2012 MLstate
This file is part of Opa.
Expand All @@ -23,7 +23,7 @@
#include <caml/fail.h>


#include "../../libbase/mlstate_platform.h"
#include "mlstate_platform.h"

#ifdef MLSTATE_WINDOWS

Expand Down
2 changes: 1 addition & 1 deletion ocamllib/libsecurity/binding_ssl_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#define SSL_val(v) (*((SSL**)Data_custom_val(v)))
#define ONELINE_NAME(X) X509_NAME_oneline(X, 0, 0)

#include "ocamllib/libbase/mlstate_platform.h"
#include "mlstate_platform.h"

#if defined (__APPLE__)
/* Disable depricated-declarations on OS X */
Expand Down
12 changes: 5 additions & 7 deletions tools/build/build_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,15 @@ let generate_ocamldep_rule ml_or_mli =
generate_ocamldep_rule "ml";
generate_ocamldep_rule "mli";

(* -- Macro-rules generating mlstate_platform.h files -- *)
(* TODO BUG 2 : droits du script invalides *)
(* TODO BUG 3 : path du fichier généré foireux *)
rule "mlstate_platform: () -> ocamllib/libbase/mlstate_platform.h"
(* -- Macro-rule generating mlstate_platform.h file -- *)
rule "mlstate_platform: () -> mlstate_platform.h"
~deps:(tool_deps mlstate_platform)
~prods:[libbase_dir/"mlstate_platform.h"]
~prods:["mlstate_platform.h"]
(fun env build ->
Seq[
Cmd(S[Sh"chmod +x"; P (libbase_dir/"gen_platform")]);
(* TODO : we should not need to change mode manually *)
chmod (A"+x") (libbase_dir/"gen_platform");
Cmd(S[get_tool mlstate_platform; A (if is_win32 then "WIN" else "")]);
Cmd(S[Sh"mv"; A"mlstate_platform.h"; P(libbase_dir/"mlstate_platform.h")])
]
);

Expand Down

0 comments on commit e41be99

Please sign in to comment.