[Scons-users] Pholat's question about setting up for cross compile.. (parts #2 and #3)

Bill Deegan bill at baddogconsulting.com
Tue May 31 11:46:02 EDT 2016


Adam,

Really you'd be better breaking this into 3 emails one for each issue.
Addressing #2 and #3:
You can explicitly tell SCons which tools to initialize when you create
your Environment() via the tools parameter.
(Take a look at the manpage
http://scons.org/doc/production/HTML/scons-man.html)
You may want to do:
env=Environment(tools=[])
And then add the path to your various tools via:

env.PrependENVPath('PATH', path_to_tools)

env.Tool('the tool you want to load')
...

What you're doing on windows is allowing the default tools to be loaded,
which looks like it's loading MSVC when that's not what you want.

So by configuring the Enviroment() with no tools, or with just the tools
you want you should be in a better starting position.
Note that you'll likely need to load linker (gnulink) and other tools
besides just gcc to build your code.

-Bill

On Tue, May 31, 2016 at 12:48 AM, pholat <pholat at gmail.com> wrote:

> Hi All,
>
> I'm pholat and recently rewrote half of our Build system to SCons (
> compilation part) and would love to share few notices and ask some
> questions.
>
> 1) Depends(..) from empty object
>
> http://stackoverflow.com/questions/37477440/scons-dependencies-in-sconstruct?noredirect=1#comment62560274_37477440
> When user adds depends manually there is no warning or error on empty
> dependency. I find it misleading.
> pseudo code example
>
> SConcritpt:
> a = SConstruct(<SConstruct1 path>)
> b = SConstruct(<SConstruct2 path>)
> Depends(a,b) # SConstruct1 doesn't return a thing, no warning/error here
>
> SConstruct1:
> #empty
>
> SConstruct2:
> env = Environment(...)
> wal = env.Program(...)
> Return('wal')
>
> end of example
>
> As in buildsystem I edited&developed I had at least 20 SConscripts where
> dependencies are added in for loop. I'm still a bit confused:
> When install path from SConscript1 will be added to LIBPATH in SConscript2
> will dependencies be solved right? Even so, what with custom actions in
> functions which are executed with Builder(..) ( like from the example:
> http://scons.org/doc/0.97/HTML/scons-user/x2435.html ) Where parts of
> libraries are removed, where object name stays the same, only smaller.
>
> 2) Environment tool selection
> I'm using SCons with RVDS4 with addons. That's why Tool needed
> customizing, as it's close to g++ there were not too many issues on Linux,
> but on Windows platform it was more problematic. I mostly did that with
> Env['element'] substitution, but is there a way to force g++ behavior when
> Environment(...) is created and Windows path is added?
>
> 3) Windows tool substitution - '/OUT' string and file prefix '@'
> While linking on windows '/OUT' is hard coded in SCons. I found it rather
> frustrating. I do not want to modify SCons for our project - as it has to
> work 'out of the box'. Do you guys know kind of nice hack to modify this
> execution?
> Also on Windows there is automatic file export when terminal character
> limit is expected. It probably works great, but my compiler uses
> --via='filename' syntax which is why without modifying SCons sources I had
> to create temporary files on my own. SCons on windows uses @ prefix. Due to
> our compiler limitations I've to use temporary files on Linux too though.
>
> If any of that from point 2 or 3 is something which could be further
> developed or changed I can pass files and line numbers and my SCons version
> where my concerns are located. I could develop something too, although I've
> very limited time and thus it would take a bit. Please feel free to correct
> me if I'm wrong somewhere &/ ask if I let something not clear.
>
> Final notice: it was easier to me to create SCons environment for cross
> compilation with RVDS4 in SCons than with CMake and I find it really handy
> that I could script some stuff in python in that.
>
> Best regards,
> Adam A. Dobrowolski || pholat
>
> _______________________________________________
> 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/20160531/3555f536/attachment.html>


More information about the Scons-users mailing list