Skip to content

Commit

Permalink
Remove 'site.exp' building from both CMake and configure+make.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
chandlerc committed Jun 28, 2012
1 parent 0bcbd1d commit 96f41a1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 62 deletions.
4 changes: 0 additions & 4 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
33 changes: 6 additions & 27 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 4 additions & 15 deletions test/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions test/lit.site.cfg.in
Original file line number Diff line number Diff line change
@@ -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@"
Expand Down
16 changes: 0 additions & 16 deletions test/site.exp.in

This file was deleted.

0 comments on commit 96f41a1

Please sign in to comment.