[Scons-users] Link program without build directory in link path?

Andrew C. Morrow andrew.c.morrow at gmail.com
Sat Aug 5 09:29:10 EDT 2017


If you set a SONAME (or install_name for Darwin) in libleaf_lang.so, then
that is what will be recorded in build/leaf, rather than the filesystem
path given on the link line. You can then use install rules to copy files
into your installation tree such that the names work. Note that you
probably want to consider using $ORIGIN (or @loader_path and friends on
Darwin) to make this work out in a relocatable fashion.

On Sat, Aug 5, 2017 at 5:19 AM, edA-qa mort-ora-y <eda-qa at disemia.com>
wrote:

> I'm using Program to build an executable and link several libraries
> created with SharedLibrary. The problem I'm having is that the resulting
> executable has the build directory as part of the link path, thus if I move
> the files somewhere else they fail to work.
>
> I have a build directory where I output files, so the gcc command ends up
> looking something like this:
>
> 	g++ -o build/leaf build/bin/leaf.o build/libleaf_lang.so
>
> If I run ldd on the resulting build/leaf file I get this link:
>
> 	build/libleaf_lang.so (0x00007fdee8711000)
>
> It has linked to the shared library in the build directory, which is not
> what I want. I want it referenced without path so I can install these files
> elsewhere. That is, I just want a link to libleaf_lang.so without the
> build/ part.
>
> Note: I don't specify build in my Program/SharedLibray commands, this is
> done using a VariantDir directive.
>
> --
> edA-qa mort-ora-y http://mortoray.com/
>
> Leaf - the language we always wantedhttp://leaflang.org/
>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20170805/c1861afe/attachment.html>


More information about the Scons-users mailing list