package/rpi-userland: don't install file in random location
[buildroot-gz.git] / package / thrift / thrift.mk
blob185e1ec1c3a6f6944b26e7effc2759bb26f4c0bd
1 ################################################################################
3 # thrift
5 ################################################################################
7 THRIFT_VERSION = 0.9.2
8 THRIFT_SITE = http://www.us.apache.org/dist/thrift/$(THRIFT_VERSION)
9 THRIFT_DEPENDENCIES = host-autoconf-archive host-pkgconf host-thrift boost \
10 libevent openssl zlib
11 THRIFT_INSTALL_STAGING = YES
12 HOST_THRIFT_DEPENDENCIES = host-autoconf-archive host-bison host-boost \
13 host-flex host-libevent host-openssl host-pkgconf host-zlib
15 THRIFT_CONF_OPTS = --with-sysroot=$(STAGING_DIR) \
16 --with-boost \
17 --with-boost-libdir=$(STAGING_DIR)/usr/lib \
18 --disable-tests \
19 --disable-tutorial
20 HOST_THRIFT_CONF_OPTS = --with-sysroot=$(HOST_DIR) \
21 --disable-tests \
22 --disable-tutorial
23 THRIFT_AUTORECONF = YES
24 THRIFT_AUTORECONF_OPTS = -I $(HOST_DIR)/usr/share/autoconf-archive
25 THRIFT_LICENSE = Apache-2.0
26 THRIFT_LICENSE_FILES = LICENSE
28 # relocation truncated to fit: R_68K_GOT16O
29 ifeq ($(BR2_m68k_cf),y)
30 THRIFT_CONF_ENV += CXXFLAGS="$(TARGET_CXXFLAGS) -mxgot"
31 endif
33 ifeq ($(BR2_STATIC_LIBS),y)
34 # openssl uses zlib, so we need to explicitly link with it when static
35 THRIFT_CONF_ENV += LIBS=-lz
36 endif
38 # Language selection
39 # The generator (host tool) works with all of them regardless
40 # This is just for the libraries / bindings
41 THRIFT_LANG_CONF_OPTS += --without-csharp --without-java --without-erlang \
42 --without-python --without-perl --without-php --without-php_extension \
43 --without-ruby --without-haskell --without-go --without-d \
44 --without-qt4 --without-lua
45 HOST_THRIFT_CONF_OPTS += $(THRIFT_LANG_CONF_OPTS) --without-c_glib
46 THRIFT_CONF_OPTS += $(THRIFT_LANG_CONF_OPTS)
48 # C bindings
49 ifeq ($(BR2_PACKAGE_LIBGLIB2),y)
50 THRIFT_DEPENDENCIES += libglib2
51 else
52 THRIFT_CONF_OPTS += --without-c_glib
53 endif
55 # De-hardcode THRIFT for cross compiling
56 define THRIFT_TOOL_NO_HARDCODE
57 for f in `find $(@D) -name Makefile.am -type f`; do \
58 $(SED) "/^THRIFT =/d" $$f; \
59 done
60 $(SED) "s:top_builddir)/compiler/cpp/thrift:THRIFT):" $(@D)/tutorial/Makefile.am
61 endef
63 THRIFT_POST_PATCH_HOOKS += THRIFT_TOOL_NO_HARDCODE
65 define THRIFT_BUILD_CMDS
66 $(TARGET_MAKE_ENV) $(MAKE) THRIFT=$(HOST_DIR)/usr/bin/thrift -C $(@D)
67 endef
69 # Install runtime only
70 define THRIFT_INSTALL_TARGET_CMDS
71 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/lib DESTDIR=$(TARGET_DIR) install
72 endef
74 $(eval $(autotools-package))
75 $(eval $(host-autotools-package))
77 # to be used by other packages
78 THRIFT = $(HOST_DIR)/usr/bin/thrift