On 7/27/22 17:19, David Marchand wrote:
> On Mon, Jul 25, 2022 at 2:20 PM Ilya Maximets <[email protected]> wrote:
>>
>> SSL, BPF, lcap-ng and other libraries are in use by a static library,
>> so they has to be linked while building applications with that static
>> library, i.e. 'pkg-config --libs --static libopenvswitch' must return
>> -lssl, -lcap-ng, etc. in the output for a successful build.
>>
>> For dynamic library (non-private Libs) all these libraries will be
>> dynamically linked to libopenvswitch.so, so the application will
>> pick them up without having a direct dependency.
>>
>> Additionally, fixed the include directory, it should be just
>> /usr/include, because application will include headers specifying
>> the 'openvswitch' folder, e.g. #include <openvswitch/json.h>.
>> And we have not only 'openvswitch', but also 'openflow' folder that
>> users should be able to include.
> 
> Is this comment still necessary for this patch?
> The related changes seems to be in patch 1.

Yeah, I created patch #1 after I wrote this one and realized that
it's not the only required change.  I will drop this section of
the commit message before applying the patch, if the new version
is not necessary otherwise.  Thanks!

> 
>>
>> Signed-off-by: Ilya Maximets <[email protected]>
>> ---
>>  lib/libopenvswitch.pc.in | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lib/libopenvswitch.pc.in b/lib/libopenvswitch.pc.in
>> index 4c40a4caf..44fbb1f9f 100644
>> --- a/lib/libopenvswitch.pc.in
>> +++ b/lib/libopenvswitch.pc.in
>> @@ -7,5 +7,5 @@ Name: libopenvswitch
>>  Description: Open vSwitch library
>>  Version: @VERSION@
>>  Libs: -L${libdir} -lopenvswitch
>> -Libs.private: @LIBS@
>> +Libs.private: @LIBS@ @SSL_LIBS@ @CAPNG_LDADD@ @LIBBPF_LDADD@
> 
> Sorry, if this is stupid, I am not sure how this works.

There is a following line in configure.ac:

AC_CONFIG_FILES(lib/libopenvswitch.pc)

It means that ./configure script will construct the lib/libopenvswitch.pc
from lib/libopenvswitch.pc.in by substitution of all config-time
variables known to ./configure script with their determined values.

/me also learned that trick only while working on this patch set.

> What of the libopenvswitchavx512.a static library?

This one is not meant to be ever exposed and it doesn't really contain
any code that is needed outside of ovs-vswitchd binary, so we don't
really need to expose it in any way...  I hope.

According to _LDADD/_LDFLAGS variables, other exposed libs don't have
dependencies outside of common LIBS.   I'm not 100% sure that is correct,
but that is what we have right now.  And it will require a separate fix
if we actually need to fix them.

Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to