gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] scons quirks


From: Greg Troxel
Subject: Re: [gpsd-dev] scons quirks
Date: Fri, 29 Nov 2013 18:21:53 -0500
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/23.4 (berkeley-unix)

Hal Murray <address@hidden> writes:

address@hidden: I am being a little redundant about things I know you
understand to make this make sense to more people]

>> What should I type to build things without any RPATH cruft?  He's packaging
>> things for a distro so the libraries will get installed in /usr/lib rather
>> than /usr/local/lib so there is no need for RPATH. 
>
> Apologies if my message appeared snarky, but I wasn't smart enough to see the 
> big picture before I hit send.
>
> I think there are three cases:
>   build for testing/development
>   install the current stuff
>   build for packaging
>
> "scons" does the first.  "scons install" does the the second.  It
> copies over the current stuff and then uses chrpath to fixup the RPATH
> stuff to point to where it will (or did) install the libraries.
>
> I don't know what to type to get the third case.  I want the local 
> executables and libraries to have the right RPATH stuff so I can copy them 
> over into the the packaging file (rpm, whatever...)

For the third case, it depends on the packaging system.  Typically, one
installs into a DESTDIR, but with RPATH set as it should be when the
package is actually installed.  In pkgsrc, this all happens w/o root.

> scons is setup with a default of /usr/local  That needs an RPATH (or 
> something?) to get the libraries from /usr/local/lib rather than /usr/lib

People should be careful not to blur the concepts of PREFIX and DESTDIR.

Whethr RPATH should be set depends on a lot of policy beyond the control
of gpsd.  The broad norm is that any binary or library linking against a
library which is not in /lib or /usr/lib (or some architecture-suffixed
version, for those systems using that convention) will need RPATH.

Debian seems to prohibit RPATH, and it's not clear to me if it's just
RPATH to /usr/lib that is considered spurious, or if RPATH to some
/usr/foo/4.5/site/lib library is also prohibited.

> Miroslav wants to install in /usr which doesn't need any RPATH.  The current 
> scons install leaves a RPATH of /usr/lib rather than deleting it.

And there's really nothing harmful about a spurious /usr/lib RPATH,
other than policy.  Or if so someone should explain.


> The current scons also mangles the RPATH in the local executables if you 
> specify a DESTDIR.  I don't think that makes sense.  When it's installing 
> things, it copies and then chrpaths the copied vesion.  Why should it change 
> (break?) the local stuff before the copy?

Two separate things: DESTDIR and munging.

First, DESTDIR means that one should install what would have gone in
${PREFIX}/bin/foo instead into ${DESTDIR}/${PREFIX}/bin/foo, but exactly
as it would have been.  Thus one should be able to tar up in ${DESTDIR}
and unpack in / and everything should be ok.  This is the modern norm in
package building, so that one does not have to modify the running system
to produce a package.   DESTDIR should only matter on install.

Second, it makes sense to have RPATH in the ${OBJDIR} binaries pointing
to libs in ${OBJDIR}, so that one can run the built-not-installed
binaries for testing, with the right libs.  I don't think it makes sense
to modify the ${OBJDIR} copies when doing the install, just to have the
installed versions change.  But a rule that as-built tests only work
pre-install does not seem too practically onerous.

Attachment: pgpwdOVcOFtfX.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]