[OCaml] [autoconf] Migrate to ocamlfind.
authorPeter Zotov <whitequark@whitequark.org>
Thu, 30 Oct 2014 08:29:45 +0000 (08:29 +0000)
committerPeter Zotov <whitequark@whitequark.org>
Thu, 30 Oct 2014 08:29:45 +0000 (08:29 +0000)
This commit updates the OCaml bindings and tests to use ocamlfind.
The bindings are migrated in order to use ctypes, which are now
required for MCJIT-backed Llvm_executionengine.
The tests are migrated in order to use OUnit and to verify that
the distributed META.llvm allows to build working executables.

Every OCaml toolchain invocation is now chained through ocamlfind,
which (in theory) allows to cross-compile the OCaml bindings.

The configure script now checks for ctypes (>= 0.2.3) and
OUnit (>= 2). The code depending on these libraries will be added
later. The configure script does not check the package versions
in order to keep changes less invasive.

Additionally, OCaml bindings will now be automatically enabled
if ocamlfind is detected on the system, rather than ocamlc, as it
was before.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220899 91177308-0d34-0410-b5e6-96231b3b80d8

21 files changed:
Makefile.config.in
autoconf/configure.ac
bindings/ocaml/Makefile.ocaml
configure
test/Bindings/Ocaml/analysis.ml
test/Bindings/Ocaml/bitreader.ml
test/Bindings/Ocaml/bitwriter.ml
test/Bindings/Ocaml/executionengine.ml
test/Bindings/Ocaml/ext_exc.ml
test/Bindings/Ocaml/ipo_opts.ml
test/Bindings/Ocaml/irreader.ml
test/Bindings/Ocaml/linker.ml
test/Bindings/Ocaml/lit.local.cfg
test/Bindings/Ocaml/passmgr_builder.ml
test/Bindings/Ocaml/scalar_opts.ml
test/Bindings/Ocaml/target.ml
test/Bindings/Ocaml/vectorize_opts.ml
test/Bindings/Ocaml/vmcore.ml
test/Makefile
test/lit.cfg
test/lit.site.cfg.in

index 6d85a4e306269b8e6b57d43dae74cb612c52f65d..4df270b379fa0ce7b297dacd0ee20a63be0b6758 100644 (file)
@@ -203,10 +203,7 @@ DOXYGEN    := @DOXYGEN@
 GROFF      := @GROFF@
 GZIPBIN    := @GZIPBIN@
 GO         := @GO@
-OCAMLC     := @OCAMLC@
-OCAMLOPT   := @OCAMLOPT@
-OCAMLDEP   := @OCAMLDEP@
-OCAMLDOC   := @OCAMLDOC@
+OCAMLFIND  := @OCAMLFIND@
 GAS        := @GAS@
 POD2HTML   := @POD2HTML@
 POD2MAN    := @POD2MAN@
@@ -218,6 +215,9 @@ HAVE_DLOPEN := @HAVE_DLOPEN@
 HAVE_PTHREAD := @HAVE_PTHREAD@
 HAVE_TERMINFO := @HAVE_TERMINFO@
 
+HAVE_OCAMLOPT := @HAVE_OCAMLOPT@
+HAVE_OCAML_OUNIT := @HAVE_OCAML_OUNIT@
+
 LIBS       := @LIBS@
 
 # Targets that are possible to build
index 618cf8b4db634d1af62a924d1f9ab277bb079249..76d2f90269d2ca338bd5f7282cc5a97ee33f16ef 100644 (file)
@@ -658,11 +658,11 @@ AC_ARG_ENABLE(clang-static-analyzer,
                              enableval="yes")
 case "$enableval" in
   yes) AC_SUBST(ENABLE_CLANG_STATIC_ANALYZER,[1]) ;;
-  no)  
+  no)
     if test ${clang_arcmt} != "no" ; then
       AC_MSG_ERROR([Cannot enable clang ARC Migration Tool while disabling static analyzer.])
     fi
-    AC_SUBST(ENABLE_CLANG_STATIC_ANALYZER,[0]) 
+    AC_SUBST(ENABLE_CLANG_STATIC_ANALYZER,[0])
     ;;
   default) AC_SUBST(ENABLE_CLANG_STATIC_ANALYZER,[1]);;
   *) AC_MSG_ERROR([Invalid setting for --enable-clang-static-analyzer. Use "yes" or "no"]) ;;
@@ -1288,10 +1288,7 @@ AC_PATH_PROG(GZIPBIN, [gzip])
 AC_PATH_PROG(PDFROFF, [pdfroff])
 AC_PATH_PROG(ZIP, [zip])
 AC_PATH_PROG(GO, [go])
-AC_PATH_PROGS(OCAMLC, [ocamlc])
-AC_PATH_PROGS(OCAMLOPT, [ocamlopt])
-AC_PATH_PROGS(OCAMLDEP, [ocamldep])
-AC_PATH_PROGS(OCAMLDOC, [ocamldoc])
+AC_PATH_PROGS(OCAMLFIND, [ocamlfind])
 AC_PATH_PROGS(GAS, [gas as])
 
 dnl Get the version of the linker in use.
@@ -1524,7 +1521,7 @@ AC_ARG_WITH(oprofile,
           fi ;;
         *)
           AC_MSG_ERROR([OProfile support is available on Linux only.]) ;;
-      esac 
+      esac
     ],
     [
       AC_SUBST(USE_OPROFILE, [0])
@@ -1869,7 +1866,7 @@ AC_DEFINE_UNQUOTED(LLVM_DEFAULT_TARGET_TRIPLE, "$target",
 dnl Determine which bindings to build.
 if test "$BINDINGS_TO_BUILD" = auto ; then
   BINDINGS_TO_BUILD=""
-  if test "x$OCAMLC" != x -a "x$OCAMLDEP" != x ; then
+  if test "x$OCAMLFIND" != x ; then
     BINDINGS_TO_BUILD="ocaml $BINDINGS_TO_BUILD"
   fi
   if test "x$GO" != x ; then
@@ -1885,22 +1882,36 @@ 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])
+    if test "x$OCAMLFIND" = x ; then
+      AC_MSG_WARN([--enable-bindings=ocaml specified, but ocamlfind not found. Try configure OCAMLFIND=/path/to/ocamlfind])
       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])
+
+    if $OCAMLFIND opt -version >/dev/null 2>/dev/null ; then
+      HAVE_OCAMLOPT=1
+    else
+      HAVE_OCAMLOPT=0
+    fi
+    AC_SUBST(HAVE_OCAMLOPT)
+
+    if ! $OCAMLFIND query ctypes >/dev/null 2>/dev/null; then
+      AC_MSG_WARN([--enable-bindings=ocaml specified, but ctypes is not installed])
       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!
+
+    if $OCAMLFIND query oUnit >/dev/null 2>/dev/null; then
+      HAVE_OCAML_OUNIT=1
+    else
+      HAVE_OCAML_OUNIT=0
+      AC_MSG_WARN([--enable-bindings=ocaml specified, but OUnit 2 is not installed. Tests will not run])
+      dnl oUnit is optional!
     fi
+    AC_SUBST(HAVE_OCAML_OUNIT)
+
     if test "x$with_ocaml_libdir" != xauto ; then
       AC_SUBST(OCAML_LIBDIR,$with_ocaml_libdir)
     else
-      ocaml_stdlib="`"$OCAMLC" -where`"
+      ocaml_stdlib="`"$OCAMLFIND" ocamlc -where`"
       if test "$LLVM_PREFIX" '<' "$ocaml_stdlib" -a "$ocaml_stdlib" '<' "$LLVM_PREFIX~"
       then
         # ocaml stdlib is beneath our prefix; use stdlib
index d069c454cd0ffb6a156f5c6a51c456395488f019..e466b2b2a90d603f675473b6f79bc520cfad1f70 100644 (file)
@@ -20,8 +20,8 @@
 include $(LEVEL)/Makefile.config
 
 # CFLAGS needs to be set before Makefile.rules is included.
-CXX.Flags += -I"$(shell $(OCAMLC) -where)"
-C.Flags += -I"$(shell $(OCAMLC) -where)"
+CXX.Flags += -I"$(shell $(OCAMLFIND) c -where)"
+C.Flags += -I"$(shell $(OCAMLFIND) c -where)"
 
 ifeq ($(ENABLE_SHARED),1)
 LINK_COMPONENTS := all
@@ -55,7 +55,7 @@ endif
 endif
 
 # Tools
-OCAMLCFLAGS += -I $(ObjDir) -I $(OcamlDir)
+OCAMLCFLAGS += -I $(OcamlDir)
 ifndef IS_CLEANING_TARGET
 ifneq ($(ObjectsO),)
 OCAMLAFLAGS += $(patsubst %,-cclib %, \
@@ -73,9 +73,9 @@ ifneq ($(ENABLE_OPTIMIZED),1)
   OCAMLDEBUGFLAG := -g
 endif
 
-Compile.CMI  := $(strip $(OCAMLC) -c $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG) -o)
-Compile.CMO  := $(strip $(OCAMLC) -c $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG) -o)
-Compile.CMX  := $(strip $(OCAMLOPT) -c $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG) -o)
+Compile.CMI  := $(strip $(OCAMLFIND) c -c $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG) -o)
+Compile.CMO  := $(strip $(OCAMLFIND) c -c $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG) -o)
+Compile.CMX  := $(strip $(OCAMLFIND) opt -c $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG) -o)
 
 ifdef OCAMLSTUBS
 # Avoid the need for LD_LIBRARY_PATH
@@ -87,26 +87,20 @@ endif
 endif
 
 ifdef OCAMLSTUBS
-Archive.CMA  := $(strip $(OCAMLC) -a -dllib -l$(LIBRARYNAME) $(OCAMLDEBUGFLAG) \
-                                  -o)
+Archive.CMA  := $(strip $(OCAMLFIND) c -a -dllib -l$(LIBRARYNAME) $(OCAMLDEBUGFLAG) \
+                                       -o)
 else
-Archive.CMA  := $(strip $(OCAMLC) -a -custom $(OCAMLAFLAGS) $(OCAMLDEBUGFLAG) \
-                                  -o)
+Archive.CMA  := $(strip $(OCAMLFIND) c -a -custom $(OCAMLAFLAGS) $(OCAMLDEBUGFLAG) \
+                                       -o)
 endif
 
 ifdef OCAMLSTUBS
-Archive.CMXA := $(strip $(OCAMLOPT) -a $(patsubst %,-cclib %, \
+Archive.CMXA := $(strip $(OCAMLFIND) opt -a $(patsubst %,-cclib %, \
                                     $(LLVMLibsOptions) -l$(LIBRARYNAME) \
                                     -L$(SharedLibDir) $(OCAMLRPATH)) \
                                     $(OCAMLDEBUGFLAG) -o)
 else
-Archive.CMXA := $(strip $(OCAMLOPT) -a $(OCAMLAFLAGS) $(OCAMLDEBUGFLAG) -o)
-endif
-
-ifdef OCAMLOPT
-Archive.EXE := $(strip $(OCAMLOPT) -cc $(CXX) $(OCAMLCFLAGS) $(UsedOcamlLibs:%=%.cmxa) $(OCAMLDEBUGFLAG) -o)
-else
-Archive.EXE := $(strip $(OCAMLC) -cc $(CXX) $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG:%=%.cma) -o)
+Archive.CMXA := $(strip $(OCAMLFIND) opt -a $(OCAMLAFLAGS) $(OCAMLDEBUGFLAG) -o)
 endif
 
 # Source files
@@ -190,7 +184,7 @@ $(ObjectsCMI): $(UsedOcamlInterfaces:%=$(OcamlDir)/%.cmi)
 ifdef LIBRARYNAME
 $(ObjDir)/$(LIBRARYNAME).ocamldep: $(OcamlSources) $(OcamlHeaders) \
                                    $(OcamlDir)/.dir $(ObjDir)/.dir
-       $(Verb) $(OCAMLDEP) $(OCAMLCFLAGS) $(OcamlSources) $(OcamlHeaders) > $@
+       $(Verb) $(OCAMLFIND) dep $(OCAMLCFLAGS) $(OcamlSources) $(OcamlHeaders) > $@
 
 -include $(ObjDir)/$(LIBRARYNAME).ocamldep
 endif
@@ -198,7 +192,7 @@ endif
 ifdef TOOLNAME
 $(ObjDir)/$(TOOLNAME).ocamldep: $(OcamlSources) $(OcamlHeaders) \
                                 $(OcamlDir)/.dir $(ObjDir)/.dir
-       $(Verb) $(OCAMLDEP) $(OCAMLCFLAGS) $(OcamlSources) $(OcamlHeaders) > $@
+       $(Verb) $(OCAMLFIND) dep $(OCAMLCFLAGS) $(OcamlSources) $(OcamlHeaders) > $@
 
 -include $(ObjDir)/$(TOOLNAME).ocamldep
 endif
@@ -367,8 +361,8 @@ endif
 ##===- Build optimized ocaml archive (.ml's -> .cmx's -> .cmxa, .a) -------===##
 
 # The ocamlopt compiler is supported on a set of targets disjoint from LLVM's.
-# If unavailable, 'configure' will not define OCAMLOPT in Makefile.config.
-ifdef OCAMLOPT
+# If unavailable, 'configure' will set HAVE_OCAMLOPT to 0 in Makefile.config.
+ifeq ($(HAVE_OCAMLOPT),1)
 
 $(OcamlDir)/%.cmx: $(ObjDir)/%.cmx
        $(Verb) $(CP) -f $< $@
@@ -418,31 +412,11 @@ uninstall-cmxa::
 endif
 endif
 
-##===- Build executables --------------------------------------------------===##
-
-ifdef TOOLNAME
-all-local:: $(OutputEXE)
-clean-local:: clean-exe
-
-$(OutputEXE): $(ToolEXE) $(OcamlDir)/.dir
-       $(Verb) $(CP) -f $< $@
-
-ifndef OCAMLOPT
-$(ToolEXE): $(ObjectsCMO) $(OcamlDir)/.dir
-       $(Echo) "Archiving $(notdir $@) for $(BuildMode) build"
-       $(Verb) $(Archive.EXE) $@ $(ObjectsCMO)
-else
-$(ToolEXE): $(ObjectsCMX) $(OcamlDir)/.dir
-       $(Echo) "Archiving $(notdir $@) for $(BuildMode) build"
-       $(Verb) $(Archive.EXE) $@ $(ObjectsCMX)
-endif
-endif
-
 ##===- Generate documentation ---------------------------------------------===##
 
 $(ObjDir)/$(LIBRARYNAME).odoc: $(ObjectsCMI)
        $(Echo) "Documenting $(notdir $@)"
-       $(Verb) $(OCAMLDOC) -I $(ObjDir) -I $(OcamlDir) -dump $@ $(OcamlHeaders)
+       $(Verb) $(OCAMLFIND) doc -I $(ObjDir) -I $(OcamlDir) -dump $@ $(OcamlHeaders)
 
 ocamldoc: $(ObjDir)/$(LIBRARYNAME).odoc
 
@@ -453,9 +427,7 @@ printcamlvars::
        $(Echo) "LLVM_CONFIG  : " '$(LLVM_CONFIG)'
        $(Echo) "OCAMLCFLAGS  : " '$(OCAMLCFLAGS)'
        $(Echo) "OCAMLAFLAGS  : " '$(OCAMLAFLAGS)'
-       $(Echo) "OCAMLC       : " '$(OCAMLC)'
-       $(Echo) "OCAMLOPT     : " '$(OCAMLOPT)'
-       $(Echo) "OCAMLDEP     : " '$(OCAMLDEP)'
+       $(Echo) "OCAMLFIND    : " '$(OCAMLFIND)'
        $(Echo) "Compile.CMI  : " '$(Compile.CMI)'
        $(Echo) "Compile.CMO  : " '$(Compile.CMO)'
        $(Echo) "Archive.CMA  : " '$(Archive.CMA)'
index c9373b55aea04fea1873ac94d78b28232c245689..79315117e548b70aa1bffff2a97a7f760a773c9f 100755 (executable)
--- a/configure
+++ b/configure
@@ -753,10 +753,7 @@ GZIPBIN
 PDFROFF
 ZIP
 GO
-OCAMLC
-OCAMLOPT
-OCAMLDEP
-OCAMLDOC
+OCAMLFIND
 GAS
 HAVE_LINK_VERSION_SCRIPT
 EGREP
@@ -788,6 +785,8 @@ LLVM_INFODIR
 LLVM_MANDIR
 LLVM_CONFIGTIME
 BINDINGS_TO_BUILD
+HAVE_OCAMLOPT
+HAVE_OCAML_OUNIT
 OCAML_LIBDIR
 ENABLE_VISIBILITY_INLINES_HIDDEN
 RPATH
@@ -6909,18 +6908,18 @@ echo "${ECHO_T}no" >&6; }
 fi
 
 
-for ac_prog in ocamlc
+for ac_prog in ocamlfind
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 { echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_OCAMLC+set}" = set; then
+if test "${ac_cv_path_OCAMLFIND+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $OCAMLC in
+  case $OCAMLFIND in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_OCAMLC="$OCAMLC" # Let the user override the test with a path.
+  ac_cv_path_OCAMLFIND="$OCAMLFIND" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -6930,7 +6929,7 @@ do
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_OCAMLC="$as_dir/$ac_word$ac_exec_ext"
+    ac_cv_path_OCAMLFIND="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -6941,152 +6940,17 @@ IFS=$as_save_IFS
   ;;
 esac
 fi
-OCAMLC=$ac_cv_path_OCAMLC
-if test -n "$OCAMLC"; then
-  { echo "$as_me:$LINENO: result: $OCAMLC" >&5
-echo "${ECHO_T}$OCAMLC" >&6; }
+OCAMLFIND=$ac_cv_path_OCAMLFIND
+if test -n "$OCAMLFIND"; then
+  { echo "$as_me:$LINENO: result: $OCAMLFIND" >&5
+echo "${ECHO_T}$OCAMLFIND" >&6; }
 else
   { echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6; }
 fi
 
 
-  test -n "$OCAMLC" && break
-done
-
-for ac_prog in ocamlopt
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_OCAMLOPT+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $OCAMLOPT in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_OCAMLOPT="$OCAMLOPT" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_OCAMLOPT="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-OCAMLOPT=$ac_cv_path_OCAMLOPT
-if test -n "$OCAMLOPT"; then
-  { echo "$as_me:$LINENO: result: $OCAMLOPT" >&5
-echo "${ECHO_T}$OCAMLOPT" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-  test -n "$OCAMLOPT" && break
-done
-
-for ac_prog in ocamldep
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_OCAMLDEP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $OCAMLDEP in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_OCAMLDEP="$OCAMLDEP" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_OCAMLDEP="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-OCAMLDEP=$ac_cv_path_OCAMLDEP
-if test -n "$OCAMLDEP"; then
-  { echo "$as_me:$LINENO: result: $OCAMLDEP" >&5
-echo "${ECHO_T}$OCAMLDEP" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-  test -n "$OCAMLDEP" && break
-done
-
-for ac_prog in ocamldoc
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_OCAMLDOC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $OCAMLDOC in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_OCAMLDOC="$OCAMLDOC" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_OCAMLDOC="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-OCAMLDOC=$ac_cv_path_OCAMLDOC
-if test -n "$OCAMLDOC"; then
-  { echo "$as_me:$LINENO: result: $OCAMLDOC" >&5
-echo "${ECHO_T}$OCAMLDOC" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-  test -n "$OCAMLDOC" && break
+  test -n "$OCAMLFIND" && break
 done
 
 for ac_prog in gas as
@@ -18301,7 +18165,7 @@ _ACEOF
 
 if test "$BINDINGS_TO_BUILD" = auto ; then
   BINDINGS_TO_BUILD=""
-  if test "x$OCAMLC" != x -a "x$OCAMLDEP" != x ; then
+  if test "x$OCAMLFIND" != x ; then
     BINDINGS_TO_BUILD="ocaml $BINDINGS_TO_BUILD"
   fi
   if test "x$GO" != x ; then
@@ -18317,25 +18181,39 @@ binding_prereqs_failed=0
 for a_binding in $BINDINGS_TO_BUILD ; do
   case "$a_binding" in
   ocaml)
-    if test "x$OCAMLC" = x ; then
-      { echo "$as_me:$LINENO: WARNING: --enable-bindings=ocaml specified, but ocamlc not found. Try configure OCAMLC=/path/to/ocamlc" >&5
-echo "$as_me: WARNING: --enable-bindings=ocaml specified, but ocamlc not found. Try configure OCAMLC=/path/to/ocamlc" >&2;}
+    if test "x$OCAMLFIND" = x ; then
+      { echo "$as_me:$LINENO: WARNING: --enable-bindings=ocaml specified, but ocamlfind not found. Try configure OCAMLFIND=/path/to/ocamlfind" >&5
+echo "$as_me: WARNING: --enable-bindings=ocaml specified, but ocamlfind not found. Try configure OCAMLFIND=/path/to/ocamlfind" >&2;}
       binding_prereqs_failed=1
     fi
-    if test "x$OCAMLDEP" = x ; then
-      { echo "$as_me:$LINENO: WARNING: --enable-bindings=ocaml specified, but ocamldep not found. Try configure OCAMLDEP=/path/to/ocamldep" >&5
-echo "$as_me: WARNING: --enable-bindings=ocaml specified, but ocamldep not found. Try configure OCAMLDEP=/path/to/ocamldep" >&2;}
+
+    if $OCAMLFIND opt -version >/dev/null 2>/dev/null ; then
+      HAVE_OCAMLOPT=1
+    else
+      HAVE_OCAMLOPT=0
+    fi
+
+
+    if ! $OCAMLFIND query ctypes >/dev/null 2>/dev/null; then
+      { echo "$as_me:$LINENO: WARNING: --enable-bindings=ocaml specified, but ctypes is not installed" >&5
+echo "$as_me: WARNING: --enable-bindings=ocaml specified, but ctypes is not installed" >&2;}
       binding_prereqs_failed=1
     fi
-    if test "x$OCAMLOPT" = x ; then
-      { echo "$as_me:$LINENO: WARNING: --enable-bindings=ocaml specified, but ocamlopt not found. Try configure OCAMLOPT=/path/to/ocamlopt" >&5
-echo "$as_me: WARNING: --enable-bindings=ocaml specified, but ocamlopt not found. Try configure OCAMLOPT=/path/to/ocamlopt" >&2;}
+
+    if $OCAMLFIND query oUnit >/dev/null 2>/dev/null; then
+      HAVE_OCAML_OUNIT=1
+    else
+      HAVE_OCAML_OUNIT=0
+      { echo "$as_me:$LINENO: WARNING: --enable-bindings=ocaml specified, but OUnit 2 is not installed. Tests will not run" >&5
+echo "$as_me: WARNING: --enable-bindings=ocaml specified, but OUnit 2 is not installed. Tests will not run" >&2;}
           fi
+
+
     if test "x$with_ocaml_libdir" != xauto ; then
       OCAML_LIBDIR=$with_ocaml_libdir
 
     else
-      ocaml_stdlib="`"$OCAMLC" -where`"
+      ocaml_stdlib="`"$OCAMLFIND" ocamlc -where`"
       if test "$LLVM_PREFIX" '<' "$ocaml_stdlib" -a "$ocaml_stdlib" '<' "$LLVM_PREFIX~"
       then
         # ocaml stdlib is beneath our prefix; use stdlib
@@ -19391,10 +19269,7 @@ GZIPBIN!$GZIPBIN$ac_delim
 PDFROFF!$PDFROFF$ac_delim
 ZIP!$ZIP$ac_delim
 GO!$GO$ac_delim
-OCAMLC!$OCAMLC$ac_delim
-OCAMLOPT!$OCAMLOPT$ac_delim
-OCAMLDEP!$OCAMLDEP$ac_delim
-OCAMLDOC!$OCAMLDOC$ac_delim
+OCAMLFIND!$OCAMLFIND$ac_delim
 GAS!$GAS$ac_delim
 HAVE_LINK_VERSION_SCRIPT!$HAVE_LINK_VERSION_SCRIPT$ac_delim
 EGREP!$EGREP$ac_delim
@@ -19426,6 +19301,8 @@ LLVM_INFODIR!$LLVM_INFODIR$ac_delim
 LLVM_MANDIR!$LLVM_MANDIR$ac_delim
 LLVM_CONFIGTIME!$LLVM_CONFIGTIME$ac_delim
 BINDINGS_TO_BUILD!$BINDINGS_TO_BUILD$ac_delim
+HAVE_OCAMLOPT!$HAVE_OCAMLOPT$ac_delim
+HAVE_OCAML_OUNIT!$HAVE_OCAML_OUNIT$ac_delim
 OCAML_LIBDIR!$OCAML_LIBDIR$ac_delim
 ENABLE_VISIBILITY_INLINES_HIDDEN!$ENABLE_VISIBILITY_INLINES_HIDDEN$ac_delim
 RPATH!$RPATH$ac_delim
@@ -19435,7 +19312,7 @@ LIBOBJS!$LIBOBJS$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 96; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 95; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
@@ -19454,7 +19331,7 @@ fi
 
 cat >>$CONFIG_STATUS <<_ACEOF
 cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
 _ACEOF
 sed '
 s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
@@ -19467,6 +19344,8 @@ N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
 ' >>$CONFIG_STATUS <conf$$subs.sed
 rm -f conf$$subs.sed
 cat >>$CONFIG_STATUS <<_ACEOF
+:end
+s/|#_!!_#|//g
 CEOF$ac_eof
 _ACEOF
 
@@ -19714,7 +19593,7 @@ s&@abs_builddir@&$ac_abs_builddir&;t t
 s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
 s&@INSTALL@&$ac_INSTALL&;t t
 $ac_datarootdir_hack
-" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" | sed 's/|#_!!_#|//g' >$tmp/out
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
   { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
index 0694ed1774f8200554cfbccb865ebe5d4716d3b1..84e1429279a46d83fbcc2613c3a30b413898ff11 100644 (file)
@@ -1,7 +1,5 @@
-(* RUN: rm -rf %t.builddir
- * RUN: mkdir -p %t.builddir
- * RUN: cp %s %t.builddir
- * RUN: %ocamlcomp -warn-error A llvm.%cma llvm_analysis.%cma %t.builddir/analysis.ml -o %t
+(* RUN: cp %s %T/analysis.ml
+ * RUN: %ocamlcomp -warn-error A -package llvm.analysis -linkpkg %T/analysis.ml -o %t
  * RUN: %t
  * XFAIL: vg_leak
  *)
index 973c8a77bcbd148a31314c5367639b4dc448e9c1..28c04a6abc00c208fb34b2ceadf898a53a64cb26 100644 (file)
@@ -1,7 +1,5 @@
-(* RUN: rm -rf %t.builddir
- * RUN: mkdir -p %t.builddir
- * RUN: cp %s %t.builddir
- * RUN: %ocamlcomp -warn-error A llvm.%cma llvm_bitreader.%cma llvm_bitwriter.%cma %t.builddir/bitreader.ml -o %t
+(* RUN: cp %s %T/bitreader.ml
+ * RUN: %ocamlcomp -warn-error A -package llvm.bitreader -package llvm.bitwriter -linkpkg %T/bitreader.ml -o %t
  * RUN: %t %t.bc
  * RUN: llvm-dis < %t.bc
  * XFAIL: vg_leak
index 98c04172a26eab5ef9120c475dc2531cfa5382b0..746836508ebc716e1d14939a9b99f99c2d77a542 100644 (file)
@@ -1,7 +1,5 @@
-(* RUN: rm -rf %t.builddir
- * RUN: mkdir -p %t.builddir
- * RUN: cp %s %t.builddir
- * RUN: %ocamlcomp -warn-error A-3 unix.%cma llvm.%cma llvm_bitwriter.%cma %t.builddir/bitwriter.ml -o %t
+(* RUN: cp %s %T/bitwriter.ml
+ * RUN: %ocamlcomp -warn-error A -package llvm.bitreader -package llvm.bitwriter -linkpkg %T/bitwriter.ml -o %t
  * RUN: %t %t.bc
  * RUN: llvm-dis < %t.bc
  * XFAIL: vg_leak
index fa325ebc1df4c3d14f5369622a10c995a96fd2ec..7d64f9f7f76cd0d17d5d52866d92fe4d234b90ea 100644 (file)
@@ -1,9 +1,8 @@
-(* RUN: rm -rf %t.builddir
- * RUN: mkdir -p %t.builddir
- * RUN: cp %s %t.builddir
- * RUN: %ocamlcomp -warn-error A llvm.%cma llvm_target.%cma llvm_executionengine.%cma %t.builddir/executionengine.ml -o %t
+(* RUN: cp %s %T/executionengine.ml
+ * RUN: %ocamlcomp -warn-error A -package llvm.executionengine -linkpkg %T/executionengine.ml -o %t
  * RUN: %t
- * XFAIL: vg_leak hexagon
+ * REQUIRES: native, object-emission
+ * XFAIL: vg_leak
  *)
 
 open Llvm
index 80924387110b06733c591848f8c8be7506a9bca9..c99bc04333fc62948226f9a6a4531d506e3d5d6b 100644 (file)
@@ -1,11 +1,11 @@
-(* RUN: rm -rf %t.builddir
- * RUN: mkdir -p %t.builddir
- * RUN: cp %s %t.builddir
- * RUN: %ocamlcomp -warn-error A llvm.%cma llvm_bitreader.%cma llvm_executionengine.%cma %t.builddir/ext_exc.ml -o %t
- * RUN: %t </dev/null
+(* RUN: cp %s %T/ext_exc.ml
+ * RUN: %ocamlcomp -warn-error A -package llvm.bitreader -linkpkg %T/ext_exc.ml -o %t
+ * RUN: %t
  * XFAIL: vg_leak
  *)
+
 let context = Llvm.global_context ()
+
 (* this used to crash, we must not use 'external' in .mli files, but 'val' if we
  * want the let _ bindings executed, see http://caml.inria.fr/mantis/view.php?id=4166 *)
 let _ =
index d79006e56101313c71641ce82bff13c342bffaf7..26037f2fd938d2fda5418319a909031d91f3e6ec 100644 (file)
@@ -1,7 +1,5 @@
-(* RUN: rm -rf %t.builddir
- * RUN: mkdir -p %t.builddir
- * RUN: cp %s %t.builddir
- * RUN: %ocamlcomp -warn-error A llvm.%cma llvm_ipo.%cma llvm_target.%cma %t.builddir/ipo_opts.ml -o %t
+(* RUN: cp %s %T/ipo_opts.ml
+ * RUN: %ocamlcomp -warn-error A -package llvm.ipo -linkpkg %T/ipo_opts.ml -o %t
  * RUN: %t %t.bc
  * XFAIL: vg_leak
  *)
index efe9df6d59301979b7e6ecd3a8ac7387309c9d5a..52956c9fee4b8bec6590099fb3da0594698001d9 100644 (file)
@@ -1,7 +1,5 @@
-(* RUN: rm -rf %t.builddir
- * RUN: mkdir -p %t.builddir
- * RUN: cp %s %t.builddir
- * RUN: %ocamlcomp -g -warn-error A llvm.%cma llvm_irreader.%cma %t.builddir/irreader.ml -o %t
+(* RUN: cp %s %T/irreader.ml
+ * RUN: %ocamlcomp -warn-error A -package llvm.irreader -linkpkg %T/irreader.ml -o %t
  * RUN: %t
  * XFAIL: vg_leak
  *)
index c187afa49afe6f66a31f3f4641c279953fb3f4f1..f859fdc5cf644471d8a84b26b71ba0e821e9b0b3 100644 (file)
@@ -1,7 +1,5 @@
-(* RUN: rm -rf %t.builddir
- * RUN: mkdir -p %t.builddir
- * RUN: cp %s %t.builddir
- * RUN: %ocamlcomp -warn-error A llvm.%cma llvm_linker.%cma %t.builddir/linker.ml -o %t
+(* RUN: cp %s %T/linker.ml
+ * RUN: %ocamlcomp -warn-error A -package llvm.linker -linkpkg %T/linker.ml -o %t
  * RUN: %t
  * XFAIL: vg_leak
  *)
index 364b97c632e83fca4d367fef1d36722a6f09763b..bca5d39d2495c06e51994834bc96281d1e28df9c 100644 (file)
@@ -2,3 +2,6 @@ config.suffixes = ['.ml']
 
 if not 'ocaml' in config.root.llvm_bindings:
     config.unsupported = True
+
+if config.root.have_ocaml_ounit != '1':
+    config.unsupported = True
index cd431fa5580c859fd46faeaff53ab283ea03063d..a7112231562f9a1bac673d4e72da139e3f122d97 100644 (file)
@@ -1,7 +1,5 @@
-(* RUN: rm -rf %t.builddir
- * RUN: mkdir -p %t.builddir
- * RUN: cp %s %t.builddir
- * RUN: %ocamlcomp -warn-error A llvm.%cma llvm_passmgr_builder.%cma %t.builddir/passmgr_builder.ml -o %t
+(* RUN: cp %s %T/passmgr_builder.ml
+ * RUN: %ocamlcomp -warn-error A -package llvm.passmgr_builder -linkpkg %T/passmgr_builder.ml -o %t
  * RUN: %t %t.bc
  * XFAIL: vg_leak
  *)
index 1ae4fe9d2a9893ee2b5c652e4cbb433e8b8c6c9c..9ca53616dc47ef3d7b7c40c8384f8ec263010b7d 100644 (file)
@@ -1,7 +1,5 @@
-(* RUN: rm -rf %t.builddir
- * RUN: mkdir -p %t.builddir
- * RUN: cp %s %t.builddir
- * RUN: %ocamlcomp -warn-error A llvm.%cma llvm_scalar_opts.%cma llvm_target.%cma %t.builddir/scalar_opts.ml -o %t
+(* RUN: cp %s %T/scalar_opts.ml
+ * RUN: %ocamlcomp -warn-error A -package llvm.scalar_opts -linkpkg %T/scalar_opts.ml -o %t
  * RUN: %t %t.bc
  * XFAIL: vg_leak
  *)
index e431fa4a25422d87061c22a2b90168d87f654f0a..0a9738a35f4fde754d4a5192899dae05357ed6ec 100644 (file)
@@ -1,7 +1,5 @@
-(* RUN: rm -rf %t.builddir
- * RUN: mkdir -p %t.builddir
- * RUN: cp %s %t.builddir
- * RUN: %ocamlcomp -g -warn-error A llvm.%cma llvm_target.%cma llvm_executionengine.%cma %t.builddir/target.ml -o %t
+(* RUN: cp %s %T/target.ml
+ * RUN: %ocamlcomp -warn-error A -package llvm.target -package llvm.executionengine -linkpkg %T/target.ml -o %t
  * RUN: %t %t.bc
  * REQUIRES: native, object-emission
  * XFAIL: vg_leak
index 08f15d37a1b30fec96c80bfa2c3bd4d5526d7905..9c5e7d005757e7f59dccc3ec00f319da9e0eeb84 100644 (file)
@@ -1,7 +1,5 @@
-(* RUN: rm -rf %t.builddir
- * RUN: mkdir -p %t.builddir
- * RUN: cp %s %t.builddir
- * RUN: %ocamlcomp -warn-error A llvm.%cma llvm_vectorize.%cma llvm_target.%cma %t.builddir/vectorize_opts.ml -o %t
+(* RUN: cp %s %T/vectorize_opts.ml
+ * RUN: %ocamlcomp -warn-error A -package llvm.vectorize -linkpkg %T/vectorize_opts.ml -o %t
  * RUN: %t %t.bc
  * XFAIL: vg_leak
  *)
index ed75c87ac9cf1f33c7ba1fa67e89fd819016136c..f1d27b47a2a9c807265b59ee374c5b5a81ba59e0 100644 (file)
@@ -1,7 +1,5 @@
-(* RUN: rm -rf %t.builddir
- * RUN: mkdir -p %t.builddir
- * RUN: cp %s %t.builddir
- * RUN: %ocamlcomp -warn-error A llvm.%cma llvm_analysis.%cma llvm_bitwriter.%cma %t.builddir/vmcore.ml -o %t
+(* RUN: cp %s %T/vmcore.ml
+ * RUN: %ocamlcomp -warn-error A -package llvm.analysis -package llvm.bitwriter -linkpkg %T/vmcore.ml -o %t
  * RUN: %t %t.bc
  * RUN: llvm-dis < %t.bc > %t.ll
  * RUN: FileCheck %s < %t.ll
index 40fcd616ab2a1c9f986545fecc51ba75e79d7d48..126f128a95071be6d09dc079b7153857c012aed5 100644 (file)
@@ -123,13 +123,15 @@ lit.site.cfg: FORCE
        @$(ECHOPATH) s=@LLVM_SOURCE_DIR@=$(LLVM_SRC_ROOT)=g >> lit.tmp
        @$(ECHOPATH) s=@LLVM_BINARY_DIR@=$(LLVM_OBJ_ROOT)=g >> lit.tmp
        @$(ECHOPATH) s=@LLVM_TOOLS_DIR@=$(ToolDir)=g >> lit.tmp
+       @$(ECHOPATH) s=@LIBDIR@=$(LibDir)=g >> lit.tmp
        @$(ECHOPATH) s=@SHLIBDIR@=$(SharedLibDir)=g >> lit.tmp
        @$(ECHOPATH) s=@SHLIBEXT@=$(SHLIBEXT)=g >> lit.tmp
        @$(ECHOPATH) s=@EXEEXT@=$(EXEEXT)=g >> lit.tmp
        @$(ECHOPATH) s=@PYTHON_EXECUTABLE@=$(PYTHON)=g >> lit.tmp
-       @$(ECHOPATH) s=@OCAMLC@=$(OCAMLC)=g >> lit.tmp
-       @$(ECHOPATH) s=@OCAMLOPT@=$(OCAMLOPT)=g >> lit.tmp
-       @$(ECHOPATH) s=@OCAMLFLAGS@=-cclib -L$(LibDir) -I $(LibDir)/ocaml $(addprefix -cclib ,$(LDFLAGS))=g >> lit.tmp
+       @$(ECHOPATH) s=@OCAMLFIND@=$(OCAMLFIND)=g >> lit.tmp
+       @$(ECHOPATH) s=@OCAMLFLAGS@=$(addprefix -cclib ,$(LDFLAGS))=g >> lit.tmp
+       @$(ECHOPATH) s=@HAVE_OCAMLOPT@=$(HAVE_OCAMLOPT)=g >> lit.tmp
+       @$(ECHOPATH) s=@HAVE_OCAML_OUNIT@=$(HAVE_OCAML_OUNIT)=g >> lit.tmp
        @$(ECHOPATH) s=@GO_EXECUTABLE@=$(GO)=g >> lit.tmp
        @$(ECHOPATH) s!@HOST_CC@!$(CC)!g >> lit.tmp
        @$(ECHOPATH) s!@HOST_CXX@!$(CXX)!g >> lit.tmp
index 63880d0dac78965705365f1b5494332dafbff114..4e9a5ad6efa015971d491c1693041a9d224ec027 100644 (file)
@@ -100,6 +100,14 @@ for options in ['ASAN_OPTIONS', 'UBSAN_OPTIONS']:
     if options in os.environ:
         config.environment[options] = os.environ[options]
 
+# Set up OCAMLPATH to include newly built OCaml libraries.
+llvm_ocaml_lib = os.path.join(getattr(config, 'llvm_lib_dir', None), 'ocaml')
+if 'OCAMLPATH' in os.environ:
+    ocamlpath = os.path.pathsep.join((llvm_ocaml_lib, os.environ['OCAMLPATH']))
+    config.environment['OCAMLPATH'] = ocamlpath
+else:
+    config.environment['OCAMLPATH'] = llvm_ocaml_lib
+
 ###
 
 import os
@@ -175,14 +183,12 @@ config.substitutions.append( ('%python', config.python_executable) )
 
 # OCaml substitutions.
 # Support tests for both native and bytecode builds.
-if config.ocamlopt_executable != "":
+if config.have_ocamlopt == '1':
     config.substitutions.append( ('%ocamlcomp',
-        "%s %s" % (config.ocamlopt_executable, config.ocaml_flags)) )
-    config.substitutions.append( ('%cma', 'cmxa') )
+        "%s ocamlopt %s" % (config.ocamlfind_executable, config.ocaml_flags)) )
 else:
     config.substitutions.append( ('%ocamlcomp',
-        "%s %s" % (config.ocamlc_executable, config.ocaml_flags)) )
-    config.substitutions.append( ('%cma', 'cma') )
+        "%s ocamlc %s" % (config.ocamlfind_executable, config.ocaml_flags)) )
 
 # For each occurrence of an llvm tool name as its own word, replace it
 # with the full path to the build directory holding that tool.  This
index 2a058e9fa3b17b64a7b6aa0cdc980b084d36ec20..7d2c83305313fe5afffc715aab138d6c110f60c1 100644 (file)
@@ -7,13 +7,15 @@ config.target_triple = "@TARGET_TRIPLE@"
 config.llvm_src_root = "@LLVM_SOURCE_DIR@"
 config.llvm_obj_root = "@LLVM_BINARY_DIR@"
 config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
+config.llvm_lib_dir = "@LIBDIR@"
 config.llvm_shlib_dir = "@SHLIBDIR@"
 config.llvm_shlib_ext = "@SHLIBEXT@"
 config.llvm_exe_ext = "@EXEEXT@"
 config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
 config.python_executable = "@PYTHON_EXECUTABLE@"
-config.ocamlc_executable = "@OCAMLC@"
-config.ocamlopt_executable = "@OCAMLOPT@"
+config.ocamlfind_executable = "@OCAMLFIND@"
+config.have_ocamlopt = "@HAVE_OCAMLOPT@"
+config.have_ocaml_ounit = "@HAVE_OCAML_OUNIT@"
 config.ocaml_flags = "@OCAMLFLAGS@"
 config.go_executable = "@GO_EXECUTABLE@"
 config.enable_shared = @ENABLE_SHARED@