summaryrefslogtreecommitdiff
path: root/debian/patches/rpath
blob: a2a773eaf8afc99c6cb7f043ea54f7720d93c44d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
Prevent the linker from adding an rpath to shared libraries.  Original
patch by David Kimdon <dwhedon@debian.org>.  The basic theory is:

- Split the $(LINK) makefile macro into $(LINK) and $(LINK_LIB).
- Comment out LD_RUN_PATH in the Perl makefiles.
- Use libtool instead of apxs to install the apache modules.
  libtool relinks without rpath in this case, apxs obviously doesn't.

--- a/Makefile.in
+++ b/Makefile.in
@@ -255,10 +255,10 @@
 COMPILE_GMOCK_CXX = $(LT_COMPILE_CXX_NOWARN) $(GMOCK_INCLUDES) -o $@ -c
 COMPILE_CXXHL_GMOCK_CXX = $(LT_COMPILE_CXX) $(CXXHL_INCLUDES) $(GMOCK_INCLUDES) -o $@ -c
 
-LINK = $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) $(LT_LDFLAGS) $(CFLAGS) $(LDFLAGS) -rpath $(libdir)
-LINK_LIB = $(LINK) $(LT_SO_VERSION)
-LINK_CXX = $(LIBTOOL) $(LTCXXFLAGS) --mode=link $(CXX) $(LT_LDFLAGS) $(CXXFLAGS) $(LDFLAGS) -rpath $(libdir)
-LINK_CXX_LIB = $(LINK_CXX) $(LT_SO_VERSION)
+LINK = $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) $(LT_LDFLAGS) $(CFLAGS) $(LDFLAGS)
+LINK_LIB = $(LINK) $(LT_SO_VERSION) -rpath $(libdir)
+LINK_CXX = $(LIBTOOL) $(LTCXXFLAGS) --mode=link $(CXX) $(LT_LDFLAGS) $(CXXFLAGS) $(LDFLAGS)
+LINK_CXX_LIB = $(LINK_CXX) $(LT_SO_VERSION) -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)
@@ -837,7 +837,9 @@
 	./config.status subversion/bindings/swig/perl/native/Makefile.PL
 
 $(SWIG_PL_DIR)/native/Makefile: $(SWIG_PL_DIR)/native/Makefile.PL
-	cd $(SWIG_PL_DIR)/native; $(PERL) Makefile.PL PREFIX=$(prefix)
+	cd $(SWIG_PL_DIR)/native; \
+		$(PERL) Makefile.PL PREFIX=$(prefix); \
+		sed -i -e '/^LD_RUN_PATH/s/^/#/' Makefile Makefile.[a-z]*
 
 # There is a "readlink -f" command on some systems for the same purpose,
 # but it's not as portable (e.g. Mac OS X doesn't have it).  These should
--- a/build.conf
+++ b/build.conf
@@ -561,7 +561,7 @@
 path = subversion/bindings/swig/python/libsvn_swig_py
 libs = libsvn_client libsvn_wc libsvn_ra libsvn_delta libsvn_subr
        apriconv apr python swig
-link-cmd = $(LINK)
+link-cmd = $(LINK_LIB) $(SWIG_PY_LIBS)
 install = swig-py-lib
 # need special build rule to include -DSWIGPYTHON
 compile-cmd = $(COMPILE_SWIG_PY)
@@ -586,7 +586,7 @@
 lang = ruby
 path = subversion/bindings/swig/ruby/libsvn_swig_ruby
 libs = libsvn_client libsvn_wc libsvn_delta libsvn_subr apriconv apr ruby swig
-link-cmd = $(LINK) $(SWIG_RB_LIBS)
+link-cmd = $(LINK_LIB) $(SWIG_RB_LIBS)
 install = swig-rb-lib
 # need special build rule to include
 compile-cmd = $(COMPILE_SWIG_RB)
--- a/build/generator/gen_base.py
+++ b/build/generator/gen_base.py
@@ -498,7 +498,7 @@
     self.install = options.get('install')
     self.compile_cmd = options.get('compile-cmd')
     self.sources = options.get('sources', '*.c *.cpp')
-    self.link_cmd = options.get('link-cmd', '$(LINK)')
+    self.link_cmd = options.get('link-cmd', '$(LINK_LIB)')
 
     self.external_lib = options.get('external-lib')
     self.external_project = options.get('external-project')
@@ -551,6 +551,7 @@
       extmap = self.gen_obj._extension_map
       self.objext = extmap['exe', 'object']
       self.filename = build_path_join(self.path, name + extmap['exe', 'target'])
+      self.link_cmd = '$(LINK)'
 
     self.manpages = options.get('manpages', '')
     self.testing = options.get('testing')