This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Search more library dirs with --enable-shared


This patch arranges for the top-level Makefile to set LD_LIBRARY_PATH
or equivalent such that the directory in which a shared C++ library
would live.  This is important to get libgcj's configure tests (and
any other C++ library's, for that matter) to succeed, when shared
libraries are enabled.

I'm checking this in.  Tested on i686-pc-linux-gnu.

Index: ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* Makefile.in (HOST_LIB_PATH, TARGET_LIB_PATH): New macros.
	(REALLY_SET_LIB_PATH): Use them.

Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/egcs/Makefile.in,v
retrieving revision 1.58
diff -u -p -r1.58 Makefile.in
--- Makefile.in 2000/10/04 18:00:37 1.58
+++ Makefile.in 2000/11/18 20:43:05
@@ -186,14 +186,19 @@ SET_LIB_PATH =
 # the libraries.  This may be changed by configure.in.
 RPATH_ENVVAR = LD_LIBRARY_PATH
 
+# This is the list of directories that may be needed in RPATH_ENVVAR
+# so that programs built for the host machine work.
+HOST_LIB_PATH = $$r/bfd:$$r/opcodes
+
+# This is the list of directories that may be needed in RPATH_ENVVAR
+# so that prorgams built for the target machine work.
+TARGET_LIB_PATH = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs:$$r/$(TARGET_SUBDIR)/libstdc++
+
 # configure.in sets SET_LIB_PATH to this if --enable-shared was used.
+# Some platforms don't like blank entries, so we remove duplicate,
+# leading and trailing colons.
 REALLY_SET_LIB_PATH = \
-  if [ x"$$$(RPATH_ENVVAR)" != x ]; then \
-    $(RPATH_ENVVAR)=$$r/bfd:$$r/opcodes:$$$(RPATH_ENVVAR); \
-  else \
-    $(RPATH_ENVVAR)=$$r/bfd:$$r/opcodes; \
-  fi; \
-  export $(RPATH_ENVVAR);
+  $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
 
 ALL = all.normal
 INSTALL_TARGET = installdirs \
-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]