projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[OCaml] Expose Llvm.parse_command_line_options.
[oota-llvm.git]
/
bindings
/
ocaml
/
Makefile.ocaml
diff --git
a/bindings/ocaml/Makefile.ocaml
b/bindings/ocaml/Makefile.ocaml
index 80dbf0fdd72d35e2b1adf021544679cbd838982a..d069c454cd0ffb6a156f5c6a51c456395488f019 100644
(file)
--- a/
bindings/ocaml/Makefile.ocaml
+++ b/
bindings/ocaml/Makefile.ocaml
@@
-1,20
+1,20
@@
##===- bindings/ocaml/Makefile.ocaml -----------------------*- Makefile -*-===##
##===- bindings/ocaml/Makefile.ocaml -----------------------*- Makefile -*-===##
-#
+#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
-#
+#
##===----------------------------------------------------------------------===##
##===----------------------------------------------------------------------===##
-#
+#
# An OCaml library is a unique project type in the context of LLVM, so rules are
# here rather than in Makefile.rules.
# An OCaml library is a unique project type in the context of LLVM, so rules are
# here rather than in Makefile.rules.
-#
+#
# Reference materials on installing OCaml libraries:
# Reference materials on installing OCaml libraries:
-#
+#
# https://fedoraproject.org/wiki/Packaging/OCaml
# http://pkg-ocaml-maint.alioth.debian.org/ocaml_packaging_policy.txt
# https://fedoraproject.org/wiki/Packaging/OCaml
# http://pkg-ocaml-maint.alioth.debian.org/ocaml_packaging_policy.txt
-#
+#
##===----------------------------------------------------------------------===##
include $(LEVEL)/Makefile.config
##===----------------------------------------------------------------------===##
include $(LEVEL)/Makefile.config
@@
-37,7
+37,7
@@
OcamlDir := $(LibDir)/ocaml
# Info from llvm-config and similar
ifndef IS_CLEANING_TARGET
ifdef UsedComponents
# Info from llvm-config and similar
ifndef IS_CLEANING_TARGET
ifdef UsedComponents
-UsedLibs = $(shell $(LLVM_CONFIG) --libs $(UsedComponents))
+UsedLibs = $(shell $(LLVM_CONFIG) --libs
--system-libs
$(UsedComponents))
UsedLibNames = $(shell $(LLVM_CONFIG) --libnames $(UsedComponents))
endif
endif
UsedLibNames = $(shell $(LLVM_CONFIG) --libnames $(UsedComponents))
endif
endif
@@
-61,23
+61,31
@@
ifneq ($(ObjectsO),)
OCAMLAFLAGS += $(patsubst %,-cclib %, \
$(filter-out -L$(LibDir),-l$(LIBRARYNAME) \
$(shell $(LLVM_CONFIG) --ldflags)) \
OCAMLAFLAGS += $(patsubst %,-cclib %, \
$(filter-out -L$(LibDir),-l$(LIBRARYNAME) \
$(shell $(LLVM_CONFIG) --ldflags)) \
- $(UsedLibs))
+ $(UsedLibs)
$(ExtraLibs)
)
else
OCAMLAFLAGS += $(patsubst %,-cclib %, \
$(filter-out -L$(LibDir),$(shell $(LLVM_CONFIG) --ldflags)) \
else
OCAMLAFLAGS += $(patsubst %,-cclib %, \
$(filter-out -L$(LibDir),$(shell $(LLVM_CONFIG) --ldflags)) \
- $(UsedLibs))
+ $(UsedLibs) $(ExtraLibs))
+endif
endif
endif
+
+ifneq ($(ENABLE_OPTIMIZED),1)
+ OCAMLDEBUGFLAG := -g
endif
endif
-
-# -g was introduced in 3.10.0.
-#ifneq ($(ENABLE_OPTIMIZED),1)
-# OCAMLDEBUGFLAG := -g
-#endif
Compile.CMI := $(strip $(OCAMLC) -c $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG) -o)
Compile.CMO := $(strip $(OCAMLC) -c $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG) -o)
Compile.CMX := $(strip $(OCAMLOPT) -c $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG) -o)
Compile.CMI := $(strip $(OCAMLC) -c $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG) -o)
Compile.CMO := $(strip $(OCAMLC) -c $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG) -o)
Compile.CMX := $(strip $(OCAMLOPT) -c $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG) -o)
+ifdef OCAMLSTUBS
+# Avoid the need for LD_LIBRARY_PATH
+ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
+ifneq ($(HOST_OS),Darwin)
+OCAMLRPATH := $(RPATH) -Wl,'$(SharedLibDir)'
+endif
+endif
+endif
+
ifdef OCAMLSTUBS
Archive.CMA := $(strip $(OCAMLC) -a -dllib -l$(LIBRARYNAME) $(OCAMLDEBUGFLAG) \
-o)
ifdef OCAMLSTUBS
Archive.CMA := $(strip $(OCAMLC) -a -dllib -l$(LIBRARYNAME) $(OCAMLDEBUGFLAG) \
-o)
@@
-88,7
+96,8
@@
endif
ifdef OCAMLSTUBS
Archive.CMXA := $(strip $(OCAMLOPT) -a $(patsubst %,-cclib %, \
ifdef OCAMLSTUBS
Archive.CMXA := $(strip $(OCAMLOPT) -a $(patsubst %,-cclib %, \
- $(LLVMLibsOptions) -l$(LIBRARYNAME)) \
+ $(LLVMLibsOptions) -l$(LIBRARYNAME) \
+ -L$(SharedLibDir) $(OCAMLRPATH)) \
$(OCAMLDEBUGFLAG) -o)
else
Archive.CMXA := $(strip $(OCAMLOPT) -a $(OCAMLAFLAGS) $(OCAMLDEBUGFLAG) -o)
$(OCAMLDEBUGFLAG) -o)
else
Archive.CMXA := $(strip $(OCAMLOPT) -a $(OCAMLAFLAGS) $(OCAMLDEBUGFLAG) -o)
@@
-142,7
+151,7
@@
OutputCMXA := $(LibraryCMXA:$(ObjDir)/%.cmxa=$(OcamlDir)/%.cmxa)
endif
ifdef OCAMLSTUBS
endif
ifdef OCAMLSTUBS
-SharedLib := $(OcamlDir)/dll$(LIBRARYNAME)
.
$(SHLIBEXT)
+SharedLib := $(OcamlDir)/dll$(LIBRARYNAME)$(SHLIBEXT)
endif
ifdef TOOLNAME
endif
ifdef TOOLNAME
@@
-163,7
+172,7
@@
DestCMXA := $(PROJ_libocamldir)/$(LIBRARYNAME).cmxa
endif
ifdef OCAMLSTUBS
endif
ifdef OCAMLSTUBS
-DestSharedLib := $(PROJ_libocamldir)/dll$(LIBRARYNAME)
.
$(SHLIBEXT)
+DestSharedLib := $(PROJ_libocamldir)/dll$(LIBRARYNAME)$(SHLIBEXT)
endif
##===- Dependencies -------------------------------------------------------===##
endif
##===- Dependencies -------------------------------------------------------===##
@@
-215,7
+224,7
@@
install-a:: $(LibraryA)
$(Echo) "Installing $(BuildMode) $(DestA)"
$(Verb) $(MKDIR) $(PROJ_libocamldir)
$(Verb) $(INSTALL) $(LibraryA) $(DestA)
$(Echo) "Installing $(BuildMode) $(DestA)"
$(Verb) $(MKDIR) $(PROJ_libocamldir)
$(Verb) $(INSTALL) $(LibraryA) $(DestA)
- $(Verb)
+ $(Verb)
uninstall-a::
$(Echo) "Uninstalling $(DestA)"
uninstall-a::
$(Echo) "Uninstalling $(DestA)"
@@
-233,7
+242,7
@@
uninstall-local:: uninstall-shared
$(SharedLib): $(ObjectsO) $(OcamlDir)/.dir
$(Echo) "Building $(BuildMode) $(notdir $@)"
$(SharedLib): $(ObjectsO) $(OcamlDir)/.dir
$(Echo) "Building $(BuildMode) $(notdir $@)"
- $(Verb) $(Link) $(SharedLinkOptions) $(LLVMLibsOptions) \
+ $(Verb) $(Link) $(SharedLinkOptions) $(
OCAMLRPATH) $(
LLVMLibsOptions) \
-o $@ $(ObjectsO)
clean-shared::
-o $@ $(ObjectsO)
clean-shared::
@@
-472,6
+481,7
@@
printcamlvars::
$(Echo) "DestSharedLib: " '$(DestSharedLib)'
$(Echo) "UsedLibs : " '$(UsedLibs)'
$(Echo) "UsedLibNames : " '$(UsedLibNames)'
$(Echo) "DestSharedLib: " '$(DestSharedLib)'
$(Echo) "UsedLibs : " '$(UsedLibs)'
$(Echo) "UsedLibNames : " '$(UsedLibNames)'
+ $(Echo) "ExtraLibs : " '$(ExtraLibs)'
.PHONY: printcamlvars build-cmis \
clean-a clean-cmis clean-cma clean-cmxa \
.PHONY: printcamlvars build-cmis \
clean-a clean-cmis clean-cma clean-cmxa \