summaryrefslogtreecommitdiff
path: root/include/openvswitch/automake.mk
blob: 0cc1f569e0a2a8642e6de7c1f0a5e16ff698aebc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
openvswitchincludedir = $(includedir)/openvswitch
openvswitchinclude_HEADERS = \
	include/openvswitch/compiler.h \
	include/openvswitch/dynamic-string.h \
	include/openvswitch/hmap.h \
	include/openvswitch/flow.h \
	include/openvswitch/geneve.h \
	include/openvswitch/json.h \
	include/openvswitch/list.h \
	include/openvswitch/netdev.h \
	include/openvswitch/match.h \
	include/openvswitch/meta-flow.h \
	include/openvswitch/namemap.h \
	include/openvswitch/ofpbuf.h \
	include/openvswitch/ofp-actions.h \
	include/openvswitch/ofp-bundle.h \
	include/openvswitch/ofp-connection.h \
	include/openvswitch/ofp-ct.h \
	include/openvswitch/ofp-ed-props.h \
	include/openvswitch/ofp-errors.h \
	include/openvswitch/ofp-flow.h \
	include/openvswitch/ofp-group.h \
	include/openvswitch/ofp-ipfix.h \
	include/openvswitch/ofp-match.h \
	include/openvswitch/ofp-meter.h \
	include/openvswitch/ofp-monitor.h \
	include/openvswitch/ofp-msgs.h \
	include/openvswitch/ofp-packet.h \
	include/openvswitch/ofp-parse.h \
	include/openvswitch/ofp-port.h \
	include/openvswitch/ofp-print.h \
	include/openvswitch/ofp-prop.h \
	include/openvswitch/ofp-protocol.h \
	include/openvswitch/ofp-queue.h \
	include/openvswitch/ofp-switch.h \
	include/openvswitch/ofp-table.h \
	include/openvswitch/ofp-util.h \
	include/openvswitch/packets.h \
	include/openvswitch/poll-loop.h \
	include/openvswitch/rconn.h \
	include/openvswitch/shash.h \
	include/openvswitch/thread.h \
	include/openvswitch/token-bucket.h \
	include/openvswitch/tun-metadata.h \
	include/openvswitch/type-props.h \
	include/openvswitch/types.h \
	include/openvswitch/usdt-probes.h \
	include/openvswitch/util.h \
	include/openvswitch/uuid.h \
	include/openvswitch/version.h \
	include/openvswitch/vconn.h \
	include/openvswitch/vlog.h \
	include/openvswitch/nsh.h

if HAVE_CXX
# OVS does not use C++ itself, but it provides public header files
# that a C++ compiler should accept, so when --enable-Werror is in
# effect and a C++ compiler is available, we build a C++ source file
# that #includes all the public headers, as a way to ensure that they
# are acceptable as C++.
noinst_LTLIBRARIES += include/openvswitch/libcxxtest.la
nodist_include_openvswitch_libcxxtest_la_SOURCES = include/openvswitch/cxxtest.cc
include/openvswitch/cxxtest.cc: \
	include/openvswitch/automake.mk $(top_builddir)/config.status
	$(AM_V_GEN){ echo "#include <config.h>"; \
	for header in $(openvswitchinclude_HEADERS); do	\
	  echo $$header; \
	done | sed 's,^include/\(.*\)$$,#include <\1>,'; } > $@
CLEANFILES += include/openvswitch/cxxtest.cc
endif

# OVS does not use C++ itself, but it provides public header files
# that a C++ compiler should accept, so we make sure that every public
# header file has the proper extern declaration for use with C++.
#
# Some header files don't declare any external functions, so they
# don't really need extern "C".  We only permit a couple of these
# below, which are the ones that seem unlikely to ever declare
# external functions.  For the rest, we add extern "C" anyway; it
# doesn't hurt.
ALL_LOCAL += cxx-check
cxx-check: $(openvswitchinclude_HEADERS)
	@if LC_ALL=C grep -L 'extern "C"' $^ | \
          $(EGREP) -v 'version.h|compiler.h'; \
	then \
	    echo "See above list of public headers lacking 'extern \"C\"'."; \
	    exit 1; \
	fi
	$(AM_V_GEN)touch $@
CLEANFILES += cxx-check