OpenWrt Forum Archive

Topic: Handling package build dependencies

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

I have the following situation:  I am developing a package which depends on headers and libraries provided by another package (libnl).

I've indicated the dependency in the Makefile, so libnl is automatically built and installed when I build my package. So far, so good.  Here's my pickle:  The build process for my program needs to find libnl's files at  compile time not just at run time.  What's the right way to get those paths? Right now, I've just hard-coded the relative path in the build_$(ARCH) directory, like so

  CFLAGS += -I../../libnl-1.1/ipkg-install/usr/include

but that seems rather fragile.  Is there a proper way to go about this?

Use -I$(STAGING_DIR)/usr/include instead of -I../../libnl-1.1.

I don't see any of the header files in (or being copied to) $(STAGING_DIR).  Is there something I need to do to make them be installed? 

The libnl makefile contains a Build/InstallDev definition, but as far as I can tell it's never called.

ifneq ($(CONFIG_LINUX_2_6),)
  define Build/InstallDev
    $(INSTALL_DIR) $(1)
    $(CP) $(PKG_INSTALL_DIR)/* $(1)/
    echo >/dev/stderr "***Yes, something is happening***"
    mkdir -p $(1)/usr/include/libnl
    $(CP) $(PKG_BUILD_DIR)/include/linux $(1)/usr/include/libnl/
  endef

  define Package/libnl/install
    $(INSTALL_DIR) $(1)/usr/lib
    $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl.so.* $(1)/usr/lib/
  endef
endif

Going beyond libnl specifically, I have a couple of other packages which ought to make their header files available for subsequent compilations.  Is there a general pattern, or documentation, on how I should do this?

Thanks,
Eric

(Last edited by EricAnderson on 14 Jan 2010, 18:27)

The discussion might have continued from here.