diff options
author | lotodore <pokerth@lotharmay.de> | 2012-09-18 19:49:50 (GMT) |
---|---|---|
committer | lotodore <pokerth@lotharmay.de> | 2012-09-18 19:49:50 (GMT) |
commit | 4009fb35a91e9a3f03d01c8c9178d4ebea92fc1c (patch) | |
tree | 1692bd98dc87964746db364ea3e050342368d7e3 | |
parent | fe252299ec87a03cb8b04f67eb29922b66b95ded (diff) | |
download | mxe-4009fb35a91e9a3f03d01c8c9178d4ebea92fc1c.zip mxe-4009fb35a91e9a3f03d01c8c9178d4ebea92fc1c.tar.gz mxe-4009fb35a91e9a3f03d01c8c9178d4ebea92fc1c.tar.bz2 |
Add package protobuf (google protocol buffers).
-rw-r--r-- | index.html | 5 | ||||
-rw-r--r-- | src/protobuf-test.cpp | 9 | ||||
-rw-r--r-- | src/protobuf.mk | 39 |
3 files changed, 53 insertions, 0 deletions
@@ -1759,6 +1759,11 @@ USE_OSGPLUGIN(<plugin2>) <td id="proj-website"><a href="http://trac.osgeo.org/proj/">proj</a></td> </tr> <tr> + <td id="protobuf-package">protobuf</td> + <td id="protobuf-version">2.4.1</td> + <td id="protobuf-website"><a href="http://code.google.com/p/protobuf"/>protobuf</a></td> + </tr> + <tr> <td id="pthreads-package">pthreads</td> <td id="pthreads-version">2-9-1</td> <td id="pthreads-website"><a href="http://sourceware.org/pthreads-win32/">Pthreads-w32</a></td> diff --git a/src/protobuf-test.cpp b/src/protobuf-test.cpp new file mode 100644 index 0000000..2349ab7 --- /dev/null +++ b/src/protobuf-test.cpp @@ -0,0 +1,9 @@ +#include <google/protobuf/stubs/common.h> + +int +main() +{ + GOOGLE_PROTOBUF_VERIFY_VERSION; + google::protobuf::ShutdownProtobufLibrary(); + return 0; +} diff --git a/src/protobuf.mk b/src/protobuf.mk new file mode 100644 index 0000000..96f61a1 --- /dev/null +++ b/src/protobuf.mk @@ -0,0 +1,39 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := protobuf +$(PKG)_IGNORE := +$(PKG)_CHECKSUM := df5867e37a4b51fb69f53a8baf5b994938691d6d +$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) +$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.bz2 +$(PKG)_URL := http://protobuf.googlecode.com/files/$($(PKG)_FILE) +$(PKG)_DEPS := gcc zlib + +define $(PKG)_UPDATE + $(WGET) -q -O- 'http://code.google.com/p/protobuf/downloads/list?sort=-uploaded' | \ + $(SED) -n 's,.*protobuf-\([0-9][^<]*\)\.tar.*,\1,p' | \ + head -1 +endef + +define $(PKG)_BUILD +# First step: Build for host system in order to create "protoc" binary. + cd '$(1)' && ./configure \ + --disable-shared + $(MAKE) -C '$(1)' -j '$(JOBS)' + cp '$(1)/src/protoc' '$(1)/src/protoc_host' + $(MAKE) -C '$(1)' -j 1 distclean +# Second step: Build for target system. + cd '$(1)' && ./configure \ + --host='$(TARGET)' \ + --prefix='$(PREFIX)/$(TARGET)' \ + --disable-shared \ + --with-zlib \ + --with-protoc=src/protoc_host + $(MAKE) -C '$(1)' -j '$(JOBS)' + $(MAKE) -C '$(1)' -j 1 install + + '$(TARGET)-gcc' \ + -W -Wall -Werror -ansi -pedantic \ + '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-protobuf.exe' \ + `'$(TARGET)-pkg-config' protobuf --cflags --libs` +endef |