comparison src/protobuf.mk @ 2746:a69eb5b6d9a5

Add package protobuf (google protocol buffers).
author lotodore <pokerth@lotharmay.de>
date Tue, 18 Sep 2012 21:49:50 +0200
parents
children 30b0ab7e6406
comparison
equal deleted inserted replaced
2745:8fbf0cc2ca6f 2746:a69eb5b6d9a5
1 # This file is part of MXE.
2 # See index.html for further information.
3
4 PKG := protobuf
5 $(PKG)_IGNORE :=
6 $(PKG)_CHECKSUM := df5867e37a4b51fb69f53a8baf5b994938691d6d
7 $(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
8 $(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.bz2
9 $(PKG)_URL := http://protobuf.googlecode.com/files/$($(PKG)_FILE)
10 $(PKG)_DEPS := gcc zlib
11
12 define $(PKG)_UPDATE
13 $(WGET) -q -O- 'http://code.google.com/p/protobuf/downloads/list?sort=-uploaded' | \
14 $(SED) -n 's,.*protobuf-\([0-9][^<]*\)\.tar.*,\1,p' | \
15 head -1
16 endef
17
18 define $(PKG)_BUILD
19 # First step: Build for host system in order to create "protoc" binary.
20 cd '$(1)' && ./configure \
21 --disable-shared
22 $(MAKE) -C '$(1)' -j '$(JOBS)'
23 cp '$(1)/src/protoc' '$(1)/src/protoc_host'
24 $(MAKE) -C '$(1)' -j 1 distclean
25 # Second step: Build for target system.
26 cd '$(1)' && ./configure \
27 --host='$(TARGET)' \
28 --prefix='$(PREFIX)/$(TARGET)' \
29 --disable-shared \
30 --with-zlib \
31 --with-protoc=src/protoc_host
32 $(MAKE) -C '$(1)' -j '$(JOBS)'
33 $(MAKE) -C '$(1)' -j 1 install
34
35 '$(TARGET)-gcc' \
36 -W -Wall -Werror -ansi -pedantic \
37 '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-protobuf.exe' \
38 `'$(TARGET)-pkg-config' protobuf --cflags --libs`
39 endef