Bug 472269 LD_LIBRARY_PATH is not set when running thunderbird from mozilla/dist/bin on Solaris r=wtc sr=neil
authorGinn Chen <ginn.chen@sun.com>
Mon, 09 Feb 2009 14:18:02 +0800
changeset 24782 67c085271297a24d18f542a72001614e356d47ee
parent 24781 de843ab11f430cc13dd9a46350b68a21d384d00c
child 24783 0ebeefbbdac0a7028c7e3616822fcb7f2cc36cce
push idunknown
push userunknown
push dateunknown
reviewerswtc, neil
bugs472269
milestone1.9.2a1pre
Bug 472269 LD_LIBRARY_PATH is not set when running thunderbird from mozilla/dist/bin on Solaris r=wtc sr=neil
build/unix/run-mozilla.sh
--- a/build/unix/run-mozilla.sh
+++ b/build/unix/run-mozilla.sh
@@ -291,19 +291,29 @@ fi
 ## toolkit/library/libxul.so, $ORIGIN will be "toolkit/library" instead of "dist/bin".
 ## So the runtime linker will use "toolkit/library" NOT "dist/bin" to locate the
 ## other shared libraries that libxul.so depends on.  This only happens
 ## when a user (developer) tries to start firefox, thunderbird, or seamonkey
 ## under dist/bin. To solve the problem, we should rely on LD_LIBRARY_PATH
 ## to locate shared libraries.
 ##
 ## Note: 
-##  We choose libxul.so as a representative shared library. If it is 
-##  a symbolic link, all other shared libraries are symbolic links also.
-if [ `uname -s` != "SunOS" -o -h "$MOZ_DIST_BIN/libxul.so" ]
+##  We test $MOZ_DIST_BIN/*.so. If any of them is a symbolic link,
+##  we need to set LD_LIBRARY_PATH.
+##########################################################################
+moz_should_set_ld_library_path()
+{
+	[ `uname -s` != "SunOS" ] && return 0
+	for sharedlib in $MOZ_DIST_BIN/*.so
+	do
+		[ -h $sharedlib ] && return 0
+	done
+	return 1
+}
+if moz_should_set_ld_library_path
 then
 	LD_LIBRARY_PATH=${MOZ_DIST_BIN}:${MOZ_DIST_BIN}/plugins:${MRE_HOME}${LD_LIBRARY_PATH+":$LD_LIBRARY_PATH"}
 fi 
 
 if [ -n "$LD_LIBRARYN32_PATH" ]
 then
 	LD_LIBRARYN32_PATH=${MOZ_DIST_BIN}:${MOZ_DIST_BIN}/plugins:${MRE_HOME}${LD_LIBRARYN32_PATH+":$LD_LIBRARYN32_PATH"}
 fi