configure: for cross, a matching ocamlrun must be on the system.

(Patch by Adrien Nader!)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13852 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Wojciech Meyer 2013-06-30 11:41:39 +00:00
parent 7dc8ea2b8f
commit 9111707486
2 changed files with 33 additions and 0 deletions

View File

@ -76,6 +76,15 @@ The "configure" script accepts the following options:
hand. The installation instructions for gcc or emacs contain a
complete list of configuration names.
-target <targettype> (default: same as -host)
The type of the target machine, in GNU's "configuration name"
format (CPU-COMPANY-SYSTEM or CPU-COMPANY-KERNEL-SYSTEM).
Setting this will setup OCaml as a cross-compiler which runs on
$host and produces code for $target. This requires a C toolchain
which also produces code for $target and a native OCaml
compiler of the exact same version (if you want a cross 4.00.1,
you need a native 4.00.1).
-x11include <include_dir> (default: determined automatically)
-x11lib <lib_dir> (default: determined automatically)
Location of the X11 include directory (e.g. /usr/X11R6/include)

24
configure vendored
View File

@ -390,6 +390,30 @@ case $? in
"Make sure the C compiler $cc is properly installed.";;
esac
# Determine which ocamlrun executable to use; for cross-compilation, a native
# "ocamlrun" executable must be available on the system.
if test x"$target" != x"$host"; then
if ! sh ./searchpath ocamlrun; then
err "Cross-compilation requires an ocaml runtime environment\n" \
"(the ocamlrun binary). Moreover, its version must be the same\n" \
"as the one you're trying to build (`cut -f1 -d+ < ../../VERSION`)."
else
ocaml_system_version=`ocamlrun -version | sed 's/[^0-9]*\([0-9.]\+\).*/\1/'`
ocaml_source_version=`sed -n '1 s/\([0-9\.]\+\).*/\1/ p' < ../../VERSION`
if test x"$ocaml_system_version" != x"$ocaml_source_version"; then
err "While you have an ocaml runtime environment, its version\n" \
"($ocaml_system_version) doesn't match the version of these sources\n" \
"($ocaml_source_version)."
else
CAMLRUN="ocamlrun"
fi
fi
else
CAMLRUN=`cd ../.. && pwd`/boot/ocamlrun
fi
echo "CAMLRUN=$CAMLRUN" >> Makefile
# Check the sizes of data types
inf "Checking the sizes of integers and pointers..."