llvm.org GIT mirror llvm / 37c04a0
Centralize the handling of install_name and rpath. This centralizes the Makefile handling of -install_name and -rpath. It also moves the cmake build to using @rpath. The reason being that libclang needs it, and it works for everything else. A followup patch will move clang to using this and then there will be a single point to edit to support other systems. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202499 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 5 years ago
4 changed file(s) with 3 addition(s) and 17 deletion(s). Raw diff Collapse all Expand all
442442
443443 set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
444444 if (APPLE)
445 set(CMAKE_INSTALL_NAME_DIR "@executable_path/../lib")
445 set(CMAKE_INSTALL_NAME_DIR "@rpath")
446446 set(CMAKE_INSTALL_RPATH "@executable_path/../lib")
447447 else(UNIX)
448448 if(NOT DEFINED CMAKE_INSTALL_RPATH)
588588 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
589589 ifneq ($(HOST_OS),Darwin)
590590 LD.Flags += $(RPATH) -Wl,'$$ORIGIN'
591 else
592 LD.Flags += -Wl,-install_name -Wl,"@rpath/lib$(LIBRARYNAME)$(SHLIBEXT)"
591593 endif
592594 endif
593595 endif
4848 endif
4949 # Include everything from the .a's into the shared library.
5050 LLVMLibsOptions := $(LLVMLibsOptions) -all_load
51
52 # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line
53 DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/')
54 ifneq ($(DARWIN_VERS),8)
55 LLVMLibsOptions := $(LLVMLibsOptions) \
56 -Wl,-install_name \
57 -Wl,"@rpath/lib$(LIBRARYNAME)$(SHLIBEXT)"
58 endif
5951 endif
6052
6153 ifeq ($(HOST_OS), $(filter $(HOST_OS), DragonFly Linux FreeBSD GNU/kFreeBSD OpenBSD GNU Bitrig))
3636 -Wl,-compatibility_version -Wl,1
3737 endif
3838
39 # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line
40 DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/')
41 ifneq ($(DARWIN_VERS),8)
42 LLVMLibsOptions := $(LLVMLibsOptions) \
43 -Wl,-install_name \
44 -Wl,"@executable_path/../lib/lib$(LIBRARYNAME)$(SHLIBEXT)"
45 endif
46
4739 # If we're doing an Apple-style build, add the LTO object path.
4840 ifeq ($(RC_XBS),YES)
4941 TempFile := $(shell mkdir -p ${OBJROOT}/dSYMs ; mktemp ${OBJROOT}/dSYMs/llvm-lto.XXXXXX)