Passing -Wl, -rpath, /some/dir/where/shared/libs/hide to a module build

Ralph Böhme rb at sernet.de
Thu Apr 16 05:12:22 MDT 2015


On Tue, Apr 14, 2015 at 10:04:22AM -0700, Richard Sharpe wrote:
> Hi folks,
> 
> When building a Samba VFS module that needs to link against some
> shared-libs that hide in interesting places it looks like I would need
> to do something like:
> 
>    bld.SAMBA3_MODULE('some-module', ..., cflags='-Wl,-rpath,/hiding/place', ...)
> 
> Is that correct or is there a better way of doing it?

write a proper waf check for the lib that uses conf.check_cfg and
uselib_store. You then can simply add the libs as deps to your target.

The conf.check_cfg must of course provide the proper LDFLAGS including
the rpath.

Alternatively you can setup the environment variables manually like this:

    if Options.options.libcephfs_dir:
        conf.env['CPPPATH_CEPHFS'] = Options.options.libcephfs_dir + '/include'
        conf.env['LIBPATH_CEPHFS'] = Options.options.libcephfs_dir + '/lib'

Ymmv! ;)

-Ralph

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de,mailto:kontakt@sernet.de


More information about the samba-technical mailing list