Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005963OCamlOCamlbuild (the tool)public2013-03-27 11:592013-06-19 15:22
Reporterhcarty 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
StatusacknowledgedResolutionopen 
PlatformOSOS Version
Product Version4.00.1 
Target VersionFixed in Version 
Summary0005963: Include support for rpath and static linking flags in ocamlbuild
DescriptionThese are rather straightforward to support with command line flags or a myocamlbuild.ml plugin. It would be nice to have more robust support in the ocamlbuild tool itself though. For example, the sample plugin I've included only supports a single 'link.rpath' file. It would be nice to have the name of the file come from the matching executable target (foo.rpath -> foo.native).
Steps To ReproduceAn example myocamlbuild.ml which:
1. Creates an 'rpath' tag and reads link path information from "link.rpath"
2. Creates a 'static' tag for fully statically linked executables

  open Ocamlbuild_plugin
  
  let rpaths = string_list_of_file "link.rpath"
  let static_flags = S [A "-cclib"; A "-static"]
  
  let () = dispatch begin function
      | After_rules ->
        List.iter (
          fun path ->
            let rpath_flags = S [A "-cclib"; A ("-Wl,-rpath," ^ path)] in
            flag ["ocaml"; "link"; "program"; "rpath"] rpath_flags;
            flag ["ocaml"; "link"; "library"; "rpath"] rpath_flags;
        ) rpaths;
        flag ["ocaml"; "link"; "program"; "static"] static_flags;
      | _ -> ()
    end
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2013-03-27 11:59 hcarty New Issue
2013-06-19 15:22 doligez Status new => acknowledged


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker