summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2014-11-28 15:34:17 +0100
committerJose <jose@zeroc.com>2014-11-28 15:34:17 +0100
commit47e05ffb78bb4542bb1714afc7d6439f1ba2475e (patch)
tree42bc6de9433213722c0ca688e802aff637ad8bd3
parentDemoscript fixes, add ThirdParty bin to path when required (diff)
downloadice-47e05ffb78bb4542bb1714afc7d6439f1ba2475e.tar.bz2
ice-47e05ffb78bb4542bb1714afc7d6439f1ba2475e.tar.xz
ice-47e05ffb78bb4542bb1714afc7d6439f1ba2475e.zip
RPATH build fixes
-rw-r--r--cpp/config/Make.rules.Darwin16
-rw-r--r--distribution/lib/DistUtils.py2
-rw-r--r--py/config/Make.rules10
-rw-r--r--py/config/Make.rules.Darwin4
-rw-r--r--rb/config/Make.rules14
-rw-r--r--rb/config/Make.rules.Darwin2
-rw-r--r--rb/config/Make.rules.Linux8
-rw-r--r--rb/src/IceRuby/Makefile2
-rwxr-xr-xscripts/TestUtil.py8
9 files changed, 35 insertions, 31 deletions
diff --git a/cpp/config/Make.rules.Darwin b/cpp/config/Make.rules.Darwin
index 4df0b1d46df..4b99e81a0a7 100644
--- a/cpp/config/Make.rules.Darwin
+++ b/cpp/config/Make.rules.Darwin
@@ -55,26 +55,26 @@ ifeq ($(embedded_runpath),yes)
# If embedded_runpath_prefix is set it has preference
#
ifneq ($(embedded_runpath_prefix),)
- RPATH_DIR = $(embedded_runpath_prefix)
+ RPATH_DIR = $(embedded_runpath_prefix)
endif
ifeq ($(RPATH_DIR),)
- ifdef ice_src_dist
- RPATH_DIR = @loader_path/$(libdir)
- else
- RPATH_DIR = $(ice_dir)/$(libsubdir)
- endif
+ 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 =
+ RPATH_DIR =
endif
ifneq ($(RPATH_DIR),)
- LDEXEFLAGS = -Wl,-rpath,$(RPATH_DIR)
+ LDEXEFLAGS = -Wl,-rpath,$(RPATH_DIR)
endif
endif
diff --git a/distribution/lib/DistUtils.py b/distribution/lib/DistUtils.py
index 0e2b3f05222..f6f0b9f33d7 100644
--- a/distribution/lib/DistUtils.py
+++ b/distribution/lib/DistUtils.py
@@ -882,6 +882,8 @@ class Darwin(Platform):
print("Fixing python location")
move(buildDir + '/python', buildDir + '/../python')
+ runCommand("install_name_tool -rpath %s/lib /Library/Developer/Ice-@ver@/lib %s/../python/IcePy.so" %
+ (buildDir, buildDir))
print("ok")
print("Fixing IceGrid Admin.app location")
diff --git a/py/config/Make.rules b/py/config/Make.rules
index 63254c6b6af..dacd57bb059 100644
--- a/py/config/Make.rules
+++ b/py/config/Make.rules
@@ -92,10 +92,8 @@ else
include $(top_srcdir)/../config/Make.common.rules
endif
-ifdef ice_src_dist
- RPATH_DIR = $(LOADER_PATH)/../../cpp/$(libsubdir)
-else
- RPATH_DIR = $(ice_dir)/$(libdir)
+ifneq ($(prefix),/usr)
+RPATH_DIR = $(prefix)/$(libsubdir)
endif
#
@@ -149,10 +147,6 @@ else
endif
ICE_LIBS = $(ICE_LIB_DIR) -lIce -lSlice -lIceUtil
-ifneq ($(embedded_runpath_prefix),)
- runpath_libdir := $(embedded_runpath_prefix)/$(libsubdir)
-endif
-
CPPFLAGS =
ICECPPFLAGS = -I$(slicedir)
SLICE2PYFLAGS = $(ICECPPFLAGS)
diff --git a/py/config/Make.rules.Darwin b/py/config/Make.rules.Darwin
index 7a2dcfc7523..bf66fabf948 100644
--- a/py/config/Make.rules.Darwin
+++ b/py/config/Make.rules.Darwin
@@ -16,4 +16,6 @@ include $(top_srcdir)/../cpp/config/Make.rules.$(UNAME)
shlibldflags += $(LDEXEFLAGS)
mksoname = $(if $(2),lib$(1).$(2).so,lib$(1).so)
-mklibname = lib$(1).so
+mklibname = lib$(1).so
+
+mkshlib = $(CXX) -dynamiclib $(shlibldflags) -o $(1) -install_name @rpath/$(2) $(3) $(4) \ No newline at end of file
diff --git a/rb/config/Make.rules b/rb/config/Make.rules
index 433e60e498f..d34cd1918fb 100644
--- a/rb/config/Make.rules
+++ b/rb/config/Make.rules
@@ -163,10 +163,8 @@ else
configdir = $(top_srcdir)/../cpp/config
endif
-ifdef ice_src_dist
- RPATH_DIR = $(LOADER_PATH)/../../cpp/$(libsubdir)
-else
- RPATH_DIR = $(ice_dir)/$(libdir)
+ifneq ($(prefix),/usr)
+RPATH_DIR = $(prefix)/$(libsubdir)
endif
include $(configdir)/Make.rules.$(UNAME)
@@ -185,14 +183,6 @@ ICECPPFLAGS = -I$(slicedir)
SLICE2RBFLAGS = $(ICECPPFLAGS)
LDFLAGS = $(LDPLATFORMFLAGS) $(CXXFLAGS) -L$(libdir)
-#
-# A Ruby extension library cannot have a "lib" prefix, so Ruby-specific
-# functions are defined that strip "lib" from the regular library name.
-#
-mkrblibfilename = $(subst lib,,$(call mklibfilename,$(1),$(2)))
-mkrbsoname = $(subst lib,,$(call mksoname,$(1),$(2)))
-mkrblibname = $(subst lib,,$(call mklibname,$(1)))
-
ifdef ice_src_dist
SLICEPARSERLIB = $(ice_cpp_dir)/$(libsubdir)/$(call mklibfilename,Slice,$(VERSION))
SLICE2RB = $(ice_cpp_dir)/$(binsubdir)/$(slice_translator)
diff --git a/rb/config/Make.rules.Darwin b/rb/config/Make.rules.Darwin
index ac02383bb16..e5206bb4acc 100644
--- a/rb/config/Make.rules.Darwin
+++ b/rb/config/Make.rules.Darwin
@@ -18,7 +18,7 @@ $(warning ===================================================================)
include $(top_srcdir)/../cpp/config/Make.rules.$(UNAME)
-shlibldflags = $(CXXFLAGS) -L$(libdi) $(LDEXEFLAGS)
+shlibldflags = $(CXXFLAGS) -L$(libdir) $(LDEXEFLAGS)
mkrblibfilename = $(if $(2),$(1).$(2).bundle,$(1).bundle)
mkrbsoname = $(if $(2),$(1).$(2).bundle,$(1).bundle)
diff --git a/rb/config/Make.rules.Linux b/rb/config/Make.rules.Linux
index fa5c68a496a..77351631dd8 100644
--- a/rb/config/Make.rules.Linux
+++ b/rb/config/Make.rules.Linux
@@ -12,4 +12,12 @@
#
include $(top_srcdir)/../cpp/config/Make.rules.$(UNAME)
+#
+# A Ruby extension library cannot have a "lib" prefix, so Ruby-specific
+# functions are defined that strip "lib" from the regular library name.
+#
+mkrblibfilename = $(subst lib,,$(call mklibfilename,$(1),$(2)))
+mkrbsoname = $(subst lib,,$(call mksoname,$(1),$(2)))
+mkrblibname = $(subst lib,,$(call mklibname,$(1)))
+
mkshlib = $(CXX) -shared $(LDFLAGS) $(LDEXEFLAGS) -o $(1) -Wl,-h,$(2) $(3) $(4) -lpthread \ No newline at end of file
diff --git a/rb/src/IceRuby/Makefile b/rb/src/IceRuby/Makefile
index be288583e44..2ef113231d3 100644
--- a/rb/src/IceRuby/Makefile
+++ b/rb/src/IceRuby/Makefile
@@ -31,7 +31,7 @@ OBJS = Communicator.o \
include $(top_srcdir)/config/Make.rules
CPPFLAGS := -I. -I.. $(CPPFLAGS) $(ICE_FLAGS) $(RUBY_FLAGS)
-LINKWITH := -L"$(libdir)" $(ICE_LIBS) $(RUBY_LIBS) $(CXXLIBS)
+LINKWITH := -L"$(libdir)" $(ICE_LIBS) $(RUBY_LIBS) $(CXXLIBS)
$(libdir)/$(LIBFILENAME): $(OBJS)
rm -f $@
diff --git a/scripts/TestUtil.py b/scripts/TestUtil.py
index 9012e29b0fc..c35f8a0428d 100755
--- a/scripts/TestUtil.py
+++ b/scripts/TestUtil.py
@@ -1739,6 +1739,7 @@ def getTestEnv(lang, testdir):
print("warning: could not detect Ice Third party installation.")
else:
addClasspath(os.path.join("/" "usr" "share", "java", "lib", "db.jar"), env)
+
#
# If Ice is installed from RPMs:
# Set the CLASSPATH for Java.
@@ -1753,8 +1754,15 @@ def getTestEnv(lang, testdir):
addPathToEnv("NODE_PATH", os.path.join(testdir), env)
return env # That's it, we're done!
+ #
+ # For Win32 we always need to add bin dir to path
+ # for others we just need to add it for scripting
+ # languages that use C++ extensions (py, ruby, php)
+ #
if isWin32():
addLdPath(getCppLibDir(), env)
+ elif lang in ["py", "rb", "php"]:
+ addLdPath(getCppLibDir(), env)
if lang == "javae":
javaDir = os.path.join(getIceDir("javae", testdir), "jdk", "lib")