lang/gnat-aux: Modify rpath handling for shared project libraries The GNAT compiler project builder essentially doesn't support DESTDIR out of the box. By default, it sets rpath of shared libraries to the directory to which they are installed. One may add additional rpaths through switches, but not remove these default ones. Also added to the default rpath are the paths to the ada library and the standard localbase library. This modification to the compiler will force the project builder to recognize the -R switch (gnatlink uses this to disable rpaths), and it reacts by not putting the library install path into rpath. The adalib and ${LOCALBASE}/lib paths will still make up the base rpath definition of the built shared libraries. This change was prompted by the rpath troubles of the XML/Ada package.diff -r1.6 -r1.7 pkgsrc/lang/gnat-aux/Makefile
(marino)
@@ -1,18 +1,18 @@ | @@ -1,18 +1,18 @@ | |||
1 | # $NetBSD: Makefile,v 1.6 2011/10/05 18:11:55 marino Exp $ | 1 | # $NetBSD: Makefile,v 1.7 2011/12/03 07:28:18 marino Exp $ | |
2 | # | 2 | # | |
3 | 3 | |||
4 | DISTNAME= gnat-aux-${SNAPSHOT} | 4 | DISTNAME= gnat-aux-${SNAPSHOT} | |
5 | PKGREVISION= 1 | 5 | PKGREVISION= 2 | |
6 | CATEGORIES= lang | 6 | CATEGORIES= lang | |
7 | MASTER_SITES= http://downloads.dragonlace.net/src/ \ | 7 | MASTER_SITES= http://downloads.dragonlace.net/src/ \ | |
8 | http://dragonlace.mirrors.ada.cx/src/ | 8 | http://dragonlace.mirrors.ada.cx/src/ | |
9 | EXTRACT_SUFX= .tar.bz2 | 9 | EXTRACT_SUFX= .tar.bz2 | |
10 | 10 | |||
11 | MAINTAINER= draco@marino.st | 11 | MAINTAINER= draco@marino.st | |
12 | HOMEPAGE= http://www.dragonlace.net/ | 12 | HOMEPAGE= http://www.dragonlace.net/ | |
13 | COMMENT= GNAT Ada compiler based on GCC ${GCC_BRANCH} | 13 | COMMENT= GNAT Ada compiler based on GCC ${GCC_BRANCH} | |
14 | LICENSE= gnu-gpl-v3 AND gnu-lgpl-v3 | 14 | LICENSE= gnu-gpl-v3 AND gnu-lgpl-v3 | |
15 | 15 | |||
16 | SNAPSHOT= 20110627 | 16 | SNAPSHOT= 20110627 | |
17 | GCC_BRANCH= 4.6 | 17 | GCC_BRANCH= 4.6 | |
18 | GCC_POINT= 1 | 18 | GCC_POINT= 1 |
@@ -1,18 +1,18 @@ | @@ -1,18 +1,18 @@ | |||
1 | # $NetBSD: buildlink3.mk,v 1.1.1.1 2011/02/01 20:32:56 drochner Exp $ | 1 | # $NetBSD: buildlink3.mk,v 1.2 2011/12/03 07:28:18 marino Exp $ | |
2 | 2 | |||
3 | BUILDLINK_TREE+= gnat-aux | 3 | BUILDLINK_TREE+= gnat-aux | |
4 | 4 | |||
5 | .if !defined(GNAT_AUX_BUILDLINK3_MK) | 5 | .if !defined(GNAT_AUX_BUILDLINK3_MK) | |
6 | GNAT_AUX_BUILDLINK3_MK:= | 6 | GNAT_AUX_BUILDLINK3_MK:= | |
7 | 7 | |||
8 | BUILDLINK_API_DEPENDS.gnat-aux+= gnat-aux>=20101120 | 8 | BUILDLINK_API_DEPENDS.gnat-aux+= gnat-aux>=20110627nb2 | |
9 | BUILDLINK_PKGSRCDIR.gnat-aux?= ../../lang/gnat-aux | 9 | BUILDLINK_PKGSRCDIR.gnat-aux?= ../../lang/gnat-aux | |
10 | 10 | |||
11 | .include "../../devel/zlib/buildlink3.mk" | 11 | .include "../../devel/zlib/buildlink3.mk" | |
12 | .include "../../devel/gmp/buildlink3.mk" | 12 | .include "../../devel/gmp/buildlink3.mk" | |
13 | .include "../../math/mpfr/buildlink3.mk" | 13 | .include "../../math/mpfr/buildlink3.mk" | |
14 | .include "../../math/mpcomplex/buildlink3.mk" | 14 | .include "../../math/mpcomplex/buildlink3.mk" | |
15 | .include "../../converters/libiconv/buildlink3.mk" | 15 | .include "../../converters/libiconv/buildlink3.mk" | |
16 | .endif # GNAT_AUX_BUILDLINK3_MK | 16 | .endif # GNAT_AUX_BUILDLINK3_MK | |
17 | 17 | |||
18 | BUILDLINK_TREE+= -gnat-aux | 18 | BUILDLINK_TREE+= -gnat-aux |
@@ -1,23 +1,24 @@ | @@ -1,23 +1,24 @@ | |||
1 | $NetBSD: distinfo,v 1.5 2011/10/05 18:11:55 marino Exp $ | 1 | $NetBSD: distinfo,v 1.6 2011/12/03 07:28:18 marino Exp $ | |
2 | 2 | |||
3 | SHA1 (gnat-aux-20110627.tar.bz2) = 598d2c21c3bbd1e2cada2ca98331107af3deb608 | 3 | SHA1 (gnat-aux-20110627.tar.bz2) = 598d2c21c3bbd1e2cada2ca98331107af3deb608 | |
4 | RMD160 (gnat-aux-20110627.tar.bz2) = 84b05832457568fef9355279214caeacca9c74ba | 4 | RMD160 (gnat-aux-20110627.tar.bz2) = 84b05832457568fef9355279214caeacca9c74ba | |
5 | Size (gnat-aux-20110627.tar.bz2) = 26799024 bytes | 5 | Size (gnat-aux-20110627.tar.bz2) = 26799024 bytes | |
6 | SHA1 (gnat-bootstrap.i386.dragonfly.tar.bz2) = d7a8103243a2df3723d9d3c3ec0da9c3bb725214 | 6 | SHA1 (gnat-bootstrap.i386.dragonfly.tar.bz2) = d7a8103243a2df3723d9d3c3ec0da9c3bb725214 | |
7 | RMD160 (gnat-bootstrap.i386.dragonfly.tar.bz2) = 9e6fde444e0ed76ee404810af6d6b7eb48659c09 | 7 | RMD160 (gnat-bootstrap.i386.dragonfly.tar.bz2) = 9e6fde444e0ed76ee404810af6d6b7eb48659c09 | |
8 | Size (gnat-bootstrap.i386.dragonfly.tar.bz2) = 28205489 bytes | 8 | Size (gnat-bootstrap.i386.dragonfly.tar.bz2) = 28205489 bytes | |
9 | SHA1 (gnat-bootstrap.i386.netbsd.tar.bz2) = 19b61f54fae8e237a4e678ff03f20f50b47db1df | 9 | SHA1 (gnat-bootstrap.i386.netbsd.tar.bz2) = 19b61f54fae8e237a4e678ff03f20f50b47db1df | |
10 | RMD160 (gnat-bootstrap.i386.netbsd.tar.bz2) = ade03f223b2af229daece20a749915f7da0eb0a6 | 10 | RMD160 (gnat-bootstrap.i386.netbsd.tar.bz2) = ade03f223b2af229daece20a749915f7da0eb0a6 | |
11 | Size (gnat-bootstrap.i386.netbsd.tar.bz2) = 27654956 bytes | 11 | Size (gnat-bootstrap.i386.netbsd.tar.bz2) = 27654956 bytes | |
12 | SHA1 (gnat-bootstrap.x86_64.dragonfly.tar.bz2) = 77a637a497c61e4085de31b24a205f24b1776a15 | 12 | SHA1 (gnat-bootstrap.x86_64.dragonfly.tar.bz2) = 77a637a497c61e4085de31b24a205f24b1776a15 | |
13 | RMD160 (gnat-bootstrap.x86_64.dragonfly.tar.bz2) = 4d0eb7b8a5f901333f1ffd190a5bf72072b2b52e | 13 | RMD160 (gnat-bootstrap.x86_64.dragonfly.tar.bz2) = 4d0eb7b8a5f901333f1ffd190a5bf72072b2b52e | |
14 | Size (gnat-bootstrap.x86_64.dragonfly.tar.bz2) = 31380342 bytes | 14 | Size (gnat-bootstrap.x86_64.dragonfly.tar.bz2) = 31380342 bytes | |
15 | SHA1 (gnat-bootstrap.x86_64.netbsd.tar.bz2) = 84f0e9179998daa643046a5d139321c4130ea84d | 15 | SHA1 (gnat-bootstrap.x86_64.netbsd.tar.bz2) = 84f0e9179998daa643046a5d139321c4130ea84d | |
16 | RMD160 (gnat-bootstrap.x86_64.netbsd.tar.bz2) = 0b2943349536c323a62b56dc05ff1fedd6d7e17a | 16 | RMD160 (gnat-bootstrap.x86_64.netbsd.tar.bz2) = 0b2943349536c323a62b56dc05ff1fedd6d7e17a | |
17 | Size (gnat-bootstrap.x86_64.netbsd.tar.bz2) = 30572187 bytes | 17 | Size (gnat-bootstrap.x86_64.netbsd.tar.bz2) = 30572187 bytes | |
18 | SHA1 (gnat-bootstrap.i386.solaris.tar.bz2) = 4962657bfc894a20ad3102c1f6fe8e566b47cb51 | 18 | SHA1 (gnat-bootstrap.i386.solaris.tar.bz2) = 4962657bfc894a20ad3102c1f6fe8e566b47cb51 | |
19 | RMD160 (gnat-bootstrap.i386.solaris.tar.bz2) = ae72e76d0aba94451d99b9a70a3c049c9258cc82 | 19 | RMD160 (gnat-bootstrap.i386.solaris.tar.bz2) = ae72e76d0aba94451d99b9a70a3c049c9258cc82 | |
20 | Size (gnat-bootstrap.i386.solaris.tar.bz2) = 43247034 bytes | 20 | Size (gnat-bootstrap.i386.solaris.tar.bz2) = 43247034 bytes | |
21 | SHA1 (patch-aa) = 8a6199bb91fa1051db7af154e6995c116da71e63 | 21 | SHA1 (patch-aa) = 8a6199bb91fa1051db7af154e6995c116da71e63 | |
22 | SHA1 (patch-ab) = 76cff68f5f697ed5aacd41d06bbb4d9a805e9d91 | 22 | SHA1 (patch-ab) = 76cff68f5f697ed5aacd41d06bbb4d9a805e9d91 | |
23 | SHA1 (patch-ac) = f8a73fc95b9119ae75b64a5578b94be6dbccb837 | 23 | SHA1 (patch-ac) = f8a73fc95b9119ae75b64a5578b94be6dbccb837 | |
24 | SHA1 (patch-ad) = b72ac305a11f40d77f76a8a1b579a93742123079 |
--- gcc/ada/mlib-prj.adb
+++ gcc/ada/mlib-prj.adb
@@ -341,6 +341,11 @@ package body MLib.Prj is
Foreign_Sources : Boolean;
+ Rpath_Disabled : Boolean := False;
+ -- If -R is passed through the library options for the linker, it will
+ -- prevent the implemented libraries portion of the rpath switch from
+ -- being built, even if the linker is capable of supporting rpath.
+
Rpath : String_Access := null;
-- Allocated only if Path Option is supported
@@ -790,7 +795,7 @@ package body MLib.Prj is
Opts.Table (Opts.Last) :=
new String'("-L" & Name_Buffer (1 .. Name_Len));
- if Path_Option /= null then
+ if not Rpath_Disabled and then Path_Option /= null then
Add_Rpath (Name_Buffer (1 .. Name_Len));
end if;
@@ -1285,6 +1290,9 @@ package body MLib.Prj is
Opts.Increment_Last;
Opts.Table (Opts.Last) :=
new String'(Name_Buffer (1 .. Name_Len));
+ if Name_Len = 2 and then Name_Buffer (1 .. 2) = "-R" then
+ Rpath_Disabled := True;
+ end if;
end if;
Current := Element.Next;