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