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

Bill Deegan bill at baddogconsulting.com
Sat Jan 27 16:00:02 EST 2018


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>
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
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20180127/26f3ce36/attachment.html>


More information about the Scons-users mailing list