llvm.org GIT mirror llvm / 1d4e078
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 Gordon Henriksen 11 years ago
4 changed file(s) with 58 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
260260 HUGE_VAL_SANITY = @HUGE_VAL_SANITY@
261261
262262 # Bindings that we should build
263 BINDINGS_TO_BUILD = @BINDINGS_TO_BUILD@
264 ALL_BINDINGS = @ALL_BINDINGS@
265
263 BINDINGS_TO_BUILD := @BINDINGS_TO_BUILD@
264 ALL_BINDINGS := @ALL_BINDINGS@
265 OCAML_LIBDIR := @OCAML_LIBDIR@
266
449449 ;;
450450 esac
451451
452 dnl Allow the ocaml libdir to be overridden. This could go in a configure
453 dnl script for bindings/ocaml/configure, except that its auto value depends on
454 dnl OCAMLC, which is found here to support tests.
455 AC_ARG_WITH([ocaml-libdir],
456 [AS_HELP_STRING([--with-ocaml-libdir],
457 [Specify install location for ocaml bindings (default is stdlib)])],
458 [],
459 [withval=auto])
460 case "$withval" in
461 auto) with_ocaml_libdir="$withval" ;;
462 /* | [[A-Za-z]]:[[\\/]]*) with_ocaml_libdir="$withval" ;;
463 *) AC_MSG_ERROR([Invalid path for --with-ocaml-libdir. Provide full path]) ;;
464 esac
465
452466 dnl===-----------------------------------------------------------------------===
453467 dnl===
454468 dnl=== SECTION 4: Check for programs we need and that they are the right version
885899 # other files.
886900 AC_SUBST(ALL_BINDINGS,ocaml)
887901
902 # Do any work necessary to ensure that bindings have what they need.
903 binding_prereqs_failed=0
904 for a_binding in $BINDINGS_TO_BUILD ; do
905 case "$a_binding" in
906 ocaml)
907 if test "x$OCAMLC" = x ; then
908 AC_MSG_WARN([--enable-bindings=ocaml specified, but ocamlc not found. Try configure OCAMLC=/path/to/ocamlc])
909 binding_prereqs_failed=1
910 fi
911 if test "x$OCAMLDEP" = x ; then
912 AC_MSG_WARN([--enable-bindings=ocaml specified, but ocamldep not found. Try configure OCAMLDEP=/path/to/ocamldep])
913 binding_prereqs_failed=1
914 fi
915 if test "x$OCAMLOPT" = x ; then
916 AC_MSG_WARN([--enable-bindings=ocaml specified, but ocamlopt not found. Try configure OCAMLOPT=/path/to/ocamlopt])
917 dnl ocamlopt is optional!
918 fi
919 if test "x$with_ocaml_libdir" != xauto ; then
920 AC_SUBST(OCAML_LIBDIR,$with_ocaml_libdir)
921 else
922 ocaml_stdlib="`"$OCAMLC" -where`"
923 if test "$LLVM_PREFIX" '<' "$ocaml_stdlib" -a "$ocaml_stdlib" '<' "$LLVM_PREFIX~"
924 then
925 # ocaml stdlib is beneath our prefix; use stdlib
926 AC_SUBST(OCAML_LIBDIR,$ocaml_stdlib)
927 else
928 # ocaml stdlib is outside our prefix; use libdir/ocaml
929 AC_SUBST(OCAML_LIBDIR,$LLVM_LIBDIR/ocaml)
930 fi
931 fi
932 ;;
933 esac
934 done
935 if test "$binding_prereqs_failed" = 1 ; then
936 AC_MSG_ERROR([Prequisites for bindings not satisfied. Fix them or use configure --disable-bindings.])
937 fi
938
939
888940 dnl===-----------------------------------------------------------------------===
889941 dnl===
890942 dnl=== SECTION 10: Specify the output files and generate it
1313
1414 include $(LEVEL)/Makefile.config
1515
16 # Find the ocaml stdlib root. /usr/local/lib/ocaml is the default when built
17 # from source; distros use something like /usr/lib/ocaml/3.10.0.
18 ifndef OCAML_LIBDIR
19 OCAML_LIBDIR := $(shell $(OCAMLC) -where)
20 endif
21
2216 # CFLAGS needs to be set before Makefile.rules is included. Yes, ocaml puts its
2317 # includes under its libdir.
2418 CFLAGS += -I$(OCAML_LIBDIR)
2620 include $(LEVEL)/Makefile.common
2721
2822 # Intentionally ignore PROJ_prefix here. We want the ocaml stdlib. However, the
29 # user can override this with OCAML_LIBDIR.
23 # user can override this with OCAML_LIBDIR or configure --with-ocaml-libdir=.
3024 PROJ_libocamldir := $(DESTDIR)$(OCAML_LIBDIR)
3125 OcamlDir := $(LibDir)/ocaml
3226
77 *===----------------------------------------------------------------------===
88 *
99 * This interface provides an ocaml API for the LLVM bitcode writer, the
10 * classes in the classes in the Bitwriter library.
10 * classes in the Bitwriter library.
1111 *
1212 *===----------------------------------------------------------------------===*)
1313