libiconv: add support for using the stub on the host
authorFelix Fietkau <nbd@openwrt.org>
Sun, 20 Feb 2011 03:26:48 +0000 (03:26 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 20 Feb 2011 03:26:48 +0000 (03:26 +0000)
SVN-Revision: 25600

libs/libiconv/Makefile

index bc91c75fab69b3de9bfb3081b0121e37c86d402d..e935a4f0822334d001f93a4c29a8dae421fbfe21 100644 (file)
@@ -14,6 +14,7 @@ PKG_NAME:=libiconv
 PKG_RELEASE:=4
 
 include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
 
 define Package/libiconv
   SECTION:=libs
@@ -50,4 +51,29 @@ define Package/libiconv/install
        touch $(1)/tmp/.libiconv-placeholder
 endef
 
+define Host/Prepare
+       mkdir -p $(HOST_BUILD_DIR)
+endef
+
+define Host/Configure
+
+endef
+
+define Host/Compile
+       $(HOSTCC) -c src/iconv.c -o $(HOST_BUILD_DIR)/iconv.o -Isrc/include -fPIC
+       ar rcs $(HOST_BUILD_DIR)/libiconv.a $(HOST_BUILD_DIR)/iconv.o
+endef
+
+define Host/Install
+       $(INSTALL_DIR) $(STAGING_DIR_HOST)/lib
+       $(INSTALL_DATA) $(HOST_BUILD_DIR)/libiconv.a $(STAGING_DIR_HOST)/lib/
+
+       $(INSTALL_DIR) $(STAGING_DIR_HOST)/include
+       $(INSTALL_DATA) ./src/include/iconv.h $(STAGING_DIR_HOST)/include/
+
+       $(INSTALL_DIR) $(STAGING_DIR_HOST)/share/aclocal
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/m4/* $(STAGING_DIR_HOST)/share/aclocal/
+endef
+
+$(eval $(call HostBuild))
 $(eval $(call BuildPackage,libiconv))