|
今天编译Capsulator包出错,希望各位能给点帮助或者建议,十分感谢。
此前成功编译了一个port-mirroring,和一个helloworld的例子,我是直接修改helloworld的Openwrt makefile来编译的。
我用的路由器是Netgear WNDR4300v1,编译用的sdk是从官网下的。
Capsulator的项目地址在:https://github.com/peymank/Capsulator。我下了下来然后放到package/Capsulator/src目录下。
Capsulator/makefile文件内容如下,是修改helloworld例子的。
- include $(TOPDIR)/rules.mk
- PKG_NAME:=Capsulator
- PKG_RELEASE:=1
- PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
- include $(INCLUDE_DIR)/package.mk
- define Package/Capsulator
- SECTION:=utils
- CATEGORY:=Utilities
- TITLE:=this is Capsulator_test
- endef
- define Package/Capsulator/description
- this is a test Capsulator!
- endef
- #CONFIGURE_VARS+= \
- CC="$(TOOLCHAIN_DIR)/bin/$(TARGET_CC)"
- #MAKE_FLAGS += \
- CXXFLAGS="$(TARGET_CXXFLAGS) -fno-builtin -fno-rtti -nostdinc++" \
- CPPFLAGS="$(TARGET_CPPFLAGS) -I$(STAGING_DIR)/usr/include/uClibc++ -I$(LINUX_DIR)/include" \
- LDFLAGS="$(TARGET_LDFLAGS) $(LDFLAGS)" \
- LIBS="$(TARGET_LIBS) -nodefaultlibs -luClibc++ -lm" \
- DESTDIR="$(PKG_INSTALL_DIR)"
- define Build/Prepare
- mkdir -p $(PKG_BUILD_DIR)
- $(CP) ./src/* $(PKG_BUILD_DIR)/
- endef
- #define Build/Compile
- # $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS);
- #endef
- define Package/Capsulator/install
- $(INSTALL_DIR) $(1)/bin
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/Capsulator $(1)/bin
- endef
- $(eval $(call BuildPackage,Capsulator))
复制代码
Capsulator/src/makefile 我修改了两个变量,FLAGS_CC_BASE和Make
- # Makefile for Capsulator
- # ------------------------------------------------------------------------------
- # make -- builds Capsulator and all dependencies in the default mode
- # make debug -- builds Capsulator in debug mode
- # make release-- builds Capsulator in release mode
- # make clean -- clean up byproducts
- # utility programs used by this Makefile
- CC = gcc
- MAKE = make --no-print-directory
- # set system-dependent variables
- OSTYPE = $(shell uname)
- ifeq ($(OSTYPE),Linux)
- ARCH=-D_LINUX_
- ENDIAN=-D_LITTLE_ENDIAN_
- LIB_SOCKETS =
- endif
- ifeq ($(OSTYPE),SunOS)
- ARCH=-D_SOLARIS_
- ENDIAN=-D_BIG_ENDIAN_
- LIB_SOCKETS = -lnsl -lsocket
- endif
- # define names of our build targets
- APP = capsulator
- # compiler and its directives
- DIR_INC =
- DIR_LIB =
- LIBS = $(LIB_SOCKETS) -lpthread
- FLAGS_CC_BASE = -c -Wall $(ENDIAN) $(DIR_INC)
- # compiler directives for debug and release modes
- BUILD_TYPE = debug
- ifeq ($(BUILD_TYPE),debug)
- FLAGS_CC_BUILD_TYPE = -g -D_DEBUG_
- else
- FLAGS_CC_BUILD_TYPE = -O3
- endif
- # put all the flags together
- CFLAGS = $(FLAGS_CC_BASE) $(FLAGS_CC_BUILD_TYPE)
- # project sources
- SRCS = common.c capsulator.c get_ip_for_interface.c main.c
- OBJS = $(patsubst %.c,%.o,$(SRCS))
- DEPS = $(patsubst %.c,.%.d,$(SRCS))
- # include the dependencies once we've built them
- ifdef INCLUDE_DEPS
- include $(DEPS)
- endif
- #########################
- ## PHONY TARGETS
- #########################
- # note targets which don't produce a file with the target's name
- .PHONY: all clean clean-all clean-deps debug release deps
- # build the program
- all: $(APP)
- # clean up by-products (except dependency files)
- clean:
- rm -f *.o $(APP)
- # clean up all by-products
- clean-all: clean clean-deps
- # clean up dependency files
- clean-deps:
- rm -f .*.d
- # shorthand for building debug or release builds
- debug release:
- @$(MAKE) BUILD_TYPE=$@ all
- # build the dependency files
- deps: $(DEPS)
- # includes are ready build command
- IR=ir
- $(APP).$(IR): $(OBJS)
- $(CC) -o $(APP) $(OBJS) $(DIR_LIB) $(LIBS)
- #########################
- ## REAL TARGETS
- #########################
- $(APP): deps
- @$(MAKE) BUILD_TYPE=$(BUILD_TYPE) INCLUDE_DEPS=1 $@.$(IR)
- $(DEPS): .%.d: %.c
- $(CC) -MM $(CFLAGS) $(DIRS_INC) $< > $@
复制代码
最终报错如下
- Collecting package info: done
- Collecting target info: done
- #
- # configuration written to .config
- #
- make[1]: Entering directory `/home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64'
- make[2]: Entering directory `/home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/package/Capsulator'
- mkdir -p /home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/Capsulator
- cp -fpR ./src/* /home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/Capsulator/
- touch /home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/Capsulator/.prepared_ea23a9cda81e60a7910828c1395ed66a
- rm -f /home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/staging_dir/target-mips_34kc_uClibc-0.9.33.2/stamp/.Capsulator_installed
- (cd /home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/Capsulator/./; if [ -x ./configure ]; then find /home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/Capsulator/ -name config.guess | xargs -r chmod u+w; find /home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/Capsulator/ -name config.guess | xargs -r -n1 cp --remove-destination /home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/scripts/config.guess; find /home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/Capsulator/ -name config.sub | xargs -r chmod u+w; find /home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/Capsulator/ -name config.sub | xargs -r -n1 cp --remove-destination /home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/scripts/config.sub; AR="mips-openwrt-linux-uclibc-gcc-ar" AS="ccache_cc -c -Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float" LD=mips-openwrt-linux-uclibc-ld NM="mips-openwrt-linux-uclibc-gcc-nm" CC="ccache_cc" GCC="ccache_cc" CXX="ccache_cxx" RANLIB="mips-openwrt-linux-uclibc-gcc-ranlib" STRIP=mips-openwrt-linux-uclibc-strip OBJCOPY=mips-openwrt-linux-uclibc-objcopy OBJDUMP=mips-openwrt-linux-uclibc-objdump SIZE=mips-openwrt-linux-uclibc-size 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 " CXXFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -mips16 -minterlink-mips16 " CPPFLAGS="-I/home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/include -I/home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/staging_dir/target-mips_34kc_uClibc-0.9.33.2/include -I/home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/usr/include -I/home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/include " LDFLAGS="-L/home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/lib -L/home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/staging_dir/target-mips_34kc_uClibc-0.9.33.2/lib -L/home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/usr/lib -L/home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/lib " ./configure --target=mips-openwrt-linux --host=mips-openwrt-linux --build=x86_64-linux-gnu --program-prefix="" --program-suffix="" --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share --localstatedir=/var --mandir=/usr/man --infodir=/usr/info --disable-nls ; fi; )
- rm -f /home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/Capsulator/.configured_*
- touch /home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/Capsulator/.configured_yyn
- 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 -I/home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/include -I/home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/staging_dir/target-mips_34kc_uClibc-0.9.33.2/include -I/home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/usr/include -I/home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/include " CXXFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -mips16 -minterlink-mips16 -I/home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/include -I/home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/staging_dir/target-mips_34kc_uClibc-0.9.33.2/include -I/home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/usr/include -I/home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/include " LDFLAGS="-L/home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/lib -L/home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/staging_dir/target-mips_34kc_uClibc-0.9.33.2/lib -L/home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/usr/lib -L/home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/lib " make -j1 -C /home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/Capsulator/. AR="mips-openwrt-linux-uclibc-gcc-ar" AS="ccache_cc -c -Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float" LD=mips-openwrt-linux-uclibc-ld NM="mips-openwrt-linux-uclibc-gcc-nm" CC="ccache_cc" GCC="ccache_cc" CXX="ccache_cxx" RANLIB="mips-openwrt-linux-uclibc-gcc-ranlib" STRIP=mips-openwrt-linux-uclibc-strip OBJCOPY=mips-openwrt-linux-uclibc-objcopy OBJDUMP=mips-openwrt-linux-uclibc-objdump SIZE=mips-openwrt-linux-uclibc-size CROSS="mips-openwrt-linux-uclibc-" ARCH="mips" ;
- make[3]: Entering directory `/home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/Capsulator'
- ccache_cc -MM -c -Wall -D_LINUX_ -D_LITTLE_ENDIAN_ -g -D_DEBUG_ common.c > .common.d
- ccache_cc -MM -c -Wall -D_LINUX_ -D_LITTLE_ENDIAN_ -g -D_DEBUG_ capsulator.c > .capsulator.d
- ccache_cc -MM -c -Wall -D_LINUX_ -D_LITTLE_ENDIAN_ -g -D_DEBUG_ get_ip_for_interface.c > .get_ip_for_interface.d
- ccache_cc -MM -c -Wall -D_LINUX_ -D_LITTLE_ENDIAN_ -g -D_DEBUG_ main.c > .main.d
- ccache_cc -c -Wall -D_LINUX_ -D_LITTLE_ENDIAN_ -g -D_DEBUG_ -c -o common.o common.c
- cc1: note: someone does not honour COPTS correctly, passed 0 times
- ccache_cc -c -Wall -D_LINUX_ -D_LITTLE_ENDIAN_ -g -D_DEBUG_ -c -o capsulator.o capsulator.c
- cc1: note: someone does not honour COPTS correctly, passed 0 times
- ccache_cc -c -Wall -D_LINUX_ -D_LITTLE_ENDIAN_ -g -D_DEBUG_ -c -o get_ip_for_interface.o get_ip_for_interface.c
- cc1: note: someone does not honour COPTS correctly, passed 0 times
- ccache_cc -c -Wall -D_LINUX_ -D_LITTLE_ENDIAN_ -g -D_DEBUG_ -c -o main.o main.c
- main.c:24:70: warning: backslash and newline separated by space [enabled by default]
- -vb, -virtual_border_intf: specifies a tap device name as border\n\
- ^
- cc1: note: someone does not honour COPTS correctly, passed 0 times
- ccache_cc -o capsulator common.o capsulator.o get_ip_for_interface.o main.o -lpthread
- make[3]: Leaving directory `/home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/Capsulator'
- touch /home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/Capsulator/.built
- mkdir -p /home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/bin/ar71xx/packages /home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/Capsulator/ipkg-ar71xx/Capsulator/CONTROL /home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/staging_dir/target-mips_34kc_uClibc-0.9.33.2/pkginfo
- install -d -m0755 /home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/Capsulator/ipkg-ar71xx/Capsulator/bin
- install -m0755 /home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/Capsulator/Capsulator /home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/Capsulator/ipkg-ar71xx/Capsulator/bin
- install: cannot stat '/home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/Capsulator/Capsulator': No such file or directory
- make[2]: *** [/home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/bin/ar71xx/packages/base/Capsulator_1_ar71xx.ipk] Error 1
- make[2]: Leaving directory `/home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/package/Capsulator'
- make[1]: *** [package/Capsulator/compile] Error 2
- make[1]: Leaving directory `/home/wucanrui/openwrt/SDK/OpenWrt-SDK-15.05-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64'
- make: *** [package/Capsulator/compile] Error 2
复制代码
希望各位大神能给点帮助或者建议,非常感谢! |
|