2016-08-22 20:52:34 +01:00
|
|
|
# This file is part of MXE. See LICENSE.md for licensing information.
|
2012-09-18 20:49:50 +01:00
|
|
|
|
|
|
|
PKG := protobuf
|
|
|
|
$(PKG)_IGNORE :=
|
2016-10-23 04:24:54 +01:00
|
|
|
$(PKG)_VERSION := 3.1.0
|
|
|
|
$(PKG)_CHECKSUM := 0a0ae63cbffc274efb573bdde9a253e3f32e458c41261df51c5dbc5ad541e8f7
|
2012-09-18 20:49:50 +01:00
|
|
|
$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
|
2016-03-23 20:09:15 +00:00
|
|
|
$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz
|
2016-10-23 03:41:49 +01:00
|
|
|
$(PKG)_URL := https://github.com/google/$(PKG)/archive/v$($(PKG)_VERSION).tar.gz
|
2016-10-23 04:24:54 +01:00
|
|
|
$(PKG)_DEPS := gcc zlib googlemock googletest
|
2012-09-18 20:49:50 +01:00
|
|
|
|
|
|
|
define $(PKG)_UPDATE
|
2016-03-23 20:09:15 +00:00
|
|
|
$(call MXE_GET_GITHUB_TAGS, google/protobuf, v)
|
2012-09-18 20:49:50 +01:00
|
|
|
endef
|
|
|
|
|
|
|
|
define $(PKG)_BUILD
|
2016-10-23 04:24:54 +01:00
|
|
|
# Zero step: put googlemock and googletest to the source directory.
|
|
|
|
$(call PREPARE_PKG_SOURCE,googlemock,$(1))
|
|
|
|
cd '$(1)' && mv '$(googlemock_SUBDIR)' gmock
|
2016-10-23 03:41:49 +01:00
|
|
|
$(call PREPARE_PKG_SOURCE,googletest,$(1))
|
2016-10-23 04:24:54 +01:00
|
|
|
cd '$(1)' && mv '$(googletest_SUBDIR)' gmock/gtest
|
2012-09-18 20:49:50 +01:00
|
|
|
# First step: Build for host system in order to create "protoc" binary.
|
2016-10-23 03:41:49 +01:00
|
|
|
cd '$(1)' && ./autogen.sh && ./configure \
|
2012-09-18 20:49:50 +01:00
|
|
|
--disable-shared
|
|
|
|
$(MAKE) -C '$(1)' -j '$(JOBS)'
|
2015-09-27 17:06:24 +01:00
|
|
|
cp '$(1)/src/protoc' '$(PREFIX)/bin/$(TARGET)-protoc'
|
2012-09-18 20:49:50 +01:00
|
|
|
$(MAKE) -C '$(1)' -j 1 distclean
|
|
|
|
# Second step: Build for target system.
|
|
|
|
cd '$(1)' && ./configure \
|
2014-02-10 05:33:26 +00:00
|
|
|
$(MXE_CONFIGURE_OPTS) \
|
2012-09-18 20:49:50 +01:00
|
|
|
--with-zlib \
|
2015-09-27 17:06:24 +01:00
|
|
|
--with-protoc='$(PREFIX)/bin/$(TARGET)-protoc'
|
2012-09-18 20:49:50 +01:00
|
|
|
$(MAKE) -C '$(1)' -j '$(JOBS)'
|
|
|
|
$(MAKE) -C '$(1)' -j 1 install
|
|
|
|
|
2012-09-18 21:37:42 +01:00
|
|
|
'$(TARGET)-g++' \
|
2012-09-18 20:49:50 +01:00
|
|
|
-W -Wall -Werror -ansi -pedantic \
|
2016-07-30 20:14:38 +01:00
|
|
|
'$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-protobuf.exe' \
|
2012-09-18 20:49:50 +01:00
|
|
|
`'$(TARGET)-pkg-config' protobuf --cflags --libs`
|
|
|
|
endef
|