Libraries should be linked with -rpath $libdir but programs should not. Doing so for the latter means that a redundant RPATH entry of $libdir will end up in the binaries. The redundant RPATH can also cause obscure build failures by causing in-build binaries to pick up libraries from the system environment, which libtool will otherwise avoid. --- subversion-1.5.1/build/generator/gen_base.py.rpath +++ subversion-1.5.1/build/generator/gen_base.py @@ -453,6 +453,9 @@ class TargetLib(TargetLinked): self.msvc_fake = options.get('msvc-fake') == 'yes' # has fake target self.msvc_export = string.split(options.get('msvc-export', '')) + ### hmm. this is Makefile-specific + self.link_cmd = '$(LINK_LIB)' + class TargetApacheMod(TargetLib): def __init__(self, name, options, gen_obj): --- subversion-1.5.1/Makefile.in.rpath +++ subversion-1.5.1/Makefile.in @@ -167,7 +167,8 @@ COMPILE_JAVAHL_CXX = $(LIBTOOL) $(LTCXXF COMPILE_JAVAHL_JAVAC = $(JAVAC) $(JAVAC_FLAGS) COMPILE_JAVAHL_JAVAH = $(JAVAH) -LINK = $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) $(LT_LDFLAGS) $(CFLAGS) $(LDFLAGS) -rpath $(libdir) +LINK = $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) $(LT_LDFLAGS) $(CFLAGS) $(LDFLAGS) +LINK_LIB = $(LINK) -rpath $(libdir) # special link rule for mod_dav_svn LINK_APACHE_MOD = $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) $(LT_LDFLAGS) $(CFLAGS) $(LDFLAGS) -rpath $(APACHE_LIBEXECDIR) -avoid-version -module $(APACHE_LDFLAGS)