[PATCH] automake: add ${top_builddir}/include to AM_CFLAGS

Andreas Bießmann biessmann at corscience.de
Thu Aug 5 09:19:02 EDT 2010


 This patch enables out-of-source builds like this
  $ cd builddir && src_dir/configure && make

 Before this patch there was an error about missing netlink/version.h which
 is built by automake in top_builddir rather than top_srcdir which is already
 in include search path.

Signed-off-by: Andreas Bießmann <biessmann at corscience.de>
---
 lib/Makefile.am     |    2 +-
 src/Makefile.am     |    2 +-
 src/lib/Makefile.am |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/Makefile.am b/lib/Makefile.am
index 1c2ae99..19f071a 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,6 +1,6 @@
 # -*- Makefile -*-
 
-AM_CFLAGS  = -Wall -I${top_srcdir}/include -D_GNU_SOURCE
+AM_CFLAGS  = -Wall -I${top_srcdir}/include -I${top_builddir}/include -D_GNU_SOURCE
 
 lib_LTLIBRARIES = \
 	libnl.la libnl-genl.la libnl-route.la libnl-nf.la
diff --git a/src/Makefile.am b/src/Makefile.am
index ca37843..abef379 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2,7 +2,7 @@
 
 SUBDIRS = lib
 
-AM_CFLAGS  = -Wall -I${top_srcdir}/include -D_GNU_SOURCE
+AM_CFLAGS  = -Wall -I${top_srcdir}/include -I${top_builddir}/include -D_GNU_SOURCE
 AM_LDFLAGS = -L${top_builddir}/lib -L${top_builddir}/src/lib -lnl-cli
 
 noinst_PROGRAMS = \
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 068c3a6..8655c79 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -1,6 +1,6 @@
 # -*- Makefile -*-
 
-AM_CFLAGS  = -Wall -I${top_srcdir}/include -D_GNU_SOURCE -DPKGLIBDIR=\"$(pkglibdir)\" -DSYSCONFDIR=\"$(sysconfdir)\" -rdynamic
+AM_CFLAGS  = -Wall -I${top_srcdir}/include -I${top_builddir}/include -D_GNU_SOURCE -DPKGLIBDIR=\"$(pkglibdir)\" -DSYSCONFDIR=\"$(sysconfdir)\" -rdynamic
 AM_LDFLAGS = -L${top_builddir}/lib -ldl
 
 #nobase_pkglib_LTLIBRARIES = cls/basic.la cls/ematch/cmp.la
-- 
1.7.1




More information about the libnl mailing list