summaryrefslogtreecommitdiffstats
path: root/stdlib
diff options
context:
space:
mode:
authorDamien Doligez <damien.doligez-inria.fr>2011-03-17 16:18:05 +0000
committerDamien Doligez <damien.doligez-inria.fr>2011-03-17 16:18:05 +0000
commita53ce2df70be41722d1b1054d1b06af4560d691f (patch)
tree2429cd9b45cb7cae7e0d3dd2826de05b6d1079ed /stdlib
parent80384c6d8401cdd897e7ff4c75a7a7b1a12b5585 (diff)
add option -runtime-variant
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@10982 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/Makefile10
-rw-r--r--stdlib/Makefile.nt9
-rwxr-xr-xstdlib/Makefile.shared14
-rw-r--r--stdlib/camlheaderd1
-rw-r--r--stdlib/headernt.c2
5 files changed, 29 insertions, 7 deletions
diff --git a/stdlib/Makefile b/stdlib/Makefile
index 874dcf6f9..59a2e18fb 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -42,9 +42,10 @@ installopt-prof:
stdlib.p.cmxa: $(OBJS:.cmo=.p.cmx)
$(CAMLOPT) -a -o stdlib.p.cmxa $(OBJS:.cmo=.p.cmx)
-camlheader camlheader_ur: header.c ../config/Makefile
+camlheader camlheaderd camlheader_ur: header.c ../config/Makefile
if $(SHARPBANGSCRIPTS); then \
echo '#!$(BINDIR)/ocamlrun' > camlheader && \
+ echo '#!$(BINDIR)/ocamlrund' > camlheaderd && \
echo '#!' | tr -d '\012' > camlheader_ur; \
else \
$(BYTECC) $(BYTECCCOMPOPTS) $(BYTECCLINKOPTS) \
@@ -52,7 +53,12 @@ camlheader camlheader_ur: header.c ../config/Makefile
header.c -o tmpheader$(EXE) && \
strip tmpheader$(EXE) && \
mv tmpheader$(EXE) camlheader && \
- cp camlheader camlheader_ur; \
+ cp camlheader camlheader_ur && \
+ $(BYTECC) $(BYTECCCOMPOPTS) $(BYTECCLINKOPTS) \
+ -DRUNTIME_NAME='"$(BINDIR)/ocamlrund"' \
+ header.c -o tmpheader$(EXE) && \
+ strip tmpheader$(EXE) && \
+ mv tmpheader$(EXE) camlheaderd; \
fi
.PHONY: all allopt allopt-noprof allopt-prof install installopt
diff --git a/stdlib/Makefile.nt b/stdlib/Makefile.nt
index 995a0c3fd..b21f0a375 100644
--- a/stdlib/Makefile.nt
+++ b/stdlib/Makefile.nt
@@ -21,11 +21,18 @@ installopt:
cp stdlib.cmxa stdlib.$(A) std_exit.$(O) *.cmx $(LIBDIR)
camlheader camlheader_ur: headernt.c ../config/Makefile
- $(BYTECC) $(BYTECCCOMPOPTS) -c -I../byterun headernt.c
+ $(BYTECC) $(BYTECCCOMPOPTS) -c -I../byterun \
+ -DRUNTIME_NAME='"ocamlrun"' headernt.c
$(MKEXE) -o tmpheader.exe headernt.$(O) $(EXTRALIBS)
rm -f camlheader.exe
mv tmpheader.exe camlheader
cp camlheader camlheader_ur
+camlheaderd: headernt.c ../config/Makefile
+ $(BYTECC) $(BYTECCCOMPOPTS) -c -I../byterun \
+ -DRUNTIME_NAME='"ocamlrund"' headernt.c
+ $(MKEXE) -o tmpheader.exe headernt.$(O) $(EXTRALIBS)
+ mv tmpheader.exe camlheaderd
+
# TODO: do not call flexlink to build tmpheader.exe (we don't need
# the export table)
diff --git a/stdlib/Makefile.shared b/stdlib/Makefile.shared
index 64087dc9c..d1b181278 100755
--- a/stdlib/Makefile.shared
+++ b/stdlib/Makefile.shared
@@ -40,8 +40,16 @@ OTHERS=array.cmo list.cmo char.cmo string.cmo sys.cmo \
all: stdlib.cma std_exit.cmo camlheader camlheader_ur
-install:
- cp stdlib.cma std_exit.cmo *.cmi *.mli *.ml camlheader camlheader_ur $(LIBDIR)
+install: install-$(RUNTIMED)
+ cp stdlib.cma std_exit.cmo *.cmi *.mli *.ml camlheader camlheader_ur \
+ $(LIBDIR)
+
+install-noruntimed:
+.PHONY: install-noruntimed
+
+install-runtimed: camlheaderd
+ cp camlheaderd $(LIBDIR)
+.PHONY: install-runtimed
stdlib.cma: $(OBJS)
$(CAMLC) -a -o stdlib.cma $(OBJS)
@@ -56,7 +64,7 @@ clean::
rm -f sys.ml
clean::
- rm -f camlheader camlheader_ur
+ rm -f camlheader camlheader_ur camlheaderd
.SUFFIXES: .mli .ml .cmi .cmo .cmx .p.cmx
diff --git a/stdlib/camlheaderd b/stdlib/camlheaderd
new file mode 100644
index 000000000..4a26863e5
--- /dev/null
+++ b/stdlib/camlheaderd
@@ -0,0 +1 @@
+#!/usr/local/ocaml/trunk/bin/ocamlrund
diff --git a/stdlib/headernt.c b/stdlib/headernt.c
index c8d23ee25..77f368afd 100644
--- a/stdlib/headernt.c
+++ b/stdlib/headernt.c
@@ -26,7 +26,7 @@
#pragma comment(lib , "kernel32")
#endif
-char * default_runtime_name = "ocamlrun";
+char * default_runtime_name = RUNTIME_NAME;
static
#if _MSC_VER >= 1200