How to add an external library dependency into

nagendra ps nagendra.shiv at
Fri Oct 21 14:42:30 UTC 2016

Hi All,


I am using samba-4.5 and am trying to link an external library (say into .

Here is what I am doing :

The location of the library is taken care by the -L option by the
global LDFLAGS passed to waf.
I then modified samba-4.5/source3/wscript_build file under section :
bld.SAMBA3_LIBRARY('smbd_base) . Under 'deps', added my external
library 'externlib' .

Adding to the deps section did not suffice. It failed during configure
stage saying "Unknown dependency Mylib in smbd_base."

So I tried adding a target_type under 'def configure' section . I
tried both "conf.SET_TARGET_TYPE('MyLib', 'SYSLIB')" and
"conf.SET_TARGET_TYPE('MyLib', 'EMPTY').
Adding either one of the above targets makes the "Unknown dependency"
issue go away.
But, the MyLib itself is not getting added to the dependency list. At
the linking stage, it fails. i.e I dont find -lMyLib among the list of
deps seen in the 'runner' output.
The MyLib dependency I added is getting left out somewhere along the build.

I tried running waf with -vvv. Didnt get any clues from the additional logs.

Is there anything I am missing. Please let me know.

It used to be a bit easier when we used the Makefiles and configure
scripts in samba-3 based.

I am still getting used to the wscript and waf way of doing things now :-)


More information about the samba-technical mailing list