blob: fd0a5e2213397e79e137ed5bc5ba4f862651c43b [file] [log] [blame]
#
# Copyright (C) 2012 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=libhttpclient
PKG_VERSION:=1.0
PKG_RELEASE:=1
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
SVC_SOURCE_DIR:=$(MRVLDIR)/services/libhttpclient
PKG_SOURCE_DIR:=$(SVC_SOURCE_DIR) $(STAGING_DIR)/usr/lib
PKG_BUILD_PARALLEL:=0
include $(INCLUDE_DIR)/package.mk
define Package/libhttpclient
CATEGORY:=service
TITLE:=libhttpclient service
DEPENDS:= +libpthread +libubox +libubus +ril +liblog +libmbedtls
DEFAULT:=y
endef
define Package/libhttpclient/description
libhttpclient service applictions and utilities
endef
TARGET_CFLAGS += -ffunction-sections -fdata-sections
TARGET_LDFLAGS += -Wl,--gc-sections
ifeq "$(CONFIG_TARGET_mmp_asr1803_FALCON403)" "y"
TARGET_CFLAGS += -DNO_LOGCAT_SUPPORT
endif
ifeq "$(CONFIG_TARGET_mmp_asr1903_LAPW503)" "y"
TARGET_CFLAGS += -DNO_LOGCAT_SUPPORT
endif
define Build/Compile
$(MAKE) $(PKG_JOBS) -C $(SVC_SOURCE_DIR) \
SUBTARGET="$(SUBTARGET)" \
CROSS_COMPILE="$(TARGET_CROSS)" \
EXTRA_CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include -I$(TOOLCHAIN_DIR)/include" \
LD_FLAGS="$(TARGET_LDFLAGS) -L$(TOOLCHAIN_DIR)/lib/"\
INSTALL_DIR="$(PKG_INSTALL_DIR)" \
OBJ_DIR="$(PKG_BUILD_DIR)/obj" \
compile
endef
define Build/Clean
@if [ -d $(PKG_BUILD_DIR) ]; then \
$(MAKE) $(PKG_JOBS) -C $(SVC_SOURCE_DIR) \
CROSS_COMPILE="$(TARGET_CROSS)" \
EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
LD_FLAGS="$(TARGET_LDFLAGS)" \
INSTALL_DIR="$(PKG_INSTALL_DIR)" \
OBJ_DIR="$(PKG_BUILD_DIR)/obj" \
clean; \
fi
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/include/libhttpclient/
$(CP) -rf $(PKG_INSTALL_DIR)/lib/libhttpclient.so $(1)/usr/lib/
$(CP) -rf $(SVC_SOURCE_DIR)/libhttpclient/inc/*.h $(1)/usr/include/libhttpclient/
endef
define Package/libhttpclient/install
$(INSTALL_DIR) $(1)/lib
$(CP) -rf $(PKG_INSTALL_DIR)/* $(1)/
endef
$(eval $(call BuildPackage,libhttpclient))