-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 llvmgcc_langs "$(LLVMGCC_LANGS)"' >> site.tmp
- @echo 'set llvmtoolsdir "$(ToolDir)"' >>site.tmp
- @echo 'set llvmlibsdir "$(LibDir)"' >>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 gccpath "$(CC)"' >>site.tmp
- @echo 'set gxxpath "$(CXX)"' >>site.tmp
- @echo 'set compile_c "' $(CC) $(CPP.Flags) $(TargetCommonOpts) $(CompileCommonOpts) -c '"' >>site.tmp
- @echo 'set compile_cxx "' $(CXX) $(CPP.Flags) $(CXX.Flags) $(TargetCommonOpts) $(CompileCommonOpts) -c -x c++ '"' >> site.tmp
- @echo 'set link "' $(CXX) $(CPP.Flags) $(CXX.Flags) $(TargetCommonOpts) $(CompileCommonOpts) $(LD.Flags) '"' >>site.tmp
- @echo 'set llvmgcc "$(LLVMGCC) $(TargetCommonOpts) $(EXTRA_OPTIONS)"' >> site.tmp
- @echo 'set llvmgxx "$(LLVMGCC) $(TargetCommonOpts) $(EXTRA_OPTIONS)"' >> site.tmp
- @echo 'set bugpoint_topts $(BUGPOINT_TOPTS)' >> 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 'set llvmdsymutil "$(DSYMUTIL)"' >>site.tmp
- @echo 'set emitir "$(LLVMCC_EMITIR_FLAG)"' >>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
-
-lit.site.cfg: site.exp
+ifeq ($(DISABLE_ASSERTIONS),1)
+ENABLE_ASSERTIONS=0
+else
+ENABLE_ASSERTIONS=1
+endif
+
+# Derive whether or not LTO is enabled by checking the extra options.
+LTO_IS_ENABLED := 0
+ifneq ($(findstring -flto,$(CompileCommonOpts)),)
+LTO_IS_ENABLED := 1
+else
+ifneq ($(findstring -O4,$(CompileCommonOpts)),)
+LTO_IS_ENABLED := 1
+endif
+endif
+
+lit.site.cfg: FORCE