Ben Pfaff <[email protected]> writes:

> From: 竹內宏輝 Hiroki Takeuchi <[email protected]>
>
> Submitted-at: https://github.com/openvswitch/ovs/pull/270
> Signed-off-by: Hiroki Takeuchi <[email protected]>
> ---
> I'm sending this patch as a squashed version of what was submitted at
> Github.  I know that pkg-config is somewhat controversial, so I'd like to
> hear what the denizens of ovs-dev have to say about including a libovn.pc.

I like pkg-config, as a general rule.  I wasn't aware that it was
controversial, but I'm definitely not plugged into the latest trends in
library development.

> Thanks,
>
> Ben.
>
>  configure.ac         |  1 +
>  ovn/lib/automake.mk  |  3 +++
>  ovn/lib/libovn.pc.in | 11 +++++++++++
>  3 files changed, 15 insertions(+)
>  create mode 100644 ovn/lib/libovn.pc.in
>
> diff --git a/configure.ac b/configure.ac
> index 505e3d041e93..473454265532 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -201,6 +201,7 @@ AC_CONFIG_FILES(lib/libopenvswitch.pc)
>  AC_CONFIG_FILES(lib/libsflow.pc)
>  AC_CONFIG_FILES(ofproto/libofproto.pc)
>  AC_CONFIG_FILES(ovsdb/libovsdb.pc)
> +AC_CONFIG_FILES(ovn/lib/libovn.pc)
>  AC_CONFIG_FILES(include/openvswitch/version.h)
>  
>  dnl This makes sure that include/openflow gets created in the build 
> directory.
> diff --git a/ovn/lib/automake.mk b/ovn/lib/automake.mk
> index 6178fc2d5aa4..cb216f626293 100644
> --- a/ovn/lib/automake.mk
> +++ b/ovn/lib/automake.mk
> @@ -24,6 +24,9 @@ nodist_ovn_lib_libovn_la_SOURCES = \
>       ovn/lib/ovn-sb-idl.c \
>       ovn/lib/ovn-sb-idl.h
>  
> +pkgconfig_DATA += \
> +     ovn/lib/libovn.pc

Is it intended that the OVN library will be used by anything other than
OVN?
If so, it's probably also good to enhance the ABI version
information to work similarly to the way the openvswitch library is
versioned.
If not, maybe it's not a good idea to have a pkg-config
entry for the library (since it would encourage non-ovn utilities to
link to it without any kind of ABI contract).

I don't have any idea whether it would be useful to provide access to
the OVN library to other projects.

> +
>  # ovn-sb IDL
>  OVSIDL_BUILT += \
>       ovn/lib/ovn-sb-idl.c \
> diff --git a/ovn/lib/libovn.pc.in b/ovn/lib/libovn.pc.in
> new file mode 100644
> index 000000000000..6d9b22be6568
> --- /dev/null
> +++ b/ovn/lib/libovn.pc.in
> @@ -0,0 +1,11 @@
> +prefix=@prefix@
> +exec_prefix=@exec_prefix@
> +libdir=@libdir@
> +includedir=@includedir@
> +
> +Name: libovn
> +Description: Open Virtual Network for Open vSwitch

I think the Description here should include the word 'library' - but
it's just a nit.

> +Version: @VERSION@
> +Libs: -L${libdir} -lovn
> +Libs.private: @LIBS@
> +Cflags: -I${includedir}/ovn

I believe this file should also have a Requires: stanza for
libopenvswitch (since any application linking to the ovn library will
need to link to the openvswitch library as well).

At the moment, it could be very restrictive:

  Requires: libopenvswitch = @VERSION@

But it will probably need to be relaxed in the future (to some minimum
version).  I admit I don't know enough about the ovn library to make an
informed suggestion here.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to