Revision 51c6666d8792ce05e0cfac0aa9eba11a78e1e15f authored by Jérémie Courrèges-Anglas on 17 September 2015, 13:24:21 UTC, committed by Roberto Di Cosmo on 17 September 2015, 13:37:17 UTC
Good news:

  https://forge.ocamlcore.org/plugins/scmgit/cgi-bin/gitweb.cgi?p=ocaml-autoconf/ocaml-autoconf.git;a=commitdiff;h=9e0d03be521283b59e002d91422b7695825195e3

With a fresher ocaml.m4 & ./configure, the following diff allows one to
automatically build the .cmxs on OpenBSD/amd64 (native dynlink
supported) and to skip it on OpenBSD/sparc64 (non-native).
1 parent 1cc6a04
Raw File
myocamlbuild.ml
open Ocamlbuild_plugin ;;

let _ = dispatch begin function
  | After_rules ->
      dep  ["compile"; "c"] ["config.h"];
      (* flag ["ocaml"; "compile"] & S[A"-ccopt"; A"-O9"]; *)
      flag ["compile"; "c"] & S[ A"-ccopt"; A"-D_GNU_SOURCE"; A"-ccopt"; A"-fPIC" ];

      flag ["link"; "library"; "ocaml"; "byte"; "use_libparmap"] &
        S[A"-dllib"; A"-lparmap_stubs";];
      flag ["link"; "library"; "ocaml"; "native"; "use_libparmap"] &
          S[A"-cclib"; A"-lparmap_stubs"];
      dep ["link"; "ocaml"; "use_libparmap"] ["libparmap_stubs.a"];
      flag ["link"; "ocaml"; "link_libparmap"] (A"libparmap_stubs.a");

  | _ -> ()
end
back to top