* [B.A.T.M.A.N.] [PATCH v3] batman-adv: Fix build against recent Debian Stretch kernels
@ 2016-05-28 8:32 Sven Eckelmann
2016-05-31 7:07 ` Martin Weinelt
0 siblings, 1 reply; 3+ messages in thread
From: Sven Eckelmann @ 2016-05-28 8:32 UTC (permalink / raw)
To: b.a.t.m.a.n
The kernels for Debian stretch require some special CFLAGS settings which
are only correctly defined when NOSTDINC_FLAGS is defined inside the
execution of the Makefile via kbuild. But batman-adv sets it currently
outside to insert compatibility include headers and compat-sources.
This can be avoided by making the top Makefile kbuild compatible and
redefining the NOSTDINC_FLAGS when kbuild include this Makefile. The actual
build of the batman-adv module is then done by adding the subdirectory to
obj-y.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
v3:
- append NOSTDINC_FLAGS with our own flags instead of overwriting it
v2:
- Fixed noise from other patches in context (should now apply cleanly on next)
Makefile | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 5d2c058..2568fb2 100644
--- a/Makefile
+++ b/Makefile
@@ -43,7 +43,7 @@ RM ?= rm -f
REVISION= $(shell if [ -d "$(PWD)/.git" ]; then \
echo $$(git --git-dir="$(PWD)/.git" describe --always --dirty --match "v*" |sed 's/^v//' 2> /dev/null || echo "[unknown]"); \
fi)
-export NOSTDINC_FLAGS := \
+NOSTDINC_FLAGS += \
-I$(PWD)/compat-include/ \
-include $(PWD)/compat.h \
$(CFLAGS)
@@ -52,8 +52,12 @@ ifneq ($(REVISION),)
NOSTDINC_FLAGS += -DBATADV_SOURCE_VERSION=\"$(REVISION)\"
endif
+obj-y += net/batman-adv/
+
BUILD_FLAGS := \
- M=$(PWD)/net/batman-adv \
+ M=$(PWD) \
+ PWD=$(PWD) \
+ REVISION=$(REVISION) \
CONFIG_BATMAN_ADV=m \
CONFIG_BATMAN_ADV_DEBUG=$(CONFIG_BATMAN_ADV_DEBUG) \
CONFIG_BATMAN_ADV_BLA=$(CONFIG_BATMAN_ADV_BLA) \
@@ -61,7 +65,7 @@ BUILD_FLAGS := \
CONFIG_BATMAN_ADV_NC=$(CONFIG_BATMAN_ADV_NC) \
CONFIG_BATMAN_ADV_MCAST=$(CONFIG_BATMAN_ADV_MCAST) \
CONFIG_BATMAN_ADV_BATMAN_V=$(CONFIG_BATMAN_ADV_BATMAN_V) \
- INSTALL_MOD_DIR=updates/net/batman-adv/
+ INSTALL_MOD_DIR=updates/
all: config
$(MAKE) -C $(KERNELPATH) $(BUILD_FLAGS) modules
--
2.8.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH v3] batman-adv: Fix build against recent Debian Stretch kernels
2016-05-28 8:32 [B.A.T.M.A.N.] [PATCH v3] batman-adv: Fix build against recent Debian Stretch kernels Sven Eckelmann
@ 2016-05-31 7:07 ` Martin Weinelt
2016-06-06 15:48 ` Marek Lindner
0 siblings, 1 reply; 3+ messages in thread
From: Martin Weinelt @ 2016-05-31 7:07 UTC (permalink / raw)
To: b.a.t.m.a.n
Tested-by: Martin Weinelt <martin@darmstadt.freifunk.net>
Thank you, this also fixes build on Debian Jessies 4.5 Backports Kernel.
Martin
On 28.05.2016 10:32, Sven Eckelmann wrote:
> The kernels for Debian stretch require some special CFLAGS settings which
> are only correctly defined when NOSTDINC_FLAGS is defined inside the
> execution of the Makefile via kbuild. But batman-adv sets it currently
> outside to insert compatibility include headers and compat-sources.
>
> This can be avoided by making the top Makefile kbuild compatible and
> redefining the NOSTDINC_FLAGS when kbuild include this Makefile. The actual
> build of the batman-adv module is then done by adding the subdirectory to
> obj-y.
>
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> ---
> v3:
> - append NOSTDINC_FLAGS with our own flags instead of overwriting it
> v2:
> - Fixed noise from other patches in context (should now apply cleanly on next)
>
> Makefile | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 5d2c058..2568fb2 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -43,7 +43,7 @@ RM ?= rm -f
> REVISION= $(shell if [ -d "$(PWD)/.git" ]; then \
> echo $$(git --git-dir="$(PWD)/.git" describe --always --dirty --match "v*" |sed 's/^v//' 2> /dev/null || echo "[unknown]"); \
> fi)
> -export NOSTDINC_FLAGS := \
> +NOSTDINC_FLAGS += \
> -I$(PWD)/compat-include/ \
> -include $(PWD)/compat.h \
> $(CFLAGS)
> @@ -52,8 +52,12 @@ ifneq ($(REVISION),)
> NOSTDINC_FLAGS += -DBATADV_SOURCE_VERSION=\"$(REVISION)\"
> endif
>
> +obj-y += net/batman-adv/
> +
> BUILD_FLAGS := \
> - M=$(PWD)/net/batman-adv \
> + M=$(PWD) \
> + PWD=$(PWD) \
> + REVISION=$(REVISION) \
> CONFIG_BATMAN_ADV=m \
> CONFIG_BATMAN_ADV_DEBUG=$(CONFIG_BATMAN_ADV_DEBUG) \
> CONFIG_BATMAN_ADV_BLA=$(CONFIG_BATMAN_ADV_BLA) \
> @@ -61,7 +65,7 @@ BUILD_FLAGS := \
> CONFIG_BATMAN_ADV_NC=$(CONFIG_BATMAN_ADV_NC) \
> CONFIG_BATMAN_ADV_MCAST=$(CONFIG_BATMAN_ADV_MCAST) \
> CONFIG_BATMAN_ADV_BATMAN_V=$(CONFIG_BATMAN_ADV_BATMAN_V) \
> - INSTALL_MOD_DIR=updates/net/batman-adv/
> + INSTALL_MOD_DIR=updates/
>
> all: config
> $(MAKE) -C $(KERNELPATH) $(BUILD_FLAGS) modules
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-06-06 15:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-28 8:32 [B.A.T.M.A.N.] [PATCH v3] batman-adv: Fix build against recent Debian Stretch kernels Sven Eckelmann
2016-05-31 7:07 ` Martin Weinelt
2016-06-06 15:48 ` Marek Lindner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox