Commit b43cd56d authored by Gerd Stolpmann's avatar Gerd Stolpmann

Require that ocamlc and ocamlc.opt are installed to the

same directory for emitting the "opt" setting in the generated
config file - same for ocamlopt.opt, ocamldep.opt, ocamldoc.opt.
parent d6da1c48
......@@ -56,16 +56,16 @@ findlib.conf: findlib.conf.in
export USE_CYGPATH; \
cat findlib.conf.in | \
tools/patch '@SITELIB@' '$(OCAML_SITELIB)' >findlib.conf
if ocamlc.opt >/dev/null 2>&1; then \
if ./tools/cmd_from_same_dir ocamlc; then \
echo 'ocamlc="ocamlc.opt"' >>findlib.conf; \
fi
if ocamlopt.opt >/dev/null 2>&1; then \
if ./tools/cmd_from_same_dir ocamlopt; then \
echo 'ocamlopt="ocamlopt.opt"' >>findlib.conf; \
fi
if ocamldep.opt >/dev/null 2>&1; then \
if ./tools/cmd_from_same_dir ocamldep; then \
echo 'ocamldep="ocamldep.opt"' >>findlib.conf; \
fi
if ocamldoc.opt >/dev/null 2>&1; then \
if ./tools/cmd_from_same_dir ocamldoc; then \
echo 'ocamldoc="ocamldoc.opt"' >>findlib.conf; \
fi
......
......@@ -116,6 +116,9 @@ configuration files, and library routines in detail.</p>
<p>Preliminary support for native toplevel so far the toplevel
is implemented symmetrically to the bytecode case (this is not
correct in vanilla ocaml)</p>
<p>Requires ocamlc and ocamlc.opt are installed to the
same directory for emitting the "opt" setting in the generated
config file - same for ocamlopt.opt, ocamldep.opt, ocamldoc.opt.</p>
</li>
<li>
......
......@@ -48,6 +48,7 @@ f tools/extract_args/extract_args.ml
f tools/safe_camlp4
f tools/make-package-macosx
f tools/patch
f tools/cmd_from_same_dir
d site-lib-src
d site-lib-src/bigarray
......
#! /bin/sh
# Check whether ocamlc and ocamlc.opt are installed in the same
# directory (or whatever command names are passed as $1).
get_path () {
IFS=":"
for d in $PATH; do
if test -x "$d/$1"; then
IFS="$oldifs"
echo "$d/$1"
return
fi
done
IFS="$oldifs"
#--- The following is not portable enough:
# if test -x `type -p ls`; then
# # type -p works!
# type -p $1
# else
# # use 'which' instead
# p=`which $1`
# test -x "$p" && echo $p
# fi
}
p1="$(get_path "$1").opt"
p2="$(get_path "$1.opt")"
[ "X$p1" = "X$p2" ]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment