Skip to contentSkip to conversation

iptables out-of-tree build directory

PATCH Applied Henrik Nordstrom 3 participants 4 messages May 11, 2008 – May 12, 2008 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iptables out-of-tree build directory

The attached patch fixes iptables out-of-tree compiles which otherwise failed in extensions/ complaining about not finding xtables.h

mkdir build
cd build
../iptables/configure
make

Regards
Henrik

GNUmakefile.in +1 -1
Index: extensions/GNUmakefile.in
===================================================================
@@ -16,7 +16,7 @@
 regular_CFLAGS := @regular_CFLAGS@
 kinclude_CFLAGS := @kinclude_CFLAGS@
 
-AM_CFLAGS      := ${regular_CFLAGS} -I${top_srcdir}/include ${kinclude_CFLAGS}
+AM_CFLAGS      := ${regular_CFLAGS} -I${top_srcdir}/include -I../include ${kinclude_CFLAGS}
 AM_DEPFLAGS     = -Wp,-MMD,$(@D)/.$(@F).d,-MT,$@
 
 ifeq (${V},)
#1 lore raw
Quoted 8 lines · Henrik Nordstrom

The attached patch fixes iptables out-of-tree compiles which otherwise failed in extensions/ complaining about not finding xtables.h

mkdir build
cd build
../iptables/configure
make

Thanks for noticing!
-I../ is rather hackish, though. Following patch is the proper thing (IMO):

===
commit 333c904234d9320aca2494cf86595b9639b03f3e

Author: Jan Engelhardt <[email protected]>
Date:   Mon May 12 10:25:15 2008 +0200

Makefile: fix out-of-topdir compilation

Reported by: Henrik Nordstrom

When xtables.h is not already found in /usr/include, compilation would fail when ${top_srcdir} != ${top_builddir}.

---
 extensions/GNUmakefile.in |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
extensions/GNUmakefile.in +3 -1
index 31e6fb7..9c46ab1 100644
@@ -1,5 +1,7 @@
 # -*- Makefile -*-
 
+top_builddir := @top_builddir@
+builddir     := @builddir@
 top_srcdir  := @top_srcdir@
 srcdir      := @srcdir@
 ksourcedir  := @ksourcedir@
@@ -16,7 +18,7 @@ LDFLAGS        := @LDFLAGS@
 regular_CFLAGS := @regular_CFLAGS@
 kinclude_CFLAGS := @kinclude_CFLAGS@
 
-AM_CFLAGS      := ${regular_CFLAGS} -I${top_srcdir}/include ${kinclude_CFLAGS}
+AM_CFLAGS      := ${regular_CFLAGS} -I${top_builddir}/include -I${top_srcdir}/include ${kinclude_CFLAGS}
 AM_DEPFLAGS     = -Wp,-MMD,$(@D)/.$(@F).d,-MT,$@
 
 ifeq (${V},)
#3 lore raw
In reply to Jan Engelhardt
Quoted 10 lines · Jan Engelhardt

commit 333c904234d9320aca2494cf86595b9639b03f3e

Author: Jan Engelhardt <[email protected]>
Date:   Mon May 12 10:25:15 2008 +0200

Makefile: fix out-of-topdir compilation

Reported by: Henrik Nordstrom

When xtables.h is not already found in /usr/include, compilation would fail when ${top_srcdir} != ${top_builddir}.

Applied, thanks.