Remove 'site.exp' building from both CMake and configure+make.
authorChandler Carruth <chandlerc@gmail.com>
Thu, 28 Jun 2012 00:16:51 +0000 (00:16 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Thu, 28 Jun 2012 00:16:51 +0000 (00:16 +0000)
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
test/Makefile
test/lit.cfg
test/lit.site.cfg.in
test/site.exp.in [deleted file]

index 9ec7f580c341a499f7de3e7315d9c2051587db8f..aeb7d52c20eb4c9fce76a27a0ef78a90cb9cb7a4 100644 (file)
@@ -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
index 671bf8e1c6e115d59dab18273a5b1891cff400e9..483db23d365dffb1715ea2f6945a79fdca6dd846 100644 (file)
@@ -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
index 2383d8fe7980b202ddf68a5d865a919bc3c543f7..93360c7c7c2bab491b42d8158282d481271046e1 100644 (file)
@@ -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
index e069dd130be9688d4f1313a0f71ebb9e2580f65b..178b22f10f3367dc49d3e2f9dbf788dbac826113 100644 (file)
@@ -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 (file)
index cfb2eac..0000000
+++ /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@"