[Scons-users] Passing $ORIGIN through Variables from the command line?
Bill Deegan
bill at baddogconsulting.com
Wed Jan 21 18:13:22 EST 2015
Try: ${ORIGIN} ?
On Wed, Jan 21, 2015 at 2:16 PM, Andrew C. Morrow <andrew.c.morrow at gmail.com
> wrote:
>
> Given the following minimal SConstruct:
>
> print("ARGUMENTS: %r" % ARGUMENTS)
>
> def identity_converter(val):
> print(val)
> return val
>
> env_vars = Variables()
>
> env_vars.Add(
> 'SHLINKFLAGS',
> help='Sets flags for the linker when building shared libraries',
> converter=identity_converter)
>
> env = Environment(
> tools=[],
> variables=env_vars)
>
> print 'SHLINKFLAGS: %r' % env.get('SHLINKFLAGS', "<not set>")
>
> I can't see how to get env['SHLINKFLAGS'] to contain the string
> -Wl,-rpath=$ORIGIN/../lib from the command line:
>
> It works fine when invoked with a simple flag:
>
> > scons SHLINKFLAGS=-foo
>
> scons: Reading SConscript files ...
> ARGUMENTS: {'SHLINKFLAGS': '-foo'}
> -foo
> SHLINKFLAGS: '-foo'
> scons: done reading SConscript files.
> scons: Building targets ...
> scons: `.' is up to date.
> scons: done building targets.
>
>
> But the $ORIGIN seems to be eaten:
>
> > scons SHLINKFLAGS='-Wl,-rpath=$ORIGIN/../lib'
> scons: Reading SConscript files ...
> ARGUMENTS: {'SHLINKFLAGS': '-Wl,-rpath=$ORIGIN/../lib'}
> -Wl,-rpath=/../lib
> SHLINKFLAGS: '-Wl,-rpath=/../lib'
> scons: done reading SConscript files.
> scons: Building targets ...
> scons: `.' is up to date.
> scons: done building targets.
>
> Note that the $ORIGIN does exist in ARGUMENTS so this is not shell
> expansion eating $ORIGIN. Additionally, note that by the time the argument
> has been passed to the validator, the $ORIGIN has already disappeared.
>
> I've tried various forms of escaping like \$ORIGIN, etc, but without
> success.
>
> How can I pass a $ prefixed value through Variables on the command line?
>
> Thanks,
> Andrew
>
>
>
>
> _______________________________________________
> 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/20150121/6cd63aea/attachment.html>
More information about the Scons-users
mailing list