mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
Revert commit 145449 (ddunbar) since it is breaking the dragonegg buildbots.
Original commit message: llvm-config: Replace with C++ version (was llvm-config-2). - Reapply of r144300, with lots of fixes/migration easement in between. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145582 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
##===- tools/llvm-config/Makefile---------------------------*- Makefile -*-===##
|
||||
#
|
||||
##===- tools/llvm-config/Makefile --------------------------*- Makefile -*-===##
|
||||
#
|
||||
# The LLVM Compiler Infrastructure
|
||||
#
|
||||
# This file is distributed under the University of Illinois Open Source
|
||||
@@ -7,42 +7,57 @@
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
|
||||
LEVEL := ../..
|
||||
TOOLNAME := llvm-config
|
||||
USEDLIBS := LLVMSupport.a
|
||||
LEVEL = ../..
|
||||
|
||||
# We generate sources in the build directory, make sure it is in the include
|
||||
# paths.
|
||||
INCLUDE_BUILD_DIR := 1
|
||||
|
||||
# This tool has no plugins, optimize startup time.
|
||||
TOOL_NO_EXPORTS := 1
|
||||
|
||||
# Note that we have to use lazy expansion here.
|
||||
BUILDVARIABLES_SRCPATH = $(PROJ_SRC_ROOT)/tools/$(TOOLNAME)/BuildVariables.inc.in
|
||||
BUILDVARIABLES_OBJPATH = $(ObjDir)/BuildVariables.inc
|
||||
BUILT_SOURCES = $(BUILDVARIABLES_OBJPATH)
|
||||
EXTRA_DIST = LibDeps.txt FinalLibDeps.txt llvm-config.in.in find-cycles.pl
|
||||
|
||||
include $(LEVEL)/Makefile.common
|
||||
|
||||
# If we don't have Perl, we can't generate the library dependencies upon which
|
||||
# llvm-config depends. Therefore, only if we detect perl will we do anything
|
||||
# useful.
|
||||
ifeq ($(HAVE_PERL),1)
|
||||
|
||||
# Combine preprocessor flags (except for -I) and CXX flags.
|
||||
SUB_CPPFLAGS := ${CPP.BaseFlags}
|
||||
SUB_CFLAGS := ${CPP.BaseFlags} ${C.Flags}
|
||||
SUB_CXXFLAGS := ${CPP.BaseFlags} ${CXX.Flags}
|
||||
SUB_CPPFLAGS = ${CPP.BaseFlags}
|
||||
SUB_CFLAGS = ${CPP.BaseFlags} ${C.Flags}
|
||||
SUB_CXXFLAGS = ${CPP.BaseFlags} ${CXX.Flags}
|
||||
|
||||
# This is blank for now. We need to be careful about adding stuff here:
|
||||
# LDFLAGS tend not to be portable, and we don't currently require the
|
||||
# user to use libtool when linking against LLVM.
|
||||
SUB_LDFLAGS :=
|
||||
SUB_LDFLAGS =
|
||||
|
||||
$(ObjDir)/BuildVariables.inc: $(BUILDVARIABLES_SRCPATH) Makefile $(ObjDir)/.dir
|
||||
$(Echo) "Building llvm-config BuildVariables.inc file."
|
||||
$(Verb) $(ECHO) 's/@LLVM_SRC_ROOT@/$(subst /,\/,$(LLVM_SRC_ROOT))/' \
|
||||
> temp.sed
|
||||
$(Verb) $(ECHO) 's/@LLVM_OBJ_ROOT@/$(subst /,\/,$(LLVM_OBJ_ROOT))/' \
|
||||
>> temp.sed
|
||||
FinalLibDeps = $(PROJ_OBJ_DIR)/FinalLibDeps.txt
|
||||
LibDeps = $(PROJ_OBJ_DIR)/LibDeps.txt
|
||||
LibDepsTemp = $(PROJ_OBJ_DIR)/LibDeps.txt.tmp
|
||||
GenLibDeps = $(PROJ_SRC_ROOT)/utils/GenLibDeps.pl
|
||||
|
||||
$(LibDepsTemp): $(GenLibDeps) $(LibDir) $(wildcard $(LibDir)/*.a $(LibDir)/*.o)
|
||||
$(Echo) "Regenerating LibDeps.txt.tmp"
|
||||
$(Verb) $(PERL) $(GenLibDeps) -flat $(LibDir) "$(NM_PATH)" > $(LibDepsTemp)
|
||||
|
||||
$(LibDeps): $(LibDepsTemp)
|
||||
$(Verb) $(CMP) -s $@ $< || ( $(CP) $< $@ && \
|
||||
$(EchoCmd) Updated LibDeps.txt because dependencies changed )
|
||||
|
||||
# Find all the cyclic dependencies between various LLVM libraries, so we
|
||||
# don't have to process them at runtime.
|
||||
$(FinalLibDeps): find-cycles.pl $(LibDeps)
|
||||
$(Echo) "Checking for cyclic dependencies between LLVM libraries."
|
||||
$(Verb) $(PERL) $< < $(LibDeps) > $@ || rm -f $@
|
||||
|
||||
# Rerun our configure substitutions as needed.
|
||||
ConfigInIn = $(PROJ_SRC_DIR)/llvm-config.in.in
|
||||
llvm-config.in: $(ConfigInIn) $(ConfigStatusScript)
|
||||
$(Verb) cd $(PROJ_OBJ_ROOT) ; \
|
||||
$(ConfigStatusScript) tools/llvm-config/llvm-config.in
|
||||
|
||||
# Build our final script.
|
||||
$(ToolDir)/llvm-config: llvm-config.in $(FinalLibDeps)
|
||||
$(Echo) "Building llvm-config script."
|
||||
$(Verb) $(ECHO) 's/@LLVM_CPPFLAGS@/$(subst /,\/,$(SUB_CPPFLAGS))/' \
|
||||
>> temp.sed
|
||||
> temp.sed
|
||||
$(Verb) $(ECHO) 's/@LLVM_CFLAGS@/$(subst /,\/,$(SUB_CFLAGS))/' \
|
||||
>> temp.sed
|
||||
$(Verb) $(ECHO) 's/@LLVM_CXXFLAGS@/$(subst /,\/,$(SUB_CXXFLAGS))/' \
|
||||
@@ -51,7 +66,28 @@ $(ObjDir)/BuildVariables.inc: $(BUILDVARIABLES_SRCPATH) Makefile $(ObjDir)/.dir
|
||||
>> temp.sed
|
||||
$(Verb) $(ECHO) 's/@LLVM_BUILDMODE@/$(subst /,\/,$(BuildMode))/' \
|
||||
>> temp.sed
|
||||
$(Verb) $(ECHO) 's/@LLVM_SYSTEM_LIBS@/$(subst /,\/,$(LIBS))/' \
|
||||
$(Verb) $(ECHO) 's/@LLVM_OBJ_SUFFIX@/$(subst /,\/,/$(BuildMode))/' \
|
||||
>> temp.sed
|
||||
$(Verb) $(SED) -f temp.sed < $< > $@
|
||||
$(Verb) $(RM) temp.sed
|
||||
$(Verb) cat $(FinalLibDeps) >> $@
|
||||
$(Verb) chmod +x $@
|
||||
|
||||
else
|
||||
# We don't have perl, just generate a dummy llvm-config
|
||||
$(ToolDir)/llvm-config:
|
||||
$(Echo) "Building place holder llvm-config script."
|
||||
$(Verb) $(ECHO) 'echo llvm-config: Perl not found so llvm-config could not be generated' >> $@
|
||||
$(Verb) chmod +x $@
|
||||
|
||||
endif
|
||||
# Hook into the standard Makefile rules.
|
||||
all-local:: $(ToolDir)/llvm-config
|
||||
clean-local::
|
||||
$(Verb) $(RM) -f $(ToolDir)/llvm-config llvm-config.in $(FinalLibDeps) \
|
||||
$(LibDeps) GenLibDeps.out
|
||||
install-local:: all-local
|
||||
$(Echo) Installing llvm-config
|
||||
$(Verb) $(MKDIR) $(DESTDIR)$(PROJ_bindir)
|
||||
$(Verb) $(ScriptInstall) $(ToolDir)/llvm-config $(DESTDIR)$(PROJ_bindir)
|
||||
|
||||
|
Reference in New Issue
Block a user