[Scons-users] Does not copy/link my file target/lib when needed?

edA-qa mort-ora-y eda-qa at disemia.com
Sat Jan 27 16:43:35 EST 2018


The library is built as part of an external build process (LLVM build
scripts). I specify the directory to it as part of my scons variables.

The reason to link it (or copy would be fine), is because I need the
linker to create a relative RPATH to the library (there are no flags to
configure this on Linux/OSX linkers other than just putting the library
beside the other libraries/EXEs).

I could possibly remove it from the Check step and do my own checking. 
Originally I wasn't concerned about RPATH, thus it was setup
differently.  I'm not sure why putting in it the check though prevents
the other step from updating it.


On 27/01/18 22:00, Bill Deegan wrote:
> Configure contexts are usually evaluated first.
>
> Why are you doing this?
>
> If you're building the library, it's not clear why you need to have
> Configure check if the library exists...
> Is there some strange possibility that the library you build cannot be
> linked against?
>
> -Bill
>
> On Sat, Jan 27, 2018 at 12:36 AM, edA-qa mort-ora-y
> <eda-qa at disemia.com <mailto:eda-qa at disemia.com>> wrote:
>
>     I'm trying to get a library file linked in a variant_dir before the
>     configuration is complete (this is in order to get the rpath
>     references
>     correct). It links the file once, but it does not copy it again if the
>     destination is deleted.
>
>     My SConstruct
>
>             baseEnv = Environment(
>                 BUILD_DIR='build'
>                 )
>             Export('baseEnv')
>             baseEnv.SConscript('src/SConscript',
>     variant_dir=baseEnv['BUILD_DIR'], duplicate=0)
>             Default(baseEnv['BUILD_DIR'])
>
>
>     My src/SConscript
>
>         import os
>
>         Import('baseEnv')
>
>         def SymLink():
>             def Impl(target, source, env):
>                 print( "SymLink" )
>                 os.symlink(os.path.abspath(str(source[0])),
>     os.path.abspath(str(target[0])))
>                 return 0
>
>             return Action(Impl, "linking file to $TARGET from $SOURCE" )
>
>
>         env = baseEnv.Clone()
>         env.Append( LIBPATH = './' )
>
>         lib_some = 'some'
>         lib_some_ref = 'libsome.so'
>
>         env.Command( lib_some_ref, '../lib/' + lib_some_ref, SymLink() )
>
>         conf = Configure(env)
>         conf.CheckLib( lib_some )
>         env = conf.Finish()
>
>     You can place any shared library into lib/libsome.so to test. I'm
>     testing on Linux at the moment.
>
>     I've tried env.Requires( '.', ... ) with the Command as well, but
>     no luck.
>
>     It also doesn't appear to be an issue with the Symlink action since a
>     Copy action has the same problem:
>
>     env.Command( lib_some_ref, '../lib/' + lib_some_ref,
>     Copy("$TARGET","$SOURCE")
>
>     --
>     edA-qa mort-ora-y
>     http://mortoray.com/
>
>     Leaf - the language we always wanted
>     http://leaflang.org/
>
>     _______________________________________________
>     Scons-users mailing list
>     Scons-users at scons.org <mailto:Scons-users at scons.org>
>     https://pairlist4.pair.net/mailman/listinfo/scons-users
>     <https://pairlist4.pair.net/mailman/listinfo/scons-users>
>
>
>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users


-- 
edA-qa mort-ora-y 
http://mortoray.com/

Leaf - the language we always wanted
http://leaflang.org/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20180127/24dd52fd/attachment-0001.html>


More information about the Scons-users mailing list