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
config.substitutions.append( ('%llc_dwarf', llc_dwarf) )
# Add site-specific substitutions.
-config.substitutions.append( ('%ocamlopt', config.ocamlopt_executable) )
+config.substitutions.append( ('%go', config.go_executable) )
config.substitutions.append( ('%llvmshlibdir', config.llvm_shlib_dir) )
config.substitutions.append( ('%shlibext', config.llvm_shlib_ext) )
config.substitutions.append( ('%exeext', config.llvm_exe_ext) )
config.substitutions.append( ('%python', config.python_executable) )
+# OCaml substitutions.
+# Support tests for both native and bytecode builds.
+if config.have_ocamlopt == '1':
+ config.substitutions.append( ('%ocamlcomp',
+ "%s ocamlopt %s" % (config.ocamlfind_executable, config.ocaml_flags)) )
+else:
+ config.substitutions.append( ('%ocamlcomp',
+ "%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
# ensures that we are testing the tools just built and not some random
r"\bllvm-dis\b",
r"\bllvm-dwarfdump\b",
r"\bllvm-extract\b",
+ r"\bllvm-go\b",
r"\bllvm-link\b",
r"\bllvm-lto\b",
r"\bllvm-mc\b",