Skip to content

Commit

Permalink
ocaml bindings: add findlib META support
Browse files Browse the repository at this point in the history
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
  • Loading branch information
edwintorok committed Oct 14, 2011
1 parent 3dd1674 commit 4c4b71c
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 1 deletion.
3 changes: 3 additions & 0 deletions autoconf/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
63 changes: 63 additions & 0 deletions bindings/ocaml/llvm/META.llvm.in
Original file line number Diff line number Diff line change
@@ -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"
)
21 changes: 21 additions & 0 deletions bindings/ocaml/llvm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Expand All @@ -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"

Expand Down

0 comments on commit 4c4b71c

Please sign in to comment.