aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Michel <scottm@aero.org>2009-03-12 21:03:53 +0000
committerScott Michel <scottm@aero.org>2009-03-12 21:03:53 +0000
commit87af5f029645652e1721aef9c6ed4310bfec54c5 (patch)
tree2260b01a66b499f9d64a73efbc8303ff4b0b2b2b
parentc81f5445a7cbe3ba0252aec030082a40e5019ece (diff)
Darwin 10.4.x: "-rpath" is unnecessary when linking shared libraries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66825 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--Makefile.rules42
1 files changed, 23 insertions, 19 deletions
diff --git a/Makefile.rules b/Makefile.rules
index 66d90f1209..886b095c06 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -420,6 +420,26 @@ endif
# Adjust to user's request
#--------------------------------------------------------------------
+ifeq ($(OS),Darwin)
+ DARWIN_VERSION := `sw_vers -productVersion`
+ # Strip a number like 10.4.7 to 10.4
+ DARWIN_VERSION := $(shell echo $(DARWIN_VERSION)| sed -E 's/(10.[0-9]).*/\1/')
+ # Get "4" out of 10.4 for later pieces in the makefile.
+ DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10.([0-9]).*/\1/')
+
+ SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined -Wl,suppress -bundle \
+ -mmacosx-version-min=$(DARWIN_VERSION)
+ CompileCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION)
+else
+ ifeq ($(OS),Cygwin)
+ SharedLinkOptions=-shared -nostdlib -Wl,--export-all-symbols \
+ -Wl,--enable-auto-import -Wl,--enable-auto-image-base \
+ -Wl,--enable-runtime-pseudo-relocs
+ else
+ SharedLinkOptions=-shared
+ endif
+endif
+
# Adjust LD.Flags depending on the kind of library that is to be built. Note
# that if LOADABLE_MODULE is specified then the resulting shared library can
# be opened with dlopen.
@@ -428,8 +448,10 @@ ifdef LOADABLE_MODULE
endif
ifdef SHARED_LIBRARY
+ifneq ($(DARWIN_MAJVERS),4)
LD.Flags += $(RPATH) -Wl,$(LibDir)
endif
+endif
ifdef TOOL_VERBOSE
C.Flags += -v
@@ -456,6 +478,7 @@ endif
# Adjust linker flags for building an executable
ifneq ($(OS),Darwin)
+ifneq ($(DARWIN_MAJVERS),4)
ifdef TOOLNAME
ifdef EXAMPLE_TOOL
LD.Flags += $(RPATH) -Wl,$(ExmplDir) $(RDYNAMIC)
@@ -464,25 +487,6 @@ else
endif
endif
endif
-
-ifeq ($(OS),Darwin)
- DARWIN_VERSION := `sw_vers -productVersion`
- # Strip a number like 10.4.7 to 10.4
- DARWIN_VERSION := $(shell echo $(DARWIN_VERSION)| sed -E 's/(10.[0-9]).*/\1/')
- # Get "4" out of 10.4 for later pieces in the makefile.
- DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10.([0-9]).*/\1/')
-
- SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined -Wl,suppress -bundle \
- -mmacosx-version-min=$(DARWIN_VERSION)
- CompileCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION)
-else
- ifeq ($(OS),Cygwin)
- SharedLinkOptions=-shared -nostdlib -Wl,--export-all-symbols \
- -Wl,--enable-auto-import -Wl,--enable-auto-image-base \
- -Wl,--enable-runtime-pseudo-relocs
- else
- SharedLinkOptions=-shared
- endif
endif
#----------------------------------------------------------