summaryrefslogtreecommitdiff
path: root/objective-c
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2015-09-24 19:08:04 +0200
committerBenoit Foucher <benoit@zeroc.com>2015-09-24 19:08:04 +0200
commiteb256d7bbb92eb0a3ba9841c3f0ed517aa2ddb31 (patch)
tree6c6061ec7a2debcb9931797e041cf1a536d3a5db /objective-c
parentJS test suite minor fix for NodeJS (diff)
downloadice-eb256d7bbb92eb0a3ba9841c3f0ed517aa2ddb31.tar.bz2
ice-eb256d7bbb92eb0a3ba9841c3f0ed517aa2ddb31.tar.xz
ice-eb256d7bbb92eb0a3ba9841c3f0ed517aa2ddb31.zip
Fixed ICE-6811 - ElCapitan build errors
Diffstat (limited to 'objective-c')
-rw-r--r--objective-c/config/Make.rules20
-rw-r--r--objective-c/config/Make.rules.Darwin49
-rw-r--r--objective-c/src/Ice/Makefile19
3 files changed, 37 insertions, 51 deletions
diff --git a/objective-c/config/Make.rules b/objective-c/config/Make.rules
index 4001930606b..4d566bdd9c6 100644
--- a/objective-c/config/Make.rules
+++ b/objective-c/config/Make.rules
@@ -20,26 +20,6 @@ prefix ?= /opt/Ice-$(VERSION)
#OPTIMIZE = yes
#
-# The "root directory" for runpath embedded in executables. Can be set
-# to change the runpath added to Ice executables. The default is
-# platform dependent.
-#
-#embedded_runpath_prefix ?= /opt/Ice-$(VERSION_MAJOR).$(VERSION_MINOR)
-
-#
-# Define create_runpath_symlink as yes if you would like 'make install'
-# to automatically create a symbolic link for the embedded runpath
-# directory. Only applies if embedded_runpath_prefix is also set.
-#
-create_runpath_symlink ?= no
-
-#
-# Define embedded_runpath as no if you don't want any RPATH added to
-# the executables.
-#
-embedded_runpath ?= yes
-
-#
# The build architectures for gcc/llvm based builds. The format of
# these build flags are OS dependent. For example, under OS X to
# build binaries which support both i386 and x86_64 you would use
diff --git a/objective-c/config/Make.rules.Darwin b/objective-c/config/Make.rules.Darwin
index faeabc71022..3c5a7bc03dd 100644
--- a/objective-c/config/Make.rules.Darwin
+++ b/objective-c/config/Make.rules.Darwin
@@ -32,40 +32,27 @@ else
OBJCFLAGS := $(OBJCARCHFLAGS) -g $(OBJCFLAGS)
endif
-#
-# If embedded_runpath is not set to yes we do not add
-# an rpath dir.
-#
-ifeq ($(embedded_runpath),yes)
- LOADER_PATH = @loader_path
-
- #
- # If embedded_runpath_prefix is set it has preference
- #
- ifneq ($(embedded_runpath_prefix),)
- RPATH_DIR = $(embedded_runpath_prefix)
- endif
+LOADER_PATH = @loader_path
- ifeq ($(RPATH_DIR),)
- ifdef ice_src_dist
- RPATH_DIR = @loader_path/$(libdir)
- else
- RPATH_DIR = $(ice_dir)/$(libsubdir)
- endif
+ifeq ($(RPATH_DIR),)
+ ifdef ice_src_dist
+ RPATH_DIR = @loader_path/$(libdir)
+ else
+ RPATH_DIR = $(ice_dir)/$(libsubdir)
endif
+endif
- #
- # Clear rpath setting when doing a system install
- #
- ifeq ($(ice_dir),/usr)
- RPATH_DIR =
- endif
+#
+# Clear rpath setting when doing a system install
+#
+ifeq ($(ice_dir),/usr)
+ RPATH_DIR =
+endif
- ifneq ($(RPATH_DIR),)
- LDEXEFLAGS = -Wl,-rpath,$(RPATH_DIR)
- ifndef ice_src_dist
- LDEXEFLAGS += -Wl,-rpath,@loader_path/$(testlibdir)
- endif
+ifneq ($(RPATH_DIR),)
+ LDEXEFLAGS = -Wl,-rpath,$(RPATH_DIR)
+ ifndef ice_src_dist
+ LDEXEFLAGS += -Wl,-rpath,@loader_path/$(testlibdir)
endif
endif
@@ -100,5 +87,5 @@ mkshlib = $(CXX) -dynamiclib $(LDFLAGS) -o $(1) -install_name @rpath/$(2) $(3)
BASELIBS = -L$(ice_cpp_dir)/$(libsubdir) -lIce -lIceUtil -framework Foundation
LIBS = -lIceObjC$(libsuffix) -framework Foundation
-ICESSL_LIBS = -lIceSSLObjC$(libsuffix)
+ICESSL_LIBS = -lIceSSLObjC$(libsuffix)
TEST_LIBS = -lTestCommon $(LIBS)
diff --git a/objective-c/src/Ice/Makefile b/objective-c/src/Ice/Makefile
index 50fd9aa6425..23d758ce625 100644
--- a/objective-c/src/Ice/Makefile
+++ b/objective-c/src/Ice/Makefile
@@ -84,9 +84,28 @@ SDIR = $(slicedir)/Ice
include $(top_srcdir)/config/Make.rules
+#
+# Set RPATH to the cpp/lib directory or Ice installation lib directory. Note that unlike Linux
+# platforms, we always set the RPATH for source builds on OS X. This is required because we
+# can no longer rely on DYLD_LIBRARY_PATH on El Capitan. The RPATH is updated when the library
+# is installed (see cpp/config/Make.rules.Darwin).
+#
+ifdef ice_src_dist
+ RPATH_DIR = @loader_path/../../cpp/$(libsubdir)
+else
+ RPATH_DIR = $(ice_dir)/$(libsubdir)
+endif
+
+ifdef usr_dir_install
+ installlib += ; install_name_tool -delete_rpath $(RPATH_DIR) $(1)/$(3)
+else ifdef ice_src_dist
+ installlib += ; install_name_tool -delete_rpath $(RPATH_DIR) $(1)/$(3)
+endif
+
CPPFLAGS := -I. -I$(ice_cpp_dir)/include -DICE_API_EXPORTS $(CPPFLAGS)
SLICE2OBJCFLAGS := --ice --include-dir objc/Ice --dll-export ICE_API $(SLICE2OBJCFLAGS)
LINKWITH := $(BASELIBS)
+LDFLAGS := -Wl,-rpath,$(RPATH_DIR) $(LDFLAGS)
$(libdir)/$(LIBFILENAME): $(OBJS)
rm -f $@