[Scons-users] Import library in lib subdirectory
    Bill Deegan 
    bill at baddogconsulting.com
       
    Wed Dec 26 13:47:48 EST 2012
    
    
  
On Wed, Dec 26, 2012 at 8:05 AM, LRN <lrn1986 at gmail.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> 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'...
Or
foo = env.SharedLibrary (target = "foo", source = ["foo.c"],SHLIBPREFIX =
'lib', LIBSUFFIX='.dll.a')
if destdir:
  destprefix = destdir + prefix
  env.Install (os.path.join (destprefix, 'lib'), [foo])
  env.Alias('install', destprefix)
Or:
if destdir:
  destprefix = destdir + prefix
  path = os.path.join (destprefix, 'lib','foo')
  foo = env.SharedLibrary (target = path, source = ["foo.c"],SHLIBPREFIX =
'lib', LIBSUFFIX='.dll.a')
  env.Alias('install', foo)
else:
   foo = env.SharedLibrary (target = "foo", source = ["foo.c"],SHLIBPREFIX
= 'lib', LIBSUFFIX='.dll.a')
-Bill
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20121226/35ad6e3f/attachment.html>
    
    
More information about the Scons-users
mailing list