ocaml bindings: add findlib META support

This makes it easier to link against LLVM libs, especially if you are using
_oasis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141992 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Torok Edwin 2011-10-14 20:38:02 +00:00
parent 3dd1674186
commit 4c4b71cec5
4 changed files with 88 additions and 1 deletions

View File

@ -1563,6 +1563,9 @@ fi
dnl Do the first stage of configuration for llvm-config.in.
AC_CONFIG_FILES([tools/llvm-config/llvm-config.in])
dnl OCaml findlib META file
AC_CONFIG_FILES([bindings/ocaml/llvm/META.llvm])
dnl Do special configuration of Makefiles
AC_CONFIG_COMMANDS([setup],,[llvm_src="${srcdir}"])
AC_CONFIG_MAKEFILE(Makefile)

View File

@ -0,0 +1,63 @@
name = "llvm"
version = "@PACKAGE_VERSION@"
description = "Low Level Virtual Machine OCaml bindings"
archive(byte) = "llvm.cma"
archive(native) = "llvm.cmxa"
directory = "."
linkopts = "-ccopt -lstdc++"
package "analysis" (
requires = "llvm"
version = "@PACKAGE_VERSION@"
description = "Intermediate representation analysis for LLVM"
archive(byte) = "llvm_analysis.cma"
archive(native) = "llvm_analysis.cmxa"
)
package "bitreader" (
requires = "llvm"
version = "@PACKAGE_VERSION@"
description = "Bitcode reader for LLVM"
archive(byte) = "llvm_bitreader.cma"
archive(native) = "llvm_bitreader.cmxa"
)
package "bitwriter" (
requires = "llvm,unix"
version = "@PACKAGE_VERSION@"
description = "Bitcode writer for LLVM"
archive(byte) = "llvm_bitwriter.cma"
archive(native) = "llvm_bitwriter.cmxa"
)
package "executionengine" (
requires = "llvm,llvm.target"
version = "@PACKAGE_VERSION@"
description = "JIT and Interpreter for LLVM"
archive(byte) = "llvm_executionengine.cma"
archive(native) = "llvm_executionengine.cmxa"
)
package "ipo" (
requires = "llvm"
version = "@PACKAGE_VERSION@"
description = "IPO Transforms for LLVM"
archive(byte) = "llvm_ipo.cma"
archive(native) = "llvm_ipo.cmxa"
)
package "scalar_opts" (
requires = "llvm"
version = "@PACKAGE_VERSION@"
description = "Scalar Transforms for LLVM"
archive(byte) = "llvm_scalar_opts.cma"
archive(native) = "llvm_scalar_opts.cmxa"
)
package "target" (
requires = "llvm"
version = "@PACKAGE_VERSION@"
description = "Target Information for LLVM"
archive(byte) = "llvm_target.cma"
archive(native) = "llvm_target.cmxa"
)

View File

@ -17,3 +17,24 @@ UsedComponents := core
UsedOcamLibs := llvm
include ../Makefile.ocaml
all-local:: copy-meta
install-local:: install-meta
uninstall-local:: uninstall-meta
DestMETA := $(PROJ_libocamldir)/META.llvm
# Easy way of generating META in the objdir
copy-meta: $(OcamlDir)/META.llvm
$(OcamlDir)/META.llvm: META.llvm
$(Verb) $(CP) -f $< $@
install-meta:: $(ObjDir)/META.llvm
$(Echo) "Install $(BuildMode) $(DestMETA)"
$(Verb) $(MKDIR) $(PROJ_libocamldir)
$(Verb) $(DataInstall) META.llvm "$(DestMETA)"
uninstall-meta::
$(Echo) "Uninstalling $(DestMETA)"
-$(Verb) $(RM) -f "$(DestMETA)"

2
configure vendored
View File

@ -21052,7 +21052,6 @@ ac_config_headers="$ac_config_headers include/llvm/Support/DataTypes.h"
ac_config_files="$ac_config_files Makefile.config"
ac_config_files="$ac_config_files llvm.spec"
@ -21065,6 +21064,7 @@ fi
ac_config_files="$ac_config_files tools/llvm-config/llvm-config.in"
ac_config_files="$ac_config_files bindings/ocaml/llvm/META.llvm"
ac_config_commands="$ac_config_commands setup"