openwrt makefile 中 PKG_FIXUP:=autoreconf 什么意思
时间: 2024-04-22 16:27:47 浏览: 11
在 OpenWrt 中,`PKG_FIXUP` 是一个 Makefile 变量,用于在构建软件包时进行一些修复操作。`autoreconf` 是其中的一个选项,它会自动运行 `autoconf` 和 `automake` 工具,以生成或更新 `configure` 脚本和 Makefile.in 文件,以便软件包能够正确地进行编译和安装。因此,`PKG_FIXUP:=autoreconf` 表示在构建软件包时,应该自动运行 `autoreconf` 工具,以确保软件包的正确性和可用性。
相关问题
openwrt 遍译php_openwrt sdk编译软件包笔记
1. 下载SDK
首先需要从OpenWrt官网下载SDK。选择与路由器硬件平台对应的SDK,例如:如果你的路由器是MT7620A芯片,则需要下载MT7620A SDK。
2. 解压SDK
将下载的SDK解压到任意目录下,例如:/opt/mt7620a_sdk。
3. 进入SDK目录
打开终端,进入SDK目录,例如:cd /opt/mt7620a_sdk。
4. 配置SDK
执行make menuconfig命令,进入SDK配置界面,进行以下配置:
- Target System: 选择路由器的芯片类型,例如:MediaTek Ralink MIPS
- Target Profile: 选择路由器的型号,例如:MT7620A based boards
- Target Images: 选择编译软件包的目标平台,例如:ramips/mt7620a
5. 添加软件包源
执行以下命令,添加软件包源:
echo "src/gz openwrt_custom http://openwrt.inkworm.com/chaos_calmer/15.05/mt7620a/packages/custom" >> /etc/opkg/customfeeds.conf
opkg update
6. 安装编译工具
执行以下命令,安装编译工具:
opkg install gcc make libpthread libstdcpp
7. 编写Makefile文件
在任意目录下创建一个文件夹,例如:/opt/my_package,并在该文件夹下创建一个名为Makefile的文件。在Makefile文件中编写软件包的编译规则。
以下是一个简单的Makefile文件示例:
```
include $(TOPDIR)/rules.mk
PKG_NAME:=hello-world
PKG_VERSION:=1.0
PKG_RELEASE:=1
include $(INCLUDE_DIR)/package.mk
define Package/hello-world
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Hello World
DEPENDS:=@TARGET_ramips_mt7620a
endef
define Package/hello-world/description
This is a Hello World package.
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) $(TARGET_CONFIGURE_OPTS)
endef
define Package/hello-world/install
$(INSTALL_DIR) $(1)/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/hello-world $(1)/bin/
endef
$(eval $(call BuildPackage,hello-world))
```
8. 编译软件包
执行以下命令,编译软件包:
make package/hello-world/compile V=s
编译完成后,在SDK目录下的bin目录中可以找到编译好的软件包。
9. 安装软件包
将编译好的软件包拷贝到路由器上,并执行以下命令安装:
opkg install hello-world_1.0-1_ramips_24kec.ipk
安装完成后,在路由器上执行hello-world命令即可看到输出结果。
Unknown package 'kmod-bonding'. Collected errors: * pkg_hash_fetch_best_installation_candidate: Packages for kmod-bonding found, but incompatible with the architectures configured * opkg_install_cmd: Cannot install package kmod-bonding.
很抱歉,看起来在您的OpenWrt设备上找不到与您的架构兼容的kmod-bonding软件包。这可能是因为该软件包没有针对您的设备架构进行编译或者您的软件包列表没有正确更新。
您可以尝试以下步骤来解决此问题:
1. 确保您的OpenWrt设备已连接到互联网,并且网络连接正常。
2. 运行以下命令更新软件包列表:
```
opkg update
```
这将获取最新的软件包信息。
3. 再次尝试安装kmod-bonding模块:
```
opkg install kmod-bonding
```
如果仍然无法安装,请确保您的设备架构与软件包列表中提供的软件包兼容。您可以尝试在OpenWrt论坛或邮件列表上寻求帮助,以获取与您的设备架构兼容的bonding模块的其他来源或解决方案。
如果问题仍然存在,请提供您的设备型号和架构信息,以便我们进一步帮助您找到适用于您的kmod-bonding模块。