netdev-dpdk: fix mbuf leaks
[cascardo/ovs.git] / lib / automake.mk
1 # Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Nicira, Inc.
2 #
3 # Copying and distribution of this file, with or without modification,
4 # are permitted in any medium without royalty provided the copyright
5 # notice and this notice are preserved.  This file is offered as-is,
6 # without warranty of any kind.
7
8 lib_LTLIBRARIES += lib/libopenvswitch.la
9
10 lib_libopenvswitch_la_LIBADD = $(SSL_LIBS)
11 lib_libopenvswitch_la_LIBADD += $(CAPNG_LDADD)
12
13 if WIN32
14 lib_libopenvswitch_la_LIBADD += ${PTHREAD_LIBS}
15 endif
16
17 lib_libopenvswitch_la_LDFLAGS = \
18         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
19         -Wl,--version-script=$(top_builddir)/lib/libopenvswitch.sym \
20         $(AM_LDFLAGS)
21
22 lib_libopenvswitch_la_SOURCES = \
23         lib/aes128.c \
24         lib/aes128.h \
25         lib/async-append.h \
26         lib/backtrace.c \
27         lib/backtrace.h \
28         lib/bfd.c \
29         lib/bfd.h \
30         lib/bitmap.h \
31         lib/bundle.c \
32         lib/bundle.h \
33         lib/byte-order.h \
34         lib/byteq.c \
35         lib/byteq.h \
36         lib/cfm.c \
37         lib/cfm.h \
38         lib/classifier.c \
39         lib/classifier.h \
40         lib/classifier-private.h \
41         lib/cmap.c \
42         lib/cmap.h \
43         lib/command-line.c \
44         lib/command-line.h \
45         lib/compiler.h \
46         lib/connectivity.c \
47         lib/connectivity.h \
48         lib/coverage.c \
49         lib/coverage.h \
50         lib/crc32c.c \
51         lib/crc32c.h \
52         lib/csum.c \
53         lib/csum.h \
54         lib/ct-dpif.c \
55         lib/ct-dpif.h \
56         lib/daemon.c \
57         lib/daemon.h \
58         lib/daemon-private.h \
59         lib/db-ctl-base.c \
60         lib/db-ctl-base.h \
61         lib/dhcp.h \
62         lib/dummy.c \
63         lib/dummy.h \
64         lib/dhparams.h \
65         lib/dirs.h \
66         lib/dpctl.c \
67         lib/dpctl.h \
68         lib/dp-packet.h \
69         lib/dp-packet.c \
70         lib/dpif-netdev.c \
71         lib/dpif-netdev.h \
72         lib/dpif-provider.h \
73         lib/dpif.c \
74         lib/dpif.h \
75         lib/heap.c \
76         lib/heap.h \
77         lib/dynamic-string.c \
78         lib/dynamic-string.h \
79         lib/entropy.c \
80         lib/entropy.h \
81         lib/fat-rwlock.c \
82         lib/fat-rwlock.h \
83         lib/fatal-signal.c \
84         lib/fatal-signal.h \
85         lib/flow.c \
86         lib/flow.h \
87         lib/geneve.h \
88         lib/guarded-list.c \
89         lib/guarded-list.h \
90         lib/hash.c \
91         lib/hash.h \
92         lib/hindex.c \
93         lib/hindex.h \
94         lib/hmap.c \
95         lib/hmap.h \
96         lib/hmapx.c \
97         lib/hmapx.h \
98         lib/id-pool.c \
99         lib/id-pool.h \
100         lib/jhash.c \
101         lib/jhash.h \
102         lib/json.c \
103         lib/json.h \
104         lib/jsonrpc.c \
105         lib/jsonrpc.h \
106         lib/lacp.c \
107         lib/lacp.h \
108         lib/latch.h \
109         lib/learn.c \
110         lib/learn.h \
111         lib/learning-switch.c \
112         lib/learning-switch.h \
113         lib/list.h \
114         lib/lockfile.c \
115         lib/lockfile.h \
116         lib/mac-learning.c \
117         lib/mac-learning.h \
118         lib/match.c \
119         lib/match.h \
120         lib/mcast-snooping.c \
121         lib/mcast-snooping.h \
122         lib/memory.c \
123         lib/memory.h \
124         lib/meta-flow.c \
125         lib/meta-flow.h \
126         lib/multipath.c \
127         lib/multipath.h \
128         lib/netdev-dummy.c \
129         lib/netdev-provider.h \
130         lib/netdev-vport.c \
131         lib/netdev-vport.h \
132         lib/netdev.c \
133         lib/netdev.h \
134         lib/netflow.h \
135         lib/netlink.c \
136         lib/netlink.h \
137         lib/nx-match.c \
138         lib/nx-match.h \
139         lib/odp-execute.c \
140         lib/odp-execute.h \
141         lib/odp-util.c \
142         lib/odp-util.h \
143         lib/ofp-actions.c \
144         lib/ofp-actions.h \
145         lib/ofp-errors.c \
146         lib/ofp-errors.h \
147         lib/ofp-msgs.c \
148         lib/ofp-msgs.h \
149         lib/ofp-parse.c \
150         lib/ofp-parse.h \
151         lib/ofp-print.c \
152         lib/ofp-print.h \
153         lib/ofp-prop.c \
154         lib/ofp-prop.h \
155         lib/ofp-util.c \
156         lib/ofp-util.h \
157         lib/ofp-version-opt.h \
158         lib/ofp-version-opt.c \
159         lib/ofpbuf.c \
160         lib/ofpbuf.h \
161         lib/ovs-atomic-c11.h \
162         lib/ovs-atomic-clang.h \
163         lib/ovs-atomic-flag-gcc4.7+.h \
164         lib/ovs-atomic-gcc4+.h \
165         lib/ovs-atomic-gcc4.7+.h \
166         lib/ovs-atomic-i586.h \
167         lib/ovs-atomic-locked.c \
168         lib/ovs-atomic-locked.h \
169         lib/ovs-atomic-msvc.h \
170         lib/ovs-atomic-pthreads.h \
171         lib/ovs-atomic-x86_64.h \
172         lib/ovs-atomic.h \
173         lib/ovs-lldp.c \
174         lib/ovs-lldp.h \
175         lib/ovs-rcu.c \
176         lib/ovs-rcu.h \
177         lib/ovs-router.h \
178         lib/ovs-router.c \
179         lib/ovs-thread.c \
180         lib/ovs-thread.h \
181         lib/ovsdb-data.c \
182         lib/ovsdb-data.h \
183         lib/ovsdb-error.c \
184         lib/ovsdb-error.h \
185         lib/ovsdb-idl-provider.h \
186         lib/ovsdb-idl.c \
187         lib/ovsdb-idl.h \
188         lib/ovsdb-parser.c \
189         lib/ovsdb-parser.h \
190         lib/ovsdb-types.c \
191         lib/ovsdb-types.h \
192         lib/packets.c \
193         lib/packets.h \
194         lib/pcap-file.c \
195         lib/pcap-file.h \
196         lib/perf-counter.h \
197         lib/perf-counter.c \
198         lib/pktbuf.c \
199         lib/pktbuf.h \
200         lib/poll-loop.c \
201         lib/poll-loop.h \
202         lib/process.c \
203         lib/process.h \
204         lib/pvector.c \
205         lib/pvector.h \
206         lib/random.c \
207         lib/random.h \
208         lib/rconn.c \
209         lib/rconn.h \
210         lib/rculist.h \
211         lib/reconnect.c \
212         lib/reconnect.h \
213         lib/rstp.c \
214         lib/rstp.h \
215         lib/rstp-common.h \
216         lib/rstp-state-machines.c \
217         lib/rstp-state-machines.h \
218         lib/sat-math.h \
219         lib/seq.c \
220         lib/seq.h \
221         lib/sha1.c \
222         lib/sha1.h \
223         lib/shash.c \
224         lib/shash.h \
225         lib/simap.c \
226         lib/simap.h \
227         lib/smap.c \
228         lib/smap.h \
229         lib/socket-util.c \
230         lib/socket-util.h \
231         lib/sort.c \
232         lib/sort.h \
233         lib/sset.c \
234         lib/sset.h \
235         lib/stp.c \
236         lib/stp.h \
237         lib/stream-fd.c \
238         lib/stream-fd.h \
239         lib/stream-provider.h \
240         lib/stream-ssl.h \
241         lib/stream-tcp.c \
242         lib/stream.c \
243         lib/stream.h \
244         lib/stdio.c \
245         lib/string.c \
246         lib/svec.c \
247         lib/svec.h \
248         lib/syslog-direct.c \
249         lib/syslog-direct.h \
250         lib/syslog-libc.c \
251         lib/syslog-libc.h \
252         lib/syslog-provider.h \
253         lib/table.c \
254         lib/table.h \
255         lib/timer.c \
256         lib/timer.h \
257         lib/timeval.c \
258         lib/timeval.h \
259         lib/tnl-neigh-cache.c \
260         lib/tnl-neigh-cache.h \
261         lib/tnl-ports.c \
262         lib/tnl-ports.h \
263         lib/token-bucket.c \
264         lib/tun-metadata.c \
265         lib/tun-metadata.h \
266         lib/type-props.h \
267         lib/unaligned.h \
268         lib/unicode.c \
269         lib/unicode.h \
270         lib/unixctl.c \
271         lib/unixctl.h \
272         lib/util.c \
273         lib/util.h \
274         lib/uuid.c \
275         lib/uuid.h \
276         lib/valgrind.h \
277         lib/vconn-provider.h \
278         lib/vconn-stream.c \
279         lib/vconn.c \
280         lib/vlan-bitmap.c \
281         lib/vlan-bitmap.h \
282         lib/vlandev.c \
283         lib/vlandev.h \
284         lib/vlog.c \
285         lib/lldp/aa-structs.h \
286         lib/lldp/lldp.c \
287         lib/lldp/lldp-const.h \
288         lib/lldp/lldp-tlv.h \
289         lib/lldp/lldpd.c \
290         lib/lldp/lldpd.h \
291         lib/lldp/lldpd-structs.c \
292         lib/lldp/lldpd-structs.h
293
294 if WIN32
295 lib_libopenvswitch_la_SOURCES += \
296         lib/daemon-windows.c \
297         lib/getopt_long.c \
298         lib/getrusage-windows.c \
299         lib/latch-windows.c \
300         lib/route-table-stub.c \
301         lib/if-notifier-stub.c \
302         lib/strsep.c
303 else
304 lib_libopenvswitch_la_SOURCES += \
305         lib/daemon-unix.c \
306         lib/latch-unix.c \
307         lib/signals.c \
308         lib/signals.h \
309         lib/socket-util-unix.c \
310         lib/stream-unix.c
311 endif
312
313 EXTRA_DIST += \
314         lib/stdio.h.in \
315         lib/string.h.in
316
317 nodist_lib_libopenvswitch_la_SOURCES = \
318         lib/dirs.c \
319         lib/vswitch-idl.c \
320         lib/vswitch-idl.h
321 CLEANFILES += $(nodist_lib_libopenvswitch_la_SOURCES)
322
323 lib_LTLIBRARIES += lib/libsflow.la
324 lib_libsflow_la_LDFLAGS = \
325         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
326         -Wl,--version-script=$(top_builddir)/lib/libsflow.sym \
327         $(AM_LDFLAGS)
328 lib_libsflow_la_SOURCES = \
329         lib/sflow_api.h \
330         lib/sflow.h \
331         lib/sflow_agent.c \
332         lib/sflow_sampler.c \
333         lib/sflow_poller.c \
334         lib/sflow_receiver.c
335 lib_libsflow_la_CPPFLAGS = $(AM_CPPFLAGS)
336 lib_libsflow_la_CFLAGS = $(AM_CFLAGS)
337 if HAVE_WNO_UNUSED
338 lib_libsflow_la_CFLAGS += -Wno-unused
339 endif
340 if HAVE_WNO_UNUSED_PARAMETER
341 lib_libsflow_la_CFLAGS += -Wno-unused-parameter
342 endif
343
344 if LINUX
345 lib_libopenvswitch_la_SOURCES += \
346         lib/dpif-netlink.c \
347         lib/dpif-netlink.h \
348         lib/if-notifier.c \
349         lib/if-notifier.h \
350         lib/netdev-linux.c \
351         lib/netdev-linux.h \
352         lib/netlink-conntrack.c \
353         lib/netlink-conntrack.h \
354         lib/netlink-notifier.c \
355         lib/netlink-notifier.h \
356         lib/netlink-protocol.h \
357         lib/netlink-socket.c \
358         lib/netlink-socket.h \
359         lib/ovs-numa.c \
360         lib/ovs-numa.h \
361         lib/rtnetlink.c \
362         lib/rtnetlink.h \
363         lib/route-table.c \
364         lib/route-table.h
365 endif
366
367 if DPDK_NETDEV
368 lib_libopenvswitch_la_SOURCES += \
369        lib/netdev-dpdk.c \
370        lib/netdev-dpdk.h
371 endif
372
373 if WIN32
374 lib_libopenvswitch_la_SOURCES += \
375         lib/dpif-netlink.c \
376         lib/dpif-netlink.h \
377         lib/netdev-windows.c \
378         lib/netlink-notifier.c \
379         lib/netlink-notifier.h \
380         lib/netlink-protocol.h \
381         lib/netlink-socket.c \
382         lib/netlink-socket.h
383 endif
384
385 if HAVE_POSIX_AIO
386 lib_libopenvswitch_la_SOURCES += lib/async-append-aio.c
387 else
388 lib_libopenvswitch_la_SOURCES += lib/async-append-null.c
389 endif
390
391 if ESX
392 lib_libopenvswitch_la_SOURCES += \
393         lib/route-table-stub.c \
394         lib/if-notifier-stub.c
395 endif
396
397 if HAVE_IF_DL
398 lib_libopenvswitch_la_SOURCES += \
399         lib/if-notifier-bsd.c \
400         lib/netdev-bsd.c \
401         lib/rtbsd.c \
402         lib/rtbsd.h \
403         lib/route-table-bsd.c
404 endif
405
406 if HAVE_OPENSSL
407 lib_libopenvswitch_la_SOURCES += lib/stream-ssl.c
408 nodist_lib_libopenvswitch_la_SOURCES += lib/dhparams.c
409 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
410         $(AM_V_GEN)(echo '#include "lib/dhparams.h"' &&                 \
411          openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout &&      \
412          openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout &&      \
413          openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout)        \
414         | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp &&  \
415         mv lib/dhparams.c.tmp lib/dhparams.c
416 else
417 lib_libopenvswitch_la_SOURCES += lib/stream-nossl.c
418 endif
419
420 pkgconfig_DATA += \
421         $(srcdir)/lib/libopenvswitch.pc \
422         $(srcdir)/lib/libsflow.pc
423
424 EXTRA_DIST += \
425         lib/dh1024.pem \
426         lib/dh2048.pem \
427         lib/dh4096.pem \
428         lib/dirs.c.in \
429         lib/db-ctl-base.xml
430
431 MAN_FRAGMENTS += \
432         lib/common.man \
433         lib/common-syn.man \
434         lib/coverage-unixctl.man \
435         lib/daemon.man \
436         lib/daemon-syn.man \
437         lib/db-ctl-base.man \
438         lib/dpctl.man \
439         lib/memory-unixctl.man \
440         lib/ofp-version.man \
441         lib/ovs.tmac \
442         lib/service.man \
443         lib/service-syn.man \
444         lib/ssl-bootstrap.man \
445         lib/ssl-bootstrap-syn.man \
446         lib/ssl-peer-ca-cert.man \
447         lib/ssl-peer-ca-cert-syn.man \
448         lib/ssl.man \
449         lib/ssl-syn.man \
450         lib/table.man \
451         lib/unixctl.man \
452         lib/unixctl-syn.man \
453         lib/vconn-active.man \
454         lib/vconn-passive.man \
455         lib/vlog-unixctl.man \
456         lib/vlog-syn.man \
457         lib/vlog.man
458
459 # vswitch IDL
460 OVSIDL_BUILT += lib/vswitch-idl.c lib/vswitch-idl.h lib/vswitch-idl.ovsidl
461
462 EXTRA_DIST += lib/vswitch-idl.ann
463 lib/vswitch-idl.ovsidl: vswitchd/vswitch.ovsschema lib/vswitch-idl.ann
464         $(AM_V_GEN)$(OVSDB_IDLC) annotate $(srcdir)/vswitchd/vswitch.ovsschema $(srcdir)/lib/vswitch-idl.ann > $@.tmp && mv $@.tmp $@
465
466 lib/dirs.c: lib/dirs.c.in Makefile
467         $(AM_V_GEN)($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
468                 -e 's,[@]srcdir[@],$(srcdir),g' \
469                 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
470                 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
471                 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
472                 -e 's,[@]bindir[@],"$(bindir)",g' \
473                 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
474                 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
475              > lib/dirs.c.tmp && \
476         mv lib/dirs.c.tmp lib/dirs.c
477
478 lib/meta-flow.inc: $(srcdir)/build-aux/extract-ofp-fields lib/meta-flow.h
479         $(AM_V_GEN)$(run_python) $^ --meta-flow > $@.tmp && mv $@.tmp $@
480 lib/meta-flow.lo: lib/meta-flow.inc
481 lib/nx-match.inc: $(srcdir)/build-aux/extract-ofp-fields lib/meta-flow.h
482         $(AM_V_GEN)$(run_python) $^ --nx-match > $@.tmp && mv $@.tmp $@
483 lib/nx-match.lo: lib/nx-match.inc
484 CLEANFILES += lib/meta-flow.inc lib/nx-match.inc
485 EXTRA_DIST += build-aux/extract-ofp-fields
486
487 lib/ofp-actions.inc1: $(srcdir)/build-aux/extract-ofp-actions lib/ofp-actions.c
488         $(AM_V_GEN)$(run_python) $^ --prototypes > $@.tmp && mv $@.tmp $@
489 lib/ofp-actions.inc2: $(srcdir)/build-aux/extract-ofp-actions lib/ofp-actions.c
490         $(AM_V_GEN)$(run_python) $^ --definitions > $@.tmp && mv $@.tmp $@
491 lib/ofp-actions.lo: lib/ofp-actions.inc1 lib/ofp-actions.inc2
492 CLEANFILES += lib/ofp-actions.inc1 lib/ofp-actions.inc2
493 EXTRA_DIST += build-aux/extract-ofp-actions
494
495 lib/ofp-errors.inc: lib/ofp-errors.h include/openflow/openflow-common.h \
496         $(srcdir)/build-aux/extract-ofp-errors
497         $(AM_V_GEN)$(run_python) $(srcdir)/build-aux/extract-ofp-errors \
498                 $(srcdir)/lib/ofp-errors.h \
499                 $(srcdir)/include/openflow/openflow-common.h > $@.tmp && \
500         mv $@.tmp $@
501 lib/ofp-errors.lo: lib/ofp-errors.inc
502 CLEANFILES += lib/ofp-errors.inc
503 EXTRA_DIST += build-aux/extract-ofp-errors
504
505 lib/ofp-msgs.inc: lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
506         $(AM_V_GEN)$(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
507                 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
508 lib/ofp-msgs.lo: lib/ofp-msgs.inc
509 CLEANFILES += lib/ofp-msgs.inc
510 EXTRA_DIST += build-aux/extract-ofp-msgs
511
512 INSTALL_DATA_LOCAL += lib-install-data-local
513 lib-install-data-local:
514         $(MKDIR_P) $(DESTDIR)$(RUNDIR)
515         $(MKDIR_P) $(DESTDIR)$(PKIDIR)
516         $(MKDIR_P) $(DESTDIR)$(LOGDIR)
517         $(MKDIR_P) $(DESTDIR)$(DBDIR)
518