summaryrefslogtreecommitdiff
path: root/autoconf
diff options
context:
space:
mode:
authorGordon Henriksen <gordonhenriksen@mac.com>2007-10-02 16:42:10 +0000
committerGordon Henriksen <gordonhenriksen@mac.com>2007-10-02 16:42:10 +0000
commit1d4e0782ba9761e3c664de53b837b74c0c818ff1 (patch)
tree020d6dea130822d89cc565771cb962b95312873b /autoconf
parentbae4adc7de3a43c31100da6996912e30889aa2b9 (diff)
downloadllvm-1d4e0782ba9761e3c664de53b837b74c0c818ff1.tar.gz
llvm-1d4e0782ba9761e3c664de53b837b74c0c818ff1.tar.bz2
llvm-1d4e0782ba9761e3c664de53b837b74c0c818ff1.tar.xz
Providing --with-ocaml-libdir for ./configure. The default is the
stdlib if it's beneath --prefix, and is libdir/ocaml otherwise. If someone has a better way than this to test whether $B is a path within $A, I'd love to hear it: if test "$A" \< "$B" -a "$B" \< "${A}~" git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42532 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'autoconf')
-rw-r--r--autoconf/configure.ac52
1 files changed, 52 insertions, 0 deletions
diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index 9bf2d0e433..610d8f903c 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -450,6 +450,20 @@ case "$enableval" in
;;
esac
+dnl Allow the ocaml libdir to be overridden. This could go in a configure
+dnl script for bindings/ocaml/configure, except that its auto value depends on
+dnl OCAMLC, which is found here to support tests.
+AC_ARG_WITH([ocaml-libdir],
+ [AS_HELP_STRING([--with-ocaml-libdir],
+ [Specify install location for ocaml bindings (default is stdlib)])],
+ [],
+ [withval=auto])
+case "$withval" in
+ auto) with_ocaml_libdir="$withval" ;;
+ /* | [[A-Za-z]]:[[\\/]]*) with_ocaml_libdir="$withval" ;;
+ *) AC_MSG_ERROR([Invalid path for --with-ocaml-libdir. Provide full path]) ;;
+esac
+
dnl===-----------------------------------------------------------------------===
dnl===
dnl=== SECTION 4: Check for programs we need and that they are the right version
@@ -886,6 +900,44 @@ AC_SUBST(BINDINGS_TO_BUILD,$BINDINGS_TO_BUILD)
# other files.
AC_SUBST(ALL_BINDINGS,ocaml)
+# Do any work necessary to ensure that bindings have what they need.
+binding_prereqs_failed=0
+for a_binding in $BINDINGS_TO_BUILD ; do
+ case "$a_binding" in
+ ocaml)
+ if test "x$OCAMLC" = x ; then
+ AC_MSG_WARN([--enable-bindings=ocaml specified, but ocamlc not found. Try configure OCAMLC=/path/to/ocamlc])
+ binding_prereqs_failed=1
+ fi
+ if test "x$OCAMLDEP" = x ; then
+ AC_MSG_WARN([--enable-bindings=ocaml specified, but ocamldep not found. Try configure OCAMLDEP=/path/to/ocamldep])
+ binding_prereqs_failed=1
+ fi
+ if test "x$OCAMLOPT" = x ; then
+ AC_MSG_WARN([--enable-bindings=ocaml specified, but ocamlopt not found. Try configure OCAMLOPT=/path/to/ocamlopt])
+ dnl ocamlopt is optional!
+ fi
+ if test "x$with_ocaml_libdir" != xauto ; then
+ AC_SUBST(OCAML_LIBDIR,$with_ocaml_libdir)
+ else
+ ocaml_stdlib="`"$OCAMLC" -where`"
+ if test "$LLVM_PREFIX" '<' "$ocaml_stdlib" -a "$ocaml_stdlib" '<' "$LLVM_PREFIX~"
+ then
+ # ocaml stdlib is beneath our prefix; use stdlib
+ AC_SUBST(OCAML_LIBDIR,$ocaml_stdlib)
+ else
+ # ocaml stdlib is outside our prefix; use libdir/ocaml
+ AC_SUBST(OCAML_LIBDIR,$LLVM_LIBDIR/ocaml)
+ fi
+ fi
+ ;;
+ esac
+done
+if test "$binding_prereqs_failed" = 1 ; then
+ AC_MSG_ERROR([Prequisites for bindings not satisfied. Fix them or use configure --disable-bindings.])
+fi
+
+
dnl===-----------------------------------------------------------------------===
dnl===
dnl=== SECTION 10: Specify the output files and generate it