deadwood on openwrt 打包 ipk 求助

2015-01-29 15:09:01 +08:00
 debiansid
@aa65535 我参考了你的chinadns以及maradns的Makefile写法,但是deadwood始终无法编译;错误如下
cd /home/admin/openwrt/build_dir/target-mips_34kc_eglibc-2.19/deadwood-3.2.06/src; make all -C /home/admin/openwrt/build_dir/target-mips_34kc_eglibc-2.19/deadwood-3.2.06 CFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -mips16 -minterlink-mips16" FLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -mips16 -minterlink-mips16" CC="mips-openwrt-linux-gnu-gcc" HOSTCC="gcc" V=
make[4]: Entering directory `/home/admin/openwrt/build_dir/target-mips_34kc_eglibc-2.19/deadwood-3.2.06'
make[4]: *** No rule to make target `all'. Stop.
make[4]: Leaving directory `/home/admin/openwrt/build_dir/target-mips_34kc_eglibc-2.19/deadwood-3.2.06'
make[3]: *** [/home/admin/openwrt/build_dir/target-mips_34kc_eglibc-2.19/deadwood-3.2.06/.built] Error 2
make[3]: Leaving directory `/home/admin/openwrt/package/openwrt-deadwood'
make[2]: *** [package/openwrt-deadwood/compile] Error 2
make[2]: Leaving directory `/home/admin/openwrt'
make[1]: *** [/home/admin/openwrt/staging_dir/target-mips_34kc_eglibc-2.19/stamp/.package_compile] Error 2
make[1]: Leaving directory `/home/admin/openwrt'

src里面有Makefile,用toolchain可以make all成功,我想弄成ipk形式。
不知道从哪里下手。

谢谢
1310 次点击
所在节点    OpenWrt
15 条回复
aa65535
2015-01-29 16:35:31 +08:00
这种错误一般是 PKG_BUILD_DIR 路径没写对,检查一下对应的 tar.gz 文件里的目录名称。
目录 /home/admin/openwrt/build_dir/target-mips_34kc_eglibc-2.19/deadwood-3.2.06 是对的么?

另外,问这种最好把 Makefile 贴出来,不然我只能猜了。
debiansid
2015-01-29 17:03:04 +08:00
@aa65535 -C 要指定到源码在的位置,src以及tools
LazyZhu
2015-01-29 17:48:48 +08:00
debiansid
2015-01-29 18:12:56 +08:00
@LazyZhu @aa65535
make -C /home/admin/openwrt/build_dir/target-mips_34kc_eglibc-2.19/deadwood-3.2.06/src CFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -mips16 -minterlink-mips16" FLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -mips16 -minterlink-mips16" CC="mips-openwrt-linux-gnu-gcc" HOSTCC="gcc" V=
make[4]: Entering directory `/home/admin/openwrt/build_dir/target-mips_34kc_eglibc-2.19/deadwood-3.2.06/src'
mips-openwrt-linux-gnu-gcc -Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -mips16 -minterlink-mips16 -Wall -c -o DwHash.o DwHash.c
DwHash.c: In function 'dwh_hash_compress':
DwHash.c:155:24: error: 'MUL_CONSTANT' undeclared (first use in this function)
out *= MUL_CONSTANT;
^
DwHash.c:155:24: note: each undeclared identifier is reported only once for each function it appears in
make[4]: *** [DwHash.o] Error 1
make[4]: Leaving directory `/home/admin/openwrt/build_dir/target-mips_34kc_eglibc-2.19/deadwood-3.2.06/src'
make[3]: *** [/home/admin/openwrt/build_dir/target-mips_34kc_eglibc-2.19/deadwood-3.2.06/.built] Error 2
make[3]: Leaving directory `/home/admin/openwrt/package/openwrt-deadwood'
make[2]: *** [package/openwrt-deadwood/compile] Error 2
make[2]: Leaving directory `/home/admin/openwrt'
make[1]: *** [/home/admin/openwrt/staging_dir/target-mips_34kc_eglibc-2.19/stamp/.package_compile] Error 2
make[1]: Leaving directory `/home/admin/openwrt'
make: *** [world] Error 2

编译不是每次都可以成功。指点下?
debiansid
2015-01-29 18:14:51 +08:00
@aa65535 @LazyZhu
我的Makefile
#
# Copyright (C) 2006-2009 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=deadwood
PKG_VERSION:=3.2.06
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://maradns.samiam.org/deadwood/stable/$(PKG_VERSION)
#PKG_MD5SUM:=1d221438fb4d9317263555262b9c652c

include $(INCLUDE_DIR)/package.mk

define Package/deadwood
SECTION:=net
CATEGORY:=Network
DEPENDS:=+libpthread
TITLE:=Small and secure DNS Server
URL:=http://www.maradns.org/
SUBMENU:=IP Addresses and Names
endef

define Package/deadwood/description
maradns is a DNS server written with security, simplicity, and
performance in mind.
endef

define Package/deadwood/conffiles
/etc/maradns/dwood3rc
endef

#define Build/Configure
# it's not GNU autoconf stuff
# (cd $(PKG_BUILD_DIR)/src; \
#$(TARGET_CONFIGURE_OPTS) \
# ./configure \
);
#endef

# cd $(PKG_BUILD_DIR)/src; \

define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR)/src \
CFLAGS="$(TARGET_CFLAGS)" \
FLAGS="$(TARGET_CFLAGS)" \
CC="$(TARGET_CC)" \
HOSTCC="$(HOSTCC)" \
V=
#mkdir -p $(PKG_INSTALL_DIR)/usr/{bin,sbin}
#mkdir -p $(PKG_INSTALL_DIR)/usr/man/man{1,5,8}
$(MAKE) -C $(PKG_BUILD_DIR)/tools \
CFLAGS="$(TARGET_CFLAGS)" \
FLAGS="$(TARGET_CFLAGS)" \
CC="$(TARGET_CC)" \
#PREFIX="$(PKG_INSTALL_DIR)/usr" \
#RPM_BUILD_ROOT="$(PKG_INSTALL_DIR)" \
V=
#install
endef

define Package/deadwood/install
$(INSTALL_DIR) $(1)/etc/maradns
$(INSTALL_DATA) ./files/dwood3rc $(1)/etc/maradns/dwood3rc
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/deadwood.init $(1)/etc/init.d/deadwood
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/Deadwood $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/duende $(1)/usr/bin/
endef

$(eval $(call BuildPackage,deadwood))
LazyZhu
2015-01-29 18:28:02 +08:00
@debiansid
PKG_USE_MIPS16:=0
试试添加这条后编译,
另外deadwood依赖librt, 参考我的Makefile
debiansid
2015-01-29 19:02:29 +08:00
@LazyZhu duende-ng 的Makefile 给一个吧,我的是eglibc,不能直接用ipk。谢谢
LazyZhu
2015-01-29 19:15:23 +08:00
@debiansid 好了
debiansid
2015-01-29 19:30:50 +08:00
@LazyZhu 感谢… 还有我想在4300跑powerdns 的recursor 作者说uclibc 不支持*context 只能换eglibc 才能编译。现在主流都是uclibc 换了软件都要自己编译,有啥方案不?
LazyZhu
2015-01-29 19:43:28 +08:00
不知道powerdns要啥context, 搜索"uClibc context patch", openwrt 工具链自己打补丁哦
debiansid
2015-01-29 21:19:08 +08:00
@LazyZhu root@YesRouter:/etc/maradns# *** Error in `Deadwood': double free or corruption (out): 0x004cf1f0 ***
eglibc 下不稳定貌似。你的ublibc下面正常不
debiansid
2015-01-29 21:23:38 +08:00
debiansid
2015-01-30 11:48:20 +08:00
@LazyZhu http://git.uclibc.org/uClibc/commit/?id=a8dc90eaaa5e6474beac828558d969b1aafee4af
我找到了这个包,不知道怎么在buildroot里面替换原来的uclibc
debiansid
2015-01-30 12:50:50 +08:00
替换bz2,编译失败,现在想打补丁,不知道应该在哪个阶段打
debiansid
2015-02-02 23:39:26 +08:00
@LazyZhu 折腾两天搞好了 ipk

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/166500

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX