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-03-23 20:09:15 +00:00
|
|
|
$(PKG)_VERSION := 2.6.1
|
2016-06-03 19:06:03 +01:00
|
|
|
$(PKG)_CHECKSUM := dbbd7bdd2381633995404de65a945ff1a7610b0da14593051b4738c90c6dd164
|
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-06-03 19:06:03 +01:00
|
|
|
$(PKG)_URL := https://github.com/google/protobuf/releases/download/v$($(PKG)_VERSION)/$($(PKG)_FILE)
|
|
|
|
$(PKG)_DEPS := gcc zlib
|
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
|
|
|
|
# First step: Build for host system in order to create "protoc" binary.
|
2016-06-03 19:06:03 +01:00
|
|
|
cd '$(1)' && ./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
|