[Scons-users] Yet another newbie question
Paweł Tomulik
ptomulik at meil.pw.edu.pl
Fri Sep 1 17:11:09 EDT 2017
W dniu 01.09.2017 o 18:37, syost at triad.rr.com pisze:
> I have a problem with reverse domain dotted file naming and version shared libraries in Scons. So here it is - I have distilled the SConscript to its most basic and yet reproduce this problem. The following works great:
>
> Import('rootEnv', 'CFLAGS', 'CXXFLAGS', 'PREFIX')
> myVersion='1.1.1'
> env=rootEnv.Clone(CFLAGS=CFLAGS, CXXFLAGS=CXXFLAGS, PREFIX=PREFIX, SHLIBVERSION=myVersion)
> THISINCLUDES=[
> '/usr/include/boost']
> env.Append(CPPPATH=THISINCLUDES)
> env.SharedLibrary('deliverable', [ 'mycode.cpp'], )
> #env.SharedLibrary('com.domain.functionalarea.package.deliverable', [ 'mycode.cpp'], )
>
> However this does NOT work(note the different target name format):
>
> Import('rootEnv', 'CFLAGS', 'CXXFLAGS', 'PREFIX')
> myVersion='1.1.1'
> env=rootEnv.Clone(CFLAGS=CFLAGS, CXXFLAGS=CXXFLAGS, PREFIX=PREFIX, SHLIBVERSION=myVersion)
> THISINCLUDES=[
> '/usr/include/boost']
> env.Append(CPPPATH=THISINCLUDES)
> #env.SharedLibrary('deliverable', [ 'mycode.cpp'], )
> env.SharedLibrary('com.domain.functionalarea.package.deliverable', [ 'mycode.cpp'], )
>
> I get:
> scons: *** Multiple ways to build the same target were specified for: libcom.domain.functionalarea.package.deliverable
> File "/home/s0998egu/git/app-genesis/Remote/com/lowes/ss/utility/passdb/SConscript", line 7, in <module>
>
> I can reproduce this all day long with any variant of a dotted file name. Why can't I use dotted reverse domain dotted notation? I did browse the docs but did not find anything....
>
> Thanks in advance!!!
>
> Spencer
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
The following is minimal example, which reveals the problem you faced
env = Environment()
env.SharedLibrary('test.so', ['test.cpp'], SHLIBVERSION = '1.2')
But scons is right there IMHO, as it treats 'test.so' as the target
(library) name. Normally it would be 'test.so.1.2' and scons would
create symlink test.so -> test.so.1.2. In the above example, however,
test.so is a name for both - shared library and symlink.
There are at least two ways to overcome the problem:
env.SharedLibrary('test.so.1.2', ['test.cpp'], SHLIBVERSION = '1.2')
or
env.SharedLibrary('test.so', ['test.cpp'], SHLIBVERSION = '1.2',
SHLIBNOVERSIONSYMLINKS=True)
Your example is similar, I guess you should do something along lines:
env.SharedLibrary('com.domain.functionalarea.package.deliverable.so.$SHLIBVERSION',
[ 'mycode.cpp'], )
Best Regards!
--
Pawel Tomulik
More information about the Scons-users
mailing list