summaryrefslogtreecommitdiff
path: root/bindings
diff options
context:
space:
mode:
authorMichal Gorny <mgorny@gentoo.org>2016-09-30 18:34:23 +0000
committerMichal Gorny <mgorny@gentoo.org>2016-09-30 18:34:23 +0000
commita7d748bbd354190b67801a68cba442c2590ca8e1 (patch)
tree68205447e84f4c25221a98a42fb9b8cb0ef2629b /bindings
parent9faad5871fb7c385f5f49eada8889f638ccc9795 (diff)
cmake: Install the OCaml libraries into a more correct path
Add a OCAML_INSTALL_PATH variable that can be used to control the install path for OCaml libraries. The new variable defaults to ${OCAML_STDLIB_PATH}, i.e. the OCaml library path obtained from the OCaml compiler. Install libraries into "llvm" subdirectory. This fixes two issues: 1. OCaml library directories differ between systems, and 'lib/ocaml' is incorrect e.g. on amd64 Gentoo where OCaml is installed in 'lib64/ocaml'. Therefore, obtain the library path from the OCaml compiler using 'ocamlc -where' (which is already used to set OCAML_STDLIB_PATH), which is the method used commonly in OCaml packages. 2. The top-level directory is reserved for the standard library, and has precedence over local directory in search path. As a result, OCaml preferred the files installed along with previous LLVM version over the source tree when building a new version, resulting in two versions being mixed during the build. The new layout is used commonly by other OCaml packages, and findlib is able to find the LLVM libraries successfully. Bug: https://bugs.gentoo.org/559134 Bug: https://bugs.gentoo.org/559624 Differential Revision: https://reviews.llvm.org/D24354 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282895 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings')
-rw-r--r--bindings/ocaml/backends/CMakeLists.txt2
-rw-r--r--bindings/ocaml/backends/META.llvm_backend.in2
-rw-r--r--bindings/ocaml/llvm/CMakeLists.txt2
-rw-r--r--bindings/ocaml/llvm/META.llvm.in2
4 files changed, 4 insertions, 4 deletions
diff --git a/bindings/ocaml/backends/CMakeLists.txt b/bindings/ocaml/backends/CMakeLists.txt
index a98063895d7..18d62a85738 100644
--- a/bindings/ocaml/backends/CMakeLists.txt
+++ b/bindings/ocaml/backends/CMakeLists.txt
@@ -23,5 +23,5 @@ foreach(TARGET ${LLVM_TARGETS_TO_BUILD})
"${LLVM_LIBRARY_DIR}/ocaml/META.llvm_${TARGET}")
install(FILES "${LLVM_LIBRARY_DIR}/ocaml/META.llvm_${TARGET}"
- DESTINATION lib/ocaml)
+ DESTINATION "${LLVM_OCAML_INSTALL_PATH}")
endforeach()
diff --git a/bindings/ocaml/backends/META.llvm_backend.in b/bindings/ocaml/backends/META.llvm_backend.in
index 6c1e8c47259..bd23abe0ca4 100644
--- a/bindings/ocaml/backends/META.llvm_backend.in
+++ b/bindings/ocaml/backends/META.llvm_backend.in
@@ -4,4 +4,4 @@ description = "@TARGET@ Backend for LLVM"
requires = "llvm"
archive(byte) = "llvm_@TARGET@.cma"
archive(native) = "llvm_@TARGET@.cmxa"
-directory = "."
+directory = "llvm"
diff --git a/bindings/ocaml/llvm/CMakeLists.txt b/bindings/ocaml/llvm/CMakeLists.txt
index 4956fa4dade..db7aee2adff 100644
--- a/bindings/ocaml/llvm/CMakeLists.txt
+++ b/bindings/ocaml/llvm/CMakeLists.txt
@@ -8,4 +8,4 @@ configure_file(
"${LLVM_LIBRARY_DIR}/ocaml/META.llvm")
install(FILES "${LLVM_LIBRARY_DIR}/ocaml/META.llvm"
- DESTINATION lib/ocaml)
+ DESTINATION "${LLVM_OCAML_INSTALL_PATH}")
diff --git a/bindings/ocaml/llvm/META.llvm.in b/bindings/ocaml/llvm/META.llvm.in
index 92896e387a6..adafd788ebf 100644
--- a/bindings/ocaml/llvm/META.llvm.in
+++ b/bindings/ocaml/llvm/META.llvm.in
@@ -3,7 +3,7 @@ version = "@PACKAGE_VERSION@"
description = "LLVM OCaml bindings"
archive(byte) = "llvm.cma"
archive(native) = "llvm.cmxa"
-directory = "."
+directory = "llvm"
package "analysis" (
requires = "llvm"