<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Fix LLVM_OCAML_OUT_OF_TREE"
   href="https://bugs.llvm.org/show_bug.cgi?id=34115">34115</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Fix LLVM_OCAML_OUT_OF_TREE
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Build scripts
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>cmake
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>jp.deplaix@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mgorny@gentoo.org, whitequark@whitequark.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=18944" name="attach_18944" title="The fix">attachment 18944</a> <a href="attachment.cgi?id=18944&action=edit" title="The fix">[details]</a></span>
The fix

If OCaml is not installed in the same tree as LLVM (e.g. with OPAM), the build
script doesn't work. Moreover, if SHARED_LIBS is enabled, the resulting binding
won't be dynamically linked.

Here is a patch that tries to fix these two issues.
The patch also fixes the build instructions.

I also tried to allow both static and shared libraries if possible (see OPAM
package) but my level of comprehension of CMake is quite limited so I gave up.
But if anybody have any idea how to do that better, please feel free to discuss
this matter here.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>