【问题标题】:How to make created packages available on make menuconfig?如何使创建的软件包在 make menuconfig 上可用?
【发布时间】:2013-02-06 18:58:41
【问题描述】:

我正在尝试为 OpenWrt 创建一个 libxerces 包。按照该站点 http://wiki.openwrt.org/doc/devel/packages 的说明,我在 packages 目录中创建了一个名为 libxerces-c 的文件夹,并创建了一个简单的 Makefile 以在 make menuconfig 上列出该包,但它没有发生。

Makefile 定义如下:

#
# Copyright (C) 2006-2013 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

# Name and release number of this package
PKG_NAME:=xerces-c
PKG_VERSION:=3.1.1
PKG_RELEASE:=1

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://apache.mirror.pop-sc.rnp.br/apache//xerces/c/3/sources/
PKG_CAT:=zcat

include $(INCLUDE_DIR)/package.mk

# Specify package information for this program. 
# The variables defined here should be self explanatory.
define Package/libxerces
  SECTION:=libs
  CATEGORY:=Libraries
  TITLE:=Validating XML parser written in a portable subset of C++.
  URL:=http://xerces.apache.org/
endef

define Package/libxerces/description
  Xerces-C++ is a validating XML parser written in a portable subset of
  C++.  Xerces-C++ makes it easy to give your application the ability
  to read and write XML data. A shared library is provided for parsing,
  generating, manipulating, and validating XML documents. Xerces-C++ is
  faithful to the XML 1.0 recommendation and associated standards (DOM
  1.0, DOM 2.0, SAX 1.0, SAX 2.0, Namespaces, XML Schema Part 1 and
  Part 2).  It also provides experimental implementations of XML 1.1
  and DOM Level 3.0.  The parser provides high performance, modularity,
  and scalability.
endef     

CONFIGURE_ARGS+= --host=mips-openwrt-linux

define Build/Configure
  $(call Build/Configure/Default)    
endef

define Build/Compile
  $(call Build/Compile/Default)
endef

define Package/libxerces/install
endef

$(eval $(call BuildPackage,libxerces))

我已经尝试执行安装脚本

./scripts/feeds install libxerces-c

但是什么也没发生。执行make menuconfig后还是看不到包。

【问题讨论】:

    标签: makefile openwrt


    【解决方案1】:

    你需要

    1. feed 与包一起添加到您的 feeds.conf.default 或创建 feeds.conf

    2. 然后./scripts/feeds update -a(更新所有提要...您可以只设置提要的名称而不是使用-a

    3. 然后./scripts/feeds install foobar

    [...]

    ...您显然在libxerces-c 上调用了安装,而您的包被称为libxerces

    【讨论】:

    • 您也可以简单地在 $buildroot/packages/ 目录中添加一个包含 Makefile 的文件夹。
    【解决方案2】:

    可能您还没有在寻找它,但这里是答案。 为了使您的包出现在 menuconfig TUI 中,您需要添加以下内容 在定义包子句中为您提供 Makefile 选项:

    MENU:1
    

    因此,您的 Makefile 的这一部分将如下所示:

    define Package/libxerces
    SECTION:=libs
      CATEGORY:=Libraries
      TITLE:=Validating XML parser written in a portable subset of C++.
      URL:=http://xerces.apache.org/
    endef
    

    【讨论】:

      【解决方案3】:

      你能不能做一个make menuconfig,看看是否有关于你的包“libxerces”的错误信息。我对自定义包的设置是这样的:

      mkdir package/custom
      mkdir package/custom/
      ln -s /path/to/package/libxerces/ package/custom/
      

      如果你的 makefile 是正确的,那么 Libraries->libxerces 应该出现在 menuconfig 中,如果不是错误消息应该打印在 make/make menuconfig 上。您也可以进行make package/libxerces/compile 等操作。注意:你的包名是 libxerces 而不是 libxerces-c。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-08-18
        • 1970-01-01
        • 2021-01-13
        • 1970-01-01
        • 1970-01-01
        • 2014-06-18
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多