[PATCH] Fix out-of-tree build.

Thierry Reding thierry.reding at avionic-design.de
Wed Mar 23 09:33:55 EDT 2011


* Thomas Graf wrote:
> On Fri, Jan 14, 2011 at 11:38:05AM +0100, Thierry Reding wrote:
> > This patch fixes out-of-tree build, that is, when building with
> > $builddir != $srcdir. In such a case, some generated header files are
> > not found because they live in a different tree and can be fixed by
> > adding the directories to the compiler's include search path.
> 
> What is the use case when building outside of the source tree?
> 
> I assume you are referring to bison/flex generated header files.

I've been looking at this some more and something struck me. I usually build
tarballs for autotools-based packages using "make dist". I also run "make
distcheck" before releases to make that all needed files end up in the
tarball (note that distcheck also builds out-of-tree). However if I run "make
distcheck" for libnl from git, it gives me all kinds of errors about missing
includes and such.

This left me wondering what the current release procedure looks like, since
it cannot be "make dist". I'm also attaching a patch that fixes up the
automake files to fix this up.

Cheers,
Thierry
-------------- next part --------------
From 3e1c495291a78806031e631f3c95f81441889efa Mon Sep 17 00:00:00 2001
From: Thierry Reding <thierry.reding at avionic-design.de>
Date: Wed, 23 Mar 2011 14:27:51 +0100
Subject: [PATCH] Fix "make distcheck".

This commit adds some missing files (some header files, the files below
/etc and the bison/flex files) to the distribution tarball to ensure
that libnl can be built from the tarballs created using "make dist".

It also adds some incantations to properly generate the flex and bison
output since the generated output is no longer shipped in the tarball.
---
 Makefile.am         |    3 +++
 include/Makefile.am |   50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 lib/Makefile.am     |   20 ++++++++++++++++++--
 3 files changed, 71 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 5931a9e..07017c8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,6 +15,9 @@ pkgconfig_DATA = libnl-3.0.pc
 sysconfdir = @sysconfdir@/libnl
 sysconf_DATA = etc/pktloc etc/classid
 
+EXTRA_DIST = \
+	$(sysconf_DATA)
+
 .PHONY: cscope
 cscope:
 	cscope -b -q -R -Iinclude -slib -ssrc;
diff --git a/include/Makefile.am b/include/Makefile.am
index e7f1206..2fc44f5 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -59,3 +59,53 @@ nobase_include_HEADERS = \
 	netlink/types.h \
 	netlink/utils.h \
 	netlink/version.h
+
+noinst_HEADERS = \
+	linux/fib_rules.h \
+	linux/genetlink.h \
+	linux/gen_stats.h \
+	linux/if_addr.h \
+	linux/if_arp.h \
+	linux/if_ether.h \
+	linux/if.h \
+	linux/if_link.h \
+	linux/if_vlan.h \
+	linux/inetdevice.h \
+	linux/ip_mp_alg.h \
+	linux/ipv6.h \
+	linux/neighbour.h \
+	linux/netfilter.h \
+	linux/netfilter/nfnetlink_conntrack.h \
+	linux/netfilter/nfnetlink.h \
+	linux/netfilter/nfnetlink_log.h \
+	linux/netfilter/nfnetlink_queue.h \
+	linux/netlink.h \
+	linux/pkt_cls.h \
+	linux/pkt_sched.h \
+	linux/rtnetlink.h \
+	linux/snmp.h \
+	linux/tc_ematch/tc_em_meta.h \
+	netlink/cli/addr.h \
+	netlink/cli/class.h \
+	netlink/cli/cls.h \
+	netlink/cli/ct.h \
+	netlink/cli/link.h \
+	netlink/cli/neigh.h \
+	netlink/cli/qdisc.h \
+	netlink/cli/route.h \
+	netlink/cli/rule.h \
+	netlink/cli/tc.h \
+	netlink/cli/utils.h \
+	netlink/route/cls/basic.h \
+	netlink/route/cls/cgroup.h \
+	netlink/route/cls/ematch/cmp.h \
+	netlink/route/cls/ematch/meta.h \
+	netlink/route/cls/ematch/nbyte.h \
+	netlink/route/cls/ematch/text.h \
+	netlink/route/cls/ematch.h \
+	netlink/route/link/api.h \
+	netlink/route/pktloc.h \
+	netlink-generic.h \
+	netlink-local.h \
+	netlink-tc.h \
+	netlink-types.h
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 5999113..e8045b7 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -51,7 +51,6 @@ libnl_route_la_SOURCES = \
 	route/cls/fw.c route/cls/police.c route/cls/u32.c route/cls/basic.c \
 	route/cls/cgroup.c \
 	\
-	route/cls/ematch_syntax.c route/cls/ematch_grammar.c \
 	route/cls/ematch.c \
 	route/cls/ematch/container.c route/cls/ematch/cmp.c \
 	route/cls/ematch/nbyte.c route/cls/ematch/text.c \
@@ -67,8 +66,25 @@ libnl_route_la_SOURCES = \
 	\
 	fib_lookup/lookup.c fib_lookup/request.c \
 	\
-	route/pktloc_syntax.c route/pktloc_grammar.c route/pktloc.c
+	route/pktloc.c
 
+nodist_libnl_route_la_SOURCES = \
+	route/pktloc_syntax.c route/pktloc_syntax.h \
+	route/pktloc_grammar.c route/pktloc_grammar.h \
+	route/cls/ematch_syntax.c route/cls/ematch_syntax.h \
+	route/cls/ematch_grammar.c route/cls/ematch_grammar.h
+
+BUILT_SOURCES = \
+	route/cls/ematch_grammar.c \
+	route/cls/ematch_syntax.c \
+	route/pktloc_grammar.c \
+	route/pktloc_syntax.c
+
+EXTRA_DIST = \
+	route/pktloc_grammar.l \
+	route/pktloc_syntax.y \
+	route/cls/ematch_grammar.l \
+	route/cls/ematch_syntax.y
 
 if ENABLE_CLI
 nobase_pkglib_LTLIBRARIES = \
-- 
1.7.4.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/libnl/attachments/20110323/296100c8/attachment.sig>


More information about the libnl mailing list