2019年7月7日 星期日

Using openembedded SDK to build protobuf-c


brook@vista:~/protobuf$ git clone git://github.com/google/protobuf.git
Cloning into 'protobuf'...
...

brook@vista:~/protobuf/protobuf$ git checkout 3.6.x
Branch 3.6.x set up to track remote branch 3.6.x from origin.
...

brook@vista:~/protobuf/protobuf$ . /opt/oecore-x86_64/environment-setup-cortexa7-neon-vfpv4-oe-linux-gnueabi


brook@vista:~/protobuf/protobuf$ vim configure.ac 
 export CFLAGS
 export CXXFLAGS
### remove below line ###
AC_CONFIG_SUBDIRS([third_party/googletest])

brook@vista:~/home6t/protobuf/protobuf$ ./autogen.sh
+ mkdir -p third_party/googletest/m4
+ autoreconf -f -i -Wall,no-obsolete
...

brook@vista:~/protobuf/protobuf$ ./configure ${CONFIGURE_FLAGS} --prefix=/home/brook/protobuf/
configure: loading site script /opt/oecore-x86_64/site-config-cortexa7-neon-vfpv4-oe-linux-gnueabi
checking whether to enable maintainer-specific portions of Makefiles... yes
checking build system type... x86_64-pc-linux-gnu
...

brook@vista:~/protobuf/protobuf$ make all -j 8
make  all-recursive
Making install in .
make[1]: Entering directory '/home/brook/protobuf/protobuf'
...

brook@vista:~/protobuf/protobuf$ make install
Making install in .
make[1]: Entering directory '/home/brook/protobuf/protobuf'
...


change "/home/brook/protobuf/lib/libprotoc.la"
from
# Libraries that this one depends upon.
dependency_libs=' =/home6t/brook/protobuf/lib/libprotobuf.la =/usr/lib/libstdc++.la'

to
# Libraries that this one depends upon.
dependency_libs=''


brook@vista:~$ mkdir protobuf-c
brook@vista:~$ cd protobuf-c
brook@vista:~/protobuf-c$ git clone git://github.com/protobuf-c/protobuf-c.git
Cloning into 'protobuf-c'...
remote: Enumerating objects: 59, done.
remote: Counting objects: 100% (59/59), done.
...

brook@vista:~/protobuf-c/protobuf-c$ ./autogen.sh
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
...

brook@vista:~/protobuf-c/protobuf-c$ PROTOC=/usr/bin/protoc-c protobuf_CFLAGS="-I/home/brook/protobuf/include" protobuf_LIBS="-L/home/brook/protobuf/lib" ./configure ${CONFIGURE_FLAGS} --prefix=/home/brook/protobuf-c
configure: loading site script /opt/oecore-x86_64/site-config-cortexa7-neon-vfpv4-oe-linux-gnueabi
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
...

brook@vista:~/protobuf-c/protobuf-c$ make -j 8
make  all-am
make[1]: Entering directory '/home/brook/protobuf-c/protobuf-c'
  CC       protobuf-c/protobuf-c.lo
...

1 則留言:

  1. build protobuf-c failed due to libprotoc.la is incorrect.
    change "/home/brook/protobuf/lib/libprotoc.la"
    from
    # Libraries that this one depends upon.
    dependency_libs=' =/home6t/brook/protobuf/lib/libprotobuf.la =/usr/lib/libstdc++.la'

    to
    # Libraries that this one depends upon.
    dependency_libs=' /home6t/brook/protobuf/lib/libprotobuf.la '

    回覆刪除

熱門文章