From 96f41a1b0f9060f302c7857f98f62b55abc75a32 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Thu, 28 Jun 2012 00:16:51 +0000 Subject: Remove 'site.exp' building from both CMake and configure+make. This is another vestige of the DejaGNU roots. There were FIXMEs in the lit setup to add a 'lit.site.cfg', which has been around for quite some time now, so I've properly switched the handling of the 4 things actually used in site.exp to go through lit.site.cfg now. No more parsing of the .exp file, one fewer configure-style generated file, etc., etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159313 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CMakeLists.txt | 4 ---- test/Makefile | 33 ++++++--------------------------- test/lit.cfg | 19 ++++--------------- test/lit.site.cfg.in | 4 ++++ test/site.exp.in | 16 ---------------- 5 files changed, 14 insertions(+), 62 deletions(-) delete mode 100644 test/site.exp.in (limited to 'test') diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 9ec7f580c3..aeb7d52c20 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -27,10 +27,6 @@ endif() set(LIT_ARGS "${LLVM_LIT_ARGS}") separate_arguments(LIT_ARGS) -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/site.exp.in - ${CMAKE_CURRENT_BINARY_DIR}/site.exp) - MAKE_DIRECTORY(${CMAKE_CURRENT_BINARY_DIR}/Unit) # Configuration-time: See Unit/lit.site.cfg.in diff --git a/test/Makefile b/test/Makefile index 671bf8e1c6..483db23d36 100644 --- a/test/Makefile +++ b/test/Makefile @@ -107,43 +107,22 @@ endif FORCE: -site.exp: FORCE - @echo 'Making a new site.exp file...' - @echo '## Autogenerated by LLVM configuration.' > site.tmp - @echo '# Do not edit!' >> site.tmp - @echo 'set target_triplet "$(TARGET_TRIPLE)"' >> site.tmp - @echo 'set TARGETS_TO_BUILD "$(TARGETS_TO_BUILD)"' >> site.tmp - @echo 'set llvmshlibdir "$(SharedLibDir)"' >>site.tmp - @echo 'set llvm_bindings "$(BINDINGS_TO_BUILD)"' >> site.tmp - @echo 'set srcroot "$(LLVM_SRC_ROOT)"' >>site.tmp - @echo 'set objroot "$(LLVM_OBJ_ROOT)"' >>site.tmp - @echo 'set srcdir "$(LLVM_SRC_ROOT)/test"' >>site.tmp - @echo 'set objdir "$(LLVM_OBJ_ROOT)/test"' >>site.tmp - @echo 'set link "' $(CXX) $(CPP.Flags) $(CXX.Flags) $(TargetCommonOpts) $(CompileCommonOpts) $(LD.Flags) '"' >>site.tmp - @echo 'set shlibext "$(SHLIBEXT)"' >> site.tmp - @echo 'set ocamlopt "$(OCAMLOPT) -cc \"$(CXX_FOR_OCAMLOPT)\" -I $(LibDir)/ocaml"' >> site.tmp - @echo 'set valgrind "$(VALGRIND)"' >> site.tmp - @echo 'set grep "$(GREP)"' >>site.tmp - @echo 'set gas "$(GAS)"' >>site.tmp - @echo '## All variables above are generated by configure. Do Not Edit ## ' >>site.tmp - @test ! -f site.exp || \ - sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp - @-rm -f site.bak - @test ! -f site.exp || mv site.exp site.bak - @mv site.tmp site.exp - ifeq ($(DISABLE_ASSERTIONS),1) ENABLE_ASSERTIONS=0 else ENABLE_ASSERTIONS=1 endif -lit.site.cfg: site.exp +lit.site.cfg: FORCE @echo "Making LLVM 'lit.site.cfg' file..." - @$(ECHOPATH) s=@LLVM_SOURCE_DIR@=$(LLVM_SRC_ROOT)=g > lit.tmp + @$(ECHOPATH) s=@TARGET_TRIPLE@=$(TARGET_TRIPLE)=g > lit.tmp + @$(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=@SHLIBDIR@=$(SharedLibDir)=g >> lit.tmp + @$(ECHOPATH) s=@SHLIBEXT@=$(SHLIBEXT)=g >> lit.tmp @$(ECHOPATH) s=@PYTHON_EXECUTABLE@=python=g >> lit.tmp + @$(ECHOPATH) s=@OCAMLOPT@=$(OCAMLOPT) -cc \"$(CXX_FOR_OCAMLOPT)\" -I $(LibDir)/ocaml=g >> lit.tmp @$(ECHOPATH) s=@ENABLE_SHARED@=$(ENABLE_SHARED)=g >> lit.tmp @$(ECHOPATH) s=@ENABLE_ASSERTIONS@=$(ENABLE_ASSERTIONS)=g >> lit.tmp @$(ECHOPATH) s=@TARGETS_TO_BUILD@=$(TARGETS_TO_BUILD)=g >> lit.tmp diff --git a/test/lit.cfg b/test/lit.cfg index 2383d8fe79..93360c7c7c 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -132,18 +132,6 @@ if config.test_exec_root is None: ### -# Load site data from DejaGNU's site.exp. -import re -site_exp = {} -# FIXME: Implement lit.site.cfg. -for line in open(os.path.join(config.llvm_obj_root, 'test', 'site.exp')): - m = re.match('set ([^ ]+) "(.*)"', line) - if m: - site_exp[m.group(1)] = m.group(2) - -# Provide target_triple for use in XFAIL and XTARGET. -config.target_triple = site_exp['target_triplet'] - # When running under valgrind, we mangle '-vg' or '-vg_leak' onto the end of the # triple so we can check it with XFAIL and XTARGET. config.target_triple += lit.valgrindTriple @@ -164,9 +152,10 @@ if jit_impl_cfg == 'mcjit': else: config.substitutions.append( ('%lli', 'lli') ) -# Add substitutions. -for sub in ['link', 'shlibext', 'ocamlopt', 'llvmshlibdir']: - config.substitutions.append(('%' + sub, site_exp[sub])) +# Add site-specific substitutions. +config.substitutions.append( ('%ocamlopt', config.ocamlopt_executable) ) +config.substitutions.append( ('%llvmshlibdir', config.llvm_shlib_dir) ) +config.substitutions.append( ('%shlibext', config.llvm_shlib_ext) ) # 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 diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in index e069dd130b..178b22f10f 100644 --- a/test/lit.site.cfg.in +++ b/test/lit.site.cfg.in @@ -1,10 +1,14 @@ ## Autogenerated by LLVM/Clang configuration. # Do not edit! +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_shlib_dir = "@SHLIBDIR@" +config.llvm_shlib_ext = "@SHLIBEXT@" config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.python_executable = "@PYTHON_EXECUTABLE@" +config.ocamlopt_executable = "@OCAMLOPT@" config.enable_shared = @ENABLE_SHARED@ config.enable_assertions = @ENABLE_ASSERTIONS@ config.targets_to_build = "@TARGETS_TO_BUILD@" diff --git a/test/site.exp.in b/test/site.exp.in deleted file mode 100644 index cfb2eac550..0000000000 --- a/test/site.exp.in +++ /dev/null @@ -1,16 +0,0 @@ -## Autogenerated by LLVM configuration. -# Do not edit! -set target_triplet "@TARGET_TRIPLE@" -set TARGETS_TO_BUILD "@TARGETS_TO_BUILD@" -set llvmshlibdir "@SHLIBDIR@" -set llvm_bindings "@LLVM_BINDINGS@" -set srcroot "@LLVM_SOURCE_DIR@" -set objroot "@LLVM_BINARY_DIR@" -set srcdir "@LLVM_SOURCE_DIR@" -set objdir "@LLVM_BINARY_DIR@" -set link "@TEST_LINK_CMD@" -set shlibext "@SHLIBEXT@" -set ocamlopt "@OCAMLOPT@" -set valgrind "@VALGRIND@" -set grep "@GREP@" -set gas "@AS@" -- cgit v1.2.3