- touch $(PKG_BUILD_DIR)/.built
-
-$(IPKG_LIBLTDL):
- install -m0755 -d $(IDIR_LIBLTDL)/usr/lib
- cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libltdl.so.* $(IDIR_LIBLTDL)/usr/lib/
- $(RSTRIP) $(IDIR_LIBLTDL)
- $(IPKG_BUILD) $(IDIR_LIBLTDL) $(PACKAGE_DIR)
-
-$(STAGING_DIR)/usr/lib/libltdl.so: $(PKG_BUILD_DIR)/.built
- mkdir -p $(STAGING_DIR)/usr/include
- cp -fpR $(PKG_INSTALL_DIR)/usr/include/ltdl.h $(STAGING_DIR)/usr/include/
- mkdir -p $(I_LIBLTDL_DEV)/usr/lib
- cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libltdl.{a,so*} $(STAGING_DIR)/usr/lib/
-
-install-dev: $(STAGING_DIR)/usr/lib/libltdl.so
-
-uninstall-dev:
- rm -rf $(STAGING_DIR)/usr/include/ltdl*
- rm -rf $(STAGING_DIR)/usr/lib/libltdl.{a,so*}
-
-compile: install-dev
-clean: uninstall-dev
+ $(INSTALL_DIR) $(1)/usr/lib $(1)/usr/include
+ mv $(2)/lib/* $(1)/usr/lib/
+ mv $(2)/include/* $(1)/usr/include/
+ $(SED) 's,\(hardcode_into_libs\)=yes,\1=no,g' $(2)/bin/libtool
+ $(CP) $(2)/bin/libtool $(2)/bin/libtool-ucxx
+ $(SED) 's,-lstdc++,-luClibc++,g' $(2)/bin/libtool-ucxx
+endef
+
+define Package/libltdl/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_BUILD_DIR)/libltdl/.libs/libltdl.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call HostBuild))
+$(eval $(call BuildPackage,libltdl))