OpenWrt Forum Archive

Topic: How to define dependencies on other packages

The content of this topic has been archived on 29 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

I am new to OpenWrt build environment.

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.

CC = gcc
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.

To me it looks like you are using the wrong compiler in the src Makefile. You are using the generic gcc, while you should use the Openwrt cross-compile-gcc for your platform.
The CC definition is probably wrong and extra. You should let the Openwrt make system provide that definition for you automatically in the background.

You might looks a similar example here:
px5g main Makefile: https://dev.openwrt.org/browser/trunk/p … e/Makefile
src Makefile: https://dev.openwrt.org/browser/trunk/p … c/Makefile

(Last edited by hnyman on 2 Apr 2014, 21:04)

Hi hnyman,

Thank you for the quick response. I have seen the build output using V=s option in make. CC macro, what I have defined is overridden by openwrt build system and proper cross compiler is used.
I had look at the src make file for px5g.
px5g does not have any dependencies on other packages.

My package has dependency on libnetfilter_queue. Linker needs the definition/declaration of function calls from libnetfilter_queue.

According to my understanding, somehow this information needs to be put into src makefile. So that build goes through.

I am able to get the build through by including -lnetfilter_queue in the compilation option.
But now OpenWrt install command is crashing.

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?

Hi devnet,

I dug this up when searching for a solution to the same problem. I found that the problem was that the package should not be "+libnetfilter_queue" but instead actually "+libnetfilter-queue" . Hope you find this answer at least somewhat helpful a year later.

(Last edited by bngoalie on 12 Apr 2015, 22:51)

bngoalie wrote:

Hi devnet,

I dug this up when searching for a solution to the same problem. I found that the problem was that the package should not be "+libnetfilter_queue" but instead actually "+libnetfilter-queue" . Hope you find this answer at least somewhat helpful a year later.

Great thank you !

The discussion might have continued from here.