[Scons-users] SCons Errors and build approach

Bill Deegan bill at baddogconsulting.com
Fri Jun 27 17:51:11 EDT 2014


Ronex,

I think you need to go read the users guide and man page
http://scons.org/doc/production/HTML/scons-user.html
http://scons.org/doc/production/HTML/scons-man.html

Specifically:
http://scons.org/doc/production/HTML/scons-user.html#chap-hierarchical

Also pastebin your SConstruct and SConscripts and/or point us at a public
repository would help.
You also need to let us know which compilers and platform you are using.

For Question 1 - All you need to do is  specify the library name and path
to it and SCons will figure out the proper order. There is no need to pass
Node objects around to specify the dependencies.

-Bill


On Fri, Jun 27, 2014 at 1:04 PM, Ronex Dicapriyo <ronex_89 at yahoo.in> wrote:

> Hello,
>
> Please help me with the following queries:
>
> 1)
>     Is it possible to call SConscript from another SConscript ?
>     I noticed that it raises an error message as below when I tried to do
> this:
>         scons: *** Invalid SConscript usage - no parameters
>
>     Suppose I have following directory structure:
>         root_dir
>             |_ SConstruct
>             |_ module_1
>                |_ SConscript
>             |_ module_2
>               |_ SConscript
>
>     Here module_1's library is dependent on module_2's library. So when
> SConstruct calls the SConscript of module_1 from module_1, I first want to
> calls the SConscript of module_2 with library target.
>
>     What is scons way to handle such interdependency ?
>
>     My SConstrcut accepts the command line argumetn of the module to e
> build say if scons -Q --module=module_1 then it calls SConscript of
> module_1. For this depency I have used python's subprocess in module_1 to
> execute scons -Q --module=module_2 and then build module_1's library.
> Rather then subprocess it could me much better if I can use SConscript
> function so that I can also export environment specif to one module to
> other dependent module.
>
>     But I am not sure whether is the right way to handle such depencies ?
> I have tried to depict the scenario in brief,m there are 30 to 40 modules
> having some inetrdependencies on one or more then one modules.
>
> 2)
>     On windows when I tried to build shared library from static libraries
> it generated following error message:
>
>     libxyz.a is static and is not compatible with shared target libpqr.dll
>     I have used -fPIC option in CPPFLAGS variable, But it still raises the same error.
>
>     I tried following two approaches:
>     2.a)
>
>  env.Append(CPPFLAGS=['-fPIC'])
>         env.SharedLibrary(target = 'pqr', source=src_files, LIBS=['libxyz.a', 'libabc.a'] LIBPATH=[<path_of_xyz>, <path_of_abc>])
>    This results in error message mentioned above.
>
>     2.b)
>
>         env.Append(CPPFLAGS=['-fPIC']) src_file = Glob('*.cpp')
>         obj_files =
>  [os.path.splitext(file) for file in src_list]
>         env.SharedObject(target=obj_files, source=src_files, CPPPATH='include')
>         env.SharedLibrary(target='pqr', source=obj_files)
>
>    But this generates an error message: AttributeError: 'File' object has no attribute 'rfind'
>         So on windows what all flags and options are required to build shared library properly. How above erros can be fixed ?
>
> 3)
>     How to export multiple environmet variables or other spcefic variables from SConscript ?
>     Alternatiely What are all possible different syntax to export variables ?
>
>      i.e,
>            env = Environment()
>            envDbg = env.Clone(CPPFLAGS = ['-g', '-O0'])
>            lib_list = [lib1.a, lib2.a, lib3.a]
>            SConscript(name ..., export = {env='env', 'envDbg', lib_list})  ---> what is proper way to export ?
>
>
> Regards,
> Ronex
>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> http://four.pairlist.net/mailman/listinfo/scons-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20140627/411cf121/attachment-0001.html>


More information about the Scons-users mailing list