aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Emilio Jesus Gallego Arias <e+git@x80.org>2017-12-16 08:30:47 +0100
committerGravatar Emilio Jesus Gallego Arias <e+git@x80.org>2017-12-16 08:30:47 +0100
commitafd9f3621d5c8c12c8d52bd233c77a92bd3afe16 (patch)
tree9be4eb768cbbb4940e424bfe9a68f3219fe986fc
parent50bd89748af03bb28ad7024f2ceef500489a91b0 (diff)
[make] More build fixes for static plugins and ocamlfind.
- In ocamlfind-based byte builds, link the VM statically as in native builds. This is the best way to get reliable, path-independent self-contained executables. - In `make install`, install the `.cmx` files for plugins too. To statically link Coq plugins in native mode, both the `.cmx` and `.o` files must be present.
-rw-r--r--META.coq14
-rw-r--r--Makefile.install7
2 files changed, 13 insertions, 8 deletions
diff --git a/META.coq b/META.coq
index 504a85ba6..d31b60cd0 100644
--- a/META.coq
+++ b/META.coq
@@ -47,13 +47,17 @@ package "vm" (
directory = "kernel/byterun"
-# We should generate this file at configure time for local byte builds
-# to work properly.
-
-# Enable this setting for local byte builds, disabling the one below.
+# We could generate this file at configure time for the share byte
+# build path to work properly.
+#
+# Enable this setting for local byte builds if you want dynamic linking:
+#
# linkopts(byte) = "-dllpath path_to_coq/kernel/byterun/ -dllib -lcoqrun"
- linkopts(byte) = "-dllib -lcoqrun"
+# We currently prefer static linking of the VM.
+ archive(byte) = "libcoqrun.a"
+ linkopts(byte) = "-custom"
+
linkopts(native) = "-cclib -lcoqrun"
)
diff --git a/Makefile.install b/Makefile.install
index 84aa11a5e..9a7229d52 100644
--- a/Makefile.install
+++ b/Makefile.install
@@ -107,9 +107,10 @@ install-devfiles:
$(MKDIR) $(FULLBINDIR)
$(MKDIR) $(FULLCOQLIB)
$(INSTALLSH) $(FULLCOQLIB) $(GRAMMARCMA)
- $(INSTALLSH) $(FULLCOQLIB) $(INSTALLCMI)
- $(INSTALLSH) $(FULLCOQLIB) $(INSTALLCMX)
- $(INSTALLSH) $(FULLCOQLIB) $(PLUGINSCMO:.cmo=.o)
+ $(INSTALLSH) $(FULLCOQLIB) $(INSTALLCMI) # Regular CMI files
+ $(INSTALLSH) $(FULLCOQLIB) $(INSTALLCMX) # To avoid warning 58 "-opaque"
+ $(INSTALLSH) $(FULLCOQLIB) $(PLUGINSCMO:.cmo=.cmx) # For static linking of plugins
+ $(INSTALLSH) $(FULLCOQLIB) $(PLUGINSCMO:.cmo=.o) # For static linking of plugins
$(INSTALLSH) $(FULLCOQLIB) $(TOOLS_HELPERS)
ifeq ($(BEST),opt)
$(INSTALLSH) $(FULLCOQLIB) $(LINKCMX) $(CORECMA:.cma=.a) $(STATICPLUGINS:.cma=.a)