Reimplement r108639 in InstCombine rather than DAGCombine.
[oota-llvm.git] / Makefile.rules
index 12582f6f91d2b741361708e93cd14b2048b05592..6271bf51f7f4f975d1ae9c282c01ef18595cb263 100644 (file)
@@ -622,7 +622,6 @@ endif
 
 # Adjust linker flags for building an executable
 ifneq ($(HOST_OS),Darwin)
-ifneq ($(DARWIN_MAJVERS),4)
 ifdef TOOLNAME
   LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib'
   ifdef EXAMPLE_TOOL
@@ -631,7 +630,6 @@ ifdef TOOLNAME
     LD.Flags += $(RPATH) -Wl,$(ToolDir) $(RDYNAMIC)
   endif
 endif
-endif
 else
 ifneq ($(DARWIN_MAJVERS),4)
   LD.Flags += $(RPATH) -Wl,@executable_path/../lib
@@ -1345,6 +1343,27 @@ ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux NetBSD FreeBSD))
 endif
 endif
 
+#---------------------------------------------------------
+# Tool Version Info Support
+#---------------------------------------------------------
+
+ifeq ($(HOST_OS),Darwin)
+ifdef TOOL_INFO_PLIST
+
+LD.Flags += -Wl,-sectcreate,__TEXT,__info_plist,$(ObjDir)/$(TOOL_INFO_PLIST)
+
+$(ToolBuildPath): $(ObjDir)/$(TOOL_INFO_PLIST)
+
+$(ObjDir)/$(TOOL_INFO_PLIST): $(PROJ_SRC_DIR)/$(TOOL_INFO_PLIST).in $(ObjDir)/.dir
+       $(Echo) "Creating $(TOOLNAME) '$(TOOL_INFO_PLIST)' file..."
+       $(Verb)sed -e "s#@TOOL_INFO_UTI@#$(TOOL_INFO_UTI)#g" \
+                  -e "s#@TOOL_INFO_NAME@#$(TOOL_INFO_NAME)#g" \
+                  -e "s#@TOOL_INFO_VERSION@#$(TOOL_INFO_VERSION)#g" \
+                -e "s#@TOOL_INFO_BUILD_VERSION@#$(TOOL_INFO_BUILD_VERSION)#g" \
+                  $< > $@
+
+endif
+endif
 
 #---------------------------------------------------------
 # Provide targets for building the tools