[Scons-users] Shared library in bin subdirectory
    William Deegan 
    bill at baddogconsulting.com
       
    Thu Dec 27 13:18:58 EST 2012
    
    
  
LRN,
On Dec 27, 2012, at 12:28 AM, LRN  wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 26.12.2012 22:47, Bill Deegan wrote:
>> On Wed, Dec 26, 2012 at 8:05 AM, LRN wrote:
>> 
>>> Here's what i do:
>>> 
>>> prefix = ARGUMENTS.get ('prefix', None) destdir = ARGUMENTS.get
>>> ('destdir', None) if prefix == None: prefix = '/usr/local'
>>> 
>>> foo = env.SharedLibrary (target = "foo", source = ["foo.c"], 
>>> SHLIBPREFIX = 'lib', LIBSUFFIX='.dll.a') if destdir is not None: 
>>> destprefix = destdir + prefix env.Install (os.path.join
>>> (destprefix, 'bin'), [foo]) env.Alias('install', destprefix)
>>> 
>>> And when i do `scons prefix=/ destdir=c:/bar install', i end up
>>> having libfoo.dll.a import library in c:/bar/bin/ directory
>>> instead of c:/bar/lib. How do i make SharedLibrary or Install put
>>> the import library into /lib subdirectory?
>>> 
>> 
>> Here's your problem: env.Install (os.path.join (destprefix, 'bin'),
>> [foo])
>> 
>> Change 'bin' to 'lib'...
> Thank you for your quick response.
> 
> I've tried that, and it works - libfoo.dll.a is installed into /lib
> subdir!
> 
> However, a completely unrelated problem has cropped up:
> Now when i do `scons prefix=/ destdir=c:/bar install', i end up having
> libfoo.dll shared library in c:/bar/lib/ directory instead of
> c:/bar/bin. How do i make SharedLibrary or Install put the shared
> library into /bin subdirectory?
> 
Any builder only specifies 1 target dir. If you want to have the output(s) go to more than one, then you'll have to use env.Install() to do so.
-Bill
    
    
More information about the Scons-users
mailing list