[Buildroot] New package protobuf

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Fri Mar 9 08:16:23 UTC 2012


Hello Simon,

Le Wed, 7 Mar 2012 21:14:13 +0000,
Simon Dawson <spdawson at gmail.com> a écrit :

> Thanks for your comments; re-worked patch attached below.

Please do not include "personal" comments before the "---", because
everything before "---" will end up as the commit log in the Git
history of Buildroot. So everything before "---" should be a nice
commit message, and should not contain any sort of discussion about the
patch. If you want to put some discussion about the patch, put it
between the --- delimiter and the beginning of the patch itself.

> Both a utility (/usr/bin/protoc, the protocol buffers compiler) and a
> set of libraries (/usr/lib/libproto*.so) are installed on the target.

My guess is that the protocol buffer compiler is useless on the target,
no? Normally, you would :

 * Write a protocol buffer description file

 * Generate some code from it, using protoc on the host

 * Compile your application (which includes the generated code) for the
   target

And the libraries, are they useful on the target? I.e, does the code
generated by protoc depends on the libraries? If so, you should set
PROTOBUF_INSTALL_STAGING = YES in your package.

Can you clarify a bit the usage of the compiler vs. the libraries?

> diff --git a/package/protobuf/protobuf.mk
> b/package/protobuf/protobuf.mk new file mode 100644
> index 0000000..f4d82cb
> --- /dev/null
> +++ b/package/protobuf/protobuf.mk
> @@ -0,0 +1,15 @@
> +#############################################################
> +#
> +# protobuf
> +#
> +#############################################################
> +PROTOBUF_VERSION := 2.4.1
> +PROTOBUF_SOURCE := protobuf-$(PROTOBUF_VERSION).tar.gz
> +PROTOBUF_SITE := http://protobuf.googlecode.com/files/
> +
> +# N.B. Need to use host protoc during cross compilation.
> +PROTOBUF_DEPENDENCIES := host-protobuf
> +PROTOBUF_CONF_OPT := --with-protoc=$(HOST_DIR)/usr/bin/protoc

Please use = instead of := everywhere.

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com



More information about the buildroot mailing list