Skip to contentSkip to conversation

package/bridge-utils: fix headers path

PATCH New Yann E. MORIN 2 participants 2 messages Oct 2, 2017 – Oct 3, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/bridge-utils: fix headers path

Currently, bridge-utils wants to grap the headers from the linux-headers package, so we point it directly there, as has been the case since we first added bridge-utils in 2003 (c8eea31d3f), and then further refined in 2005 (178a317d26) which is the first moment we pointed to the linux- headers directory.

However, ther are two things wrong with that.

First, the headers are not directly in $(LINUX_HEADERS_DIR). Instead, they are in a sub-directory thereof. So, we could not have found them the way we are doing now.

Second, this definitely does not work when using an external toolchain, because there is not linux-headers package enabled then.

Yet, against all odds, bridge-utils has valiantly deflected all rocks thrown its way, day-in day-out building without any issue in every autobuilders it's been confronted with. Good boy, good boy. :-)

And indeed, it turns out that the required headers are easily found from within the sysroot of the toolchain. Wonders! :-)

But there's still a gotcha: the default search path is still a hard coded path pointing to oft installed kernel source tree on the host.

So, we still have to pass this option, but we can simply point to a non-existent directory.

---
 package/bridge-utils/bridge-utils.mk | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
package/bridge-utils/bridge-utils.mk +4 -1
index 798202556f..c3e7c10e30 100644
@@ -8,8 +8,11 @@ BRIDGE_UTILS_VERSION = 1.6
 BRIDGE_UTILS_SITE = $(BR2_KERNEL_MIRROR)/linux/utils/net/bridge-utils
 BRIDGE_UTILS_SOURCE = bridge-utils-1.6.tar.xz
 BRIDGE_UTILS_AUTORECONF = YES
-BRIDGE_UTILS_CONF_OPTS = --with-linux-headers=$(LINUX_HEADERS_DIR)
 BRIDGE_UTILS_LICENSE = GPL-2.0+
 BRIDGE_UTILS_LICENSE_FILES = COPYING
 
+# Point to a non-existent directory, to avoid using the host's headers.
+# Required headers will anyway be found from within the sysroot.
+BRIDGE_UTILS_CONF_OPTS = --with-linux-headers=$(TOPDIR)/does-not-exist
+
 $(eval $(autotools-package))
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 package/bridge-utils: fix headers path

Quoted 14 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

Currently, bridge-utils wants to grap the headers from the linux-headers package, so we point it directly there, as has been the case since we first added bridge-utils in 2003 (c8eea31d3f), and then further refined in 2005 (178a317d26) which is the first moment we pointed to the linux- headers directory.

However, ther are two things wrong with that.

First, the headers are not directly in $(LINUX_HEADERS_DIR). Instead, they are in a sub-directory thereof. So, we could not have found them the way we are doing now.

Quoted 6 lines

Second, this definitely does not work when using an external toolchain, because there is not linux-headers package enabled then.

Yet, against all odds, bridge-utils has valiantly deflected all rocks thrown its way, day-in day-out building without any issue in every autobuilders it's been confronted with. Good boy, good boy. :-)

Heh ;)

Quoted 10 lines

And indeed, it turns out that the required headers are easily found from within the sysroot of the toolchain. Wonders! :-)

But there's still a gotcha: the default search path is still a hard coded path pointing to oft installed kernel source tree on the host.

So, we still have to pass this option, but we can simply point to a non-existent directory.

While this works I don't really like this does-not-exist. I've changed it to use $(STAGING_DIR)/usr/include, tweaked the comment and committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard