为了在widora_Openwrt环境下安装最新的giflib-5.2.1库,自己编制了对应的feeds Makefile. 由于giflib本身的Makefile没有configure配置, 在Openwrt环境下安装目录参数也需要调整. 最后步骤如下:
1. 在 feeds/packages/libs 目录下建立子目录 giflib, 在其中建立一个Makefile, 内容如下:
# # Copyright (C) 2006-2014 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # # ####################################################################################### # NOTE # 1. Put this makefile file in ~/openwrt_widor/feeds/packages/libs/giflib # 2. Make a soft link of dir giflib to dir ~/openwrt_widora/package/feeds/packages: # ln -s ~/openwrt_widora/feeds/packages/libs/giflib ../../../package/feeds/packages/ # 3. make menuconfig to select the package as 'M' # 4. make package/feeds/packages/giflib/compile V=s # 5. Result ipk file: # openwrt_widora/bin/ramips/packages/packages/giflib_5.2.1-5_ramips_24kec.ipk # # Midas Zhou ####################################################################################### include $(TOPDIR)/rules.mk PKG_NAME:=giflib PKG_VERSION:=5.2.1 PKG_RELEASE:=5 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@SF/giflib #PKG_MD5SUM:= PKG_MAINTAINER:=Eric Raymond <esr[AT]snark.thyrsus.com> PKG_LICENSE:=SPDX-License-Identifier MIT PKG_LICENSE_FILES:=COPYING include $(INCLUDE_DIR)/package.mk define Package/giflib SECTION:=libs CATEGORY:=Libraries TITLE:=A library for manipulating GIF files URL:=http://sourceforge.net/projects/giflib endef TARGET_CFLAGS += $(FPIC) define Build/Compile +$(MAKE_VARS) \ $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" \ $(MAKE_FLAGS) \ all; endef define Build/Install $(MAKE_VARS) \ $(MAKE) -C $(PKG_BUILD_DIR) \ $(MAKE_INSTALL_FLAGS) PREFIX="/usr" DESTDIR="$(PKG_INSTALL_DIR)" \ install; endef define Build/InstallDev $(INSTALL_DIR) $(1) $(CP) $(PKG_INSTALL_DIR)/* $(1)/ endef define Package/giflib/install $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgif.so.* $(1)/usr/lib/ endef $(eval $(call BuildPackage,giflib))
2. 建立软链接到package:
ln -s ~/openwrt_widora/feeds/packages/libs/giflib ~/openwrt_widora/package/feeds/packages/
3. 执行make menuconfig , 在Libraries类别中m选中giflib模块.
4. openwrt_widora目录下单独编译此模块, 前提环境是openwrt已经编译完成:
make package/feeds/packages/giflib/compile V=s
5. 完成后可以在bin/ramips/packages/packages目录下找到此模块的安装包 giflib_5.2.1-5_ramips_24kec.ipk
原文链接:https://blog.csdn.net/midaszhk/article/details/103560404
本站的文章和资源来自互联网或者站长的原创,按照 CC BY -NC -SA 3.0 CN协议发布和共享,转载或引用本站文章应遵循相同协议。如果有侵犯版权的资 源请尽快联系站长,我们会在24h内删除有争议的资源。欢迎大家多多交流,期待共同学习进步。