Search code examples
autotoolsautomakeopenwrt

OpenWRT looking for files in staging_dir at compile time


I'm trying to compile some OpenWRT packages, A and B, where B depends on some header files from A.

These packages use automake, and when I compile A, it copies its header files to build_dir/../package/include/...

The problem is that now I need to use them in package B, and when I add the command someheaders_HEADERS, OpenWRT looks for them in staging_dir/.../usr/include.

I could copy these files over on the \install phase of the OpenWRT compile process, but that seems a bad approach.

How can this be correctly solved?

Thanks!


Solution

  • I would suggest below 2 things,

    If your package A provide pkg config (.pc) file then you can add below code in Package B makefile.am

    yourapp_CFLAGS = $(pkg-config --cflags <Package-A's .PC file name>)
    

    or simply add below code in makefile.am for package B

    yourapp_CFLAGS = -I($CURDIR)/../PackageA/include/