Domanda

I am creating custom package for TP-Link WDR4300 based on attitude_adjustment.
I am using functions from other package (libnetfilter queue) in my package.

compilation goes through fine. But in linking stage build crashes. Obviously linker is not able to find those references.
I have defined "DEPENDS:=+libnetfilter_queue" in the Makefile available in the packages directory. Build still crashes.
I am not clear with how to define the dependencies.
what modifications are required in the Makefile (src directory).

My current Makefile (src directory) is very simple. It looks like this.

CFLAGS = -Wall
OBJS = main.o
all: smartAP
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
smartAP: $(OBJS)
$(CC) -o $@ $(OBJS)
clean:
rm -f smartAP *.o

Please let me know how to include the dependencies on other packages, so that build goes through.

Solution from yegorich solved my build problem. But now build is again crashing with package missing.
Build log:

install -d -m0755 /home/devnet/openwrt/attitude_adjustment/build_dir/target-mips_r2_uClibc-0.9.33.2/smartAP/ipkg-ar71xx/smartAP/usr/sbin

install -m0755 /home/devnet/openwrt/attitude_adjustment/build_dir/target-mips_r2_uClibc-0.9.33.2/smartAP/smartAP /home/devnet/openwrt/attitude_adjustment/build_dir/target-mips_r2_uClibc-0.9.33.2/smartAP/ipkg-ar71xx/smartAP/usr/sbin/

find /home/devnet/openwrt/attitude_adjustment/build_dir/target-mips_r2_uClibc-0.9.33.2/smartAP/ipkg-ar71xx/smartAP -name 'CVS' -o -name '.svn' -o -name '.#' -o -name '~'| xargs -r rm -rf

Package smartAP is missing dependencies for the following libraries: libnetfilter_queue.so.1

I have already mentioned the dependency on libnetfilter_queue in the Package Makefile.

include $(INCLUDE_DIR)/package.mk

define Package/smartAP
SECTION:=net
CATEGORY:=Network
DEPENDS:=+libnetfilter_queue
TITLE:=Smart Wireless Access Point
endef

Should I mention the dependency some where else?

È stato utile?

Soluzione

"DEPENDS:=+libnetfilter_queue" tells the build system to build libnetfilter_queue before your package. You still need to define linker flags in your software's Makefile. Something like:

LDFLAGS = -lnetfilter_queue

See this tutorial for more information about writing Makefiles and linking libs.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top