Subject: Re: -rpath linker options
To: Brook Milligan <brook@biology.nmsu.edu>
From: Roland Illig <rillig@NetBSD.org>
List: tech-pkg
Date: 06/29/2006 19:43:02
Brook Milligan wrote:
> I am trying to make a package for a large set of software that
> installs in its own place (e.g., ${PREFIX}/${PKGHOME}) rather than
> being spread about the various directories in ${PREFIX}.  This package
> creates both shared libraries and binary programs that use those
> shared libraries.  It does not use libtool, and for the moment I think
> it is too invasive to teach it how to do so.
> 
> I have arranged for the correct -rpath flags to be set for the linker
> (e.g., -Wl,-rpath,${PREFIX}/${PKGHOME}/lib).  From objdump output, it
> seems that this directory never makes it into the RPATH of either the
> installed libraries or the binary programs.  It also seems that the
> wrapper scripts intentionally remove those options while constructing
> the actual linking commands, although I am not certain I fully
> understand the meaning of the logs.
> 
> This raises several questions:
> 
> - Is my interpretation of the wrapper action correct (i.e., is it
>   removing such command line options)?

yes, it is.

> - Is there a means of configuring the wrappers so they will allow such
>   -rpath options to be used?

yes. You can say in your package Makefile:

BUILDLINK_PASSTHRU_RPATHDIRS+=    ${PREFIX}/${PKGHOME}/lib
LDFLAGS+= ${COMPILER_RPATH_FLAG}${PREFIX}/${PKGHOME}/lib

> - Is there some other solution to the problem of missing rpath
>   directories in the libraries and programs?

No, there isn't. buildlink is _the_ solution. :)

Roland