[gjs] Don't set rpath if we're using the standalone libmozjs185



commit a38af56059ab3457db8886b4d12116ab72458fcc
Author: Colin Walters <walters verbum org>
Date:   Thu Jun 9 13:41:14 2011 -0400

    Don't set rpath if we're using the standalone libmozjs185
    
    If we set an rpath to $prefix/lib, this causes us to prefer installed
    libraries over the just-built ones, effectively subverting the ability
    to run uninstalled.

 Makefile.am             |   10 ++++++++--
 configure.ac            |    7 ++++++-
 gjs-internals-1.0.pc.in |    3 +--
 3 files changed, 15 insertions(+), 5 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index b0e433a..ff00cf4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -70,7 +70,10 @@ libgjs_la_CFLAGS = 		\
 libgjs_la_LDFLAGS = 		\
 	-export-symbols-regex "^[^_]" -version-info 0:0:0	\
 	-no-undefined \
-	-R $(FIREFOX_JS_LIBDIR) -rdynamic
+	-rdynamic
+if HAVE_FIREFOX_JS_LIBDIR
+libgjs_la_LDFLAGS += -R $(FIREFOX_JS_LIBDIR) 
+endif
 libgjs_la_LIBADD = 		\
 	$(GJS_LIBS)
 
@@ -125,7 +128,10 @@ gjs_console_LDADD =		\
 	$(JS_LIBS)		\
 	$(GOBJECT_LIBS)		\
 	libgjs.la
-gjs_console_LDFLAGS = -R $(FIREFOX_JS_LIBDIR) -rdynamic
+gjs_console_LDFLAGS = -rdynamic
+if HAVE_FIREFOX_JS_LIBDIR
+gjs_console_LDFLAGS += -R $(FIREFOX_JS_LIBDIR)
+endif
 gjs_console_SOURCES = gjs/console.c
 
 install-exec-hook:
diff --git a/configure.ac b/configure.ac
index e008861..18ffc55 100644
--- a/configure.ac
+++ b/configure.ac
@@ -95,7 +95,7 @@ AC_CHECK_FUNCS(mallinfo)
 AC_MSG_CHECKING([for standalone mozjs185])
 PKG_CHECK_EXISTS([mozjs185], JS_PACKAGE=mozjs185,)
 if test x$JS_PACKAGE != x; then
-    FIREFOX_JS_LIBDIR=`$PKG_CONFIG --variable=libdir $JS_PACKAGE`
+    FIREFOX_JS_LIBDIR=
     MOZJS_IS_STANDALONE=yes
     AC_MSG_RESULT([yes])
     PKG_CHECK_MODULES(JS, $JS_PACKAGE)
@@ -142,6 +142,11 @@ echo "Using JS_CFLAGS: $JS_CFLAGS"
 echo "Using JS_LIBS: $JS_LIBS"
 
 AC_SUBST(JS_PACKAGE)
+AM_CONDITIONAL(HAVE_FIREFOX_JS_LIBDIR, test x$FIREFOX_JS_LIBDIR != x)
+if test x$FIREFOX_JS_LIBDIR != x; then
+   GJS_INTERNALS_LIBS="-Wl,--rpath=$FIREFOX_JS_LIBDIR"
+fi
+AC_SUBST(GJS_INTERNALS_LIBS)
 AC_SUBST(FIREFOX_JS_LIBDIR)
 
 saved_CFLAGS=$CFLAGS
diff --git a/gjs-internals-1.0.pc.in b/gjs-internals-1.0.pc.in
index e4517cb..f4feb19 100644
--- a/gjs-internals-1.0.pc.in
+++ b/gjs-internals-1.0.pc.in
@@ -8,10 +8,9 @@ datadir= datadir@
 
 jsdir= gjsjsdir@
 jsnativedir= gjsnativedir@
-mozjslibdir= FIREFOX_JS_LIBDIR@
 
 Cflags: -I${includedir}/gjs-1.0
-Libs: -Wl,--rpath=${mozjslibdir}
+Libs: @GJS_INTERNALS_LIBS@
 Requires: gjs-1.0 gobject-introspection-1.0 @JS_PACKAGE@
 
 Name: gjs-internals-1.0



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]