Skip to content

Commit

Permalink
Add 'integers' link flags to the ctypes libraries.
Browse files Browse the repository at this point in the history
Without this, each client needs to link 'integers'.
  • Loading branch information
yallop committed May 22, 2017
1 parent 66cbc3f commit d20d3bb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ ctypes.public = unsigned signed lDouble complexL ctypes posixTypes ctypes_types
ctypes.dir = src/ctypes
ctypes.extra_mls = ctypes_primitives.ml
ctypes.deps = str bigarray bytes integers
ctypes.linkdeps = integers
ctypes.install = yes
ctypes.install_native_objects = yes
ifeq ($(XEN),enable)
Expand Down
10 changes: 7 additions & 3 deletions Makefile.rules
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,15 @@ XEN_CFLAGS=$(if $(XEN_LIB), \
CMO_OPTS = $($(PROJECT).cmo_opts)
CMX_OPTS = $($(PROJECT).cmx_opts)
CMI_OPTS = $($(PROJECT).cmi_opts)
CMA_OPTS = $(if $(C_OBJECTS),-cclib -l$(PROJECT)_stubs -dllib -l$(PROJECT)_stubs)
CMA_OPTS = $(if $(C_OBJECTS),-cclib -l$(PROJECT)_stubs -dllib -l$(PROJECT)_stubs) \
$(foreach libdep,$($(PROJECT).linkdeps),\
-cclib -l$(libdep) -dllib -l$(libdep))
SUBPROJECT_DEPS = $($(PROJECT).subproject_deps)
LOCAL_CMXAS = $(SUBPROJECT_DEPS:%=$(BUILDDIR)/%.cmxa)
LOCAL_CMAS = $(SUBPROJECT_DEPS:%=$(BUILDDIR)/%.cma)
CMXA_OPTS = $(if $(C_OBJECTS),-cclib -l$(PROJECT)_stubs)
CMXA_OPTS = $(if $(C_OBJECTS),-cclib -l$(PROJECT)_stubs)\
$(foreach libdep,$($(PROJECT).linkdeps),\
-cclib -l$(libdep))

OCAMLINCLUDES = -I $(BUILDDIR)/$($(PROJECT).dir) \
$(foreach spdep,$($(PROJECT).subproject_deps),\
Expand Down Expand Up @@ -99,7 +103,7 @@ $(BUILDDIR)/%.cmxs : $$(NATIVE_OBJECTS)
$(OCAMLFIND) opt -shared -linkall $(OCAMLFLAGS) $(THREAD_FLAG) $(OCAMLFIND_PACKAGE_FLAGS) -o $@ $(NATIVE_OBJECTS) $(C_OBJECTS) $(OCAML_LINK_FLAGS)

$(BUILDDIR)/%.cma: $$(BYTE_OBJECTS)
$(OCAMLFIND) ocamlc -a $(OCAMLFLAGS) $(THREAD_FLAG) $(CMA_OPTS) $(OCAMLFIND_PACKAGE_FLAGS) -o $@ $(BYTE_OBJECTS) $(OCAML_LINK_FLAGS)
$(OCAMLFIND) ocamlc -a -linkall $(OCAMLFLAGS) $(THREAD_FLAG) $(CMA_OPTS) $(OCAMLFIND_PACKAGE_FLAGS) -o $@ $(BYTE_OBJECTS) $(OCAML_LINK_FLAGS)

$(BUILDDIR)/%.cmo : %.ml
@mkdir -p $(@D)
Expand Down

0 comments on commit d20d3bb

Please sign in to comment.