configure: Include pthread-win32 libraries for Windows build.
[sliver-openvswitch.git] / lib / automake.mk
1 # Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 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
12 if WIN32
13 lib_libopenvswitch_la_LIBADD += ${PTHREAD_LIBS}
14 endif
15
16 lib_libopenvswitch_la_LDFLAGS = -release $(VERSION)
17
18 lib_libopenvswitch_la_SOURCES = \
19         lib/aes128.c \
20         lib/aes128.h \
21         lib/async-append.h \
22         lib/backtrace.c \
23         lib/backtrace.h \
24         lib/bfd.c \
25         lib/bfd.h \
26         lib/bitmap.c \
27         lib/bitmap.h \
28         lib/bundle.c \
29         lib/bundle.h \
30         lib/byte-order.h \
31         lib/byteq.c \
32         lib/byteq.h \
33         lib/cfm.c \
34         lib/cfm.h \
35         lib/classifier.c \
36         lib/classifier.h \
37         lib/command-line.c \
38         lib/command-line.h \
39         lib/compiler.h \
40         lib/connectivity.c \
41         lib/connectivity.h \
42         lib/coverage.c \
43         lib/coverage.h \
44         lib/crc32c.c \
45         lib/crc32c.h \
46         lib/csum.c \
47         lib/csum.h \
48         lib/daemon.h \
49         lib/dhcp.h \
50         lib/dummy.c \
51         lib/dummy.h \
52         lib/dhparams.h \
53         lib/dirs.h \
54         lib/dpif-netdev.c \
55         lib/dpif-provider.h \
56         lib/dpif.c \
57         lib/dpif.h \
58         lib/heap.c \
59         lib/heap.h \
60         lib/dynamic-string.c \
61         lib/dynamic-string.h \
62         lib/entropy.c \
63         lib/entropy.h \
64         lib/fat-rwlock.c \
65         lib/fat-rwlock.h \
66         lib/fatal-signal.c \
67         lib/fatal-signal.h \
68         lib/flow.c \
69         lib/flow.h \
70         lib/guarded-list.c \
71         lib/guarded-list.h \
72         lib/hash.c \
73         lib/hash.h \
74         lib/hindex.c \
75         lib/hindex.h \
76         lib/hmap.c \
77         lib/hmap.h \
78         lib/hmapx.c \
79         lib/hmapx.h \
80         lib/jhash.c \
81         lib/jhash.h \
82         lib/json.c \
83         lib/json.h \
84         lib/jsonrpc.c \
85         lib/jsonrpc.h \
86         lib/lacp.c \
87         lib/lacp.h \
88         lib/latch.h \
89         lib/learn.c \
90         lib/learn.h \
91         lib/learning-switch.c \
92         lib/learning-switch.h \
93         lib/list.c \
94         lib/list.h \
95         lib/lockfile.c \
96         lib/lockfile.h \
97         lib/mac-learning.c \
98         lib/mac-learning.h \
99         lib/match.c \
100         lib/match.h \
101         lib/memory.c \
102         lib/memory.h \
103         lib/meta-flow.c \
104         lib/meta-flow.h \
105         lib/multipath.c \
106         lib/multipath.h \
107         lib/netdev-dummy.c \
108         lib/netdev-provider.h \
109         lib/netdev-vport.c \
110         lib/netdev-vport.h \
111         lib/netdev.c \
112         lib/netdev.h \
113         lib/netflow.h \
114         lib/netlink.c \
115         lib/netlink.h \
116         lib/nx-match.c \
117         lib/nx-match.h \
118         lib/odp-execute.c \
119         lib/odp-execute.h \
120         lib/odp-util.c \
121         lib/odp-util.h \
122         lib/ofp-actions.c \
123         lib/ofp-actions.h \
124         lib/ofp-errors.c \
125         lib/ofp-errors.h \
126         lib/ofp-msgs.c \
127         lib/ofp-msgs.h \
128         lib/ofp-parse.c \
129         lib/ofp-parse.h \
130         lib/ofp-print.c \
131         lib/ofp-print.h \
132         lib/ofp-util.c \
133         lib/ofp-util.def \
134         lib/ofp-util.h \
135         lib/ofp-version-opt.h \
136         lib/ofp-version-opt.c \
137         lib/ofpbuf.c \
138         lib/ofpbuf.h \
139         lib/ovs-atomic-c11.h \
140         lib/ovs-atomic-clang.h \
141         lib/ovs-atomic-flag-gcc4.7+.h \
142         lib/ovs-atomic-gcc4+.c \
143         lib/ovs-atomic-gcc4+.h \
144         lib/ovs-atomic-gcc4.7+.h \
145         lib/ovs-atomic-pthreads.c \
146         lib/ovs-atomic-pthreads.h \
147         lib/ovs-atomic.h \
148         lib/ovs-thread.c \
149         lib/ovs-thread.h \
150         lib/ovsdb-data.c \
151         lib/ovsdb-data.h \
152         lib/ovsdb-error.c \
153         lib/ovsdb-error.h \
154         lib/ovsdb-idl-provider.h \
155         lib/ovsdb-idl.c \
156         lib/ovsdb-idl.h \
157         lib/ovsdb-parser.c \
158         lib/ovsdb-parser.h \
159         lib/ovsdb-types.c \
160         lib/ovsdb-types.h \
161         lib/packets.c \
162         lib/packets.h \
163         lib/pcap-file.c \
164         lib/pcap-file.h \
165         lib/poll-loop.c \
166         lib/poll-loop.h \
167         lib/process.c \
168         lib/process.h \
169         lib/random.c \
170         lib/random.h \
171         lib/rconn.c \
172         lib/rconn.h \
173         lib/reconnect.c \
174         lib/reconnect.h \
175         lib/sat-math.h \
176         lib/seq.c \
177         lib/seq.h \
178         lib/sha1.c \
179         lib/sha1.h \
180         lib/shash.c \
181         lib/shash.h \
182         lib/simap.c \
183         lib/simap.h \
184         lib/smap.c \
185         lib/smap.h \
186         lib/socket-util.c \
187         lib/socket-util.h \
188         lib/sort.c \
189         lib/sort.h \
190         lib/sset.c \
191         lib/sset.h \
192         lib/stp.c \
193         lib/stp.h \
194         lib/stream-fd.h \
195         lib/stream-provider.h \
196         lib/stream-ssl.h \
197         lib/stream-tcp.c \
198         lib/stream.c \
199         lib/stream.h \
200         lib/stdio.c \
201         lib/string.c \
202         lib/svec.c \
203         lib/svec.h \
204         lib/table.c \
205         lib/table.h \
206         lib/tag.c \
207         lib/tag.h \
208         lib/timer.c \
209         lib/timer.h \
210         lib/timeval.c \
211         lib/timeval.h \
212         lib/token-bucket.c \
213         lib/token-bucket.h \
214         lib/type-props.h \
215         lib/unaligned.h \
216         lib/unicode.c \
217         lib/unicode.h \
218         lib/unixctl.c \
219         lib/unixctl.h \
220         lib/util.c \
221         lib/util.h \
222         lib/uuid.c \
223         lib/uuid.h \
224         lib/valgrind.h \
225         lib/vconn-provider.h \
226         lib/vconn-stream.c \
227         lib/vconn.c \
228         lib/vconn.h \
229         lib/vlan-bitmap.c \
230         lib/vlan-bitmap.h \
231         lib/vlandev.c \
232         lib/vlandev.h \
233         lib/vlog.c \
234         lib/vlog.h \
235         lib/vswitch-idl.c \
236         lib/vswitch-idl.h \
237         lib/vtep-idl.c \
238         lib/vtep-idl.h
239
240 if WIN32
241 lib_libopenvswitch_la_SOURCES += \
242         lib/daemon-windows.c \
243         lib/getopt_long.c \
244         lib/getrusage-windows.c \
245         lib/latch-windows.c \
246         lib/stream-fd-windows.c
247 else
248 lib_libopenvswitch_la_SOURCES += \
249         lib/daemon.c \
250         lib/latch-unix.c \
251         lib/signals.c \
252         lib/signals.h \
253         lib/stream-fd-unix.c \
254         lib/stream-unix.c
255 endif
256
257 EXTRA_DIST += \
258         lib/stdio.h.in \
259         lib/string.h.in
260
261 nodist_lib_libopenvswitch_la_SOURCES = \
262         lib/dirs.c
263 CLEANFILES += $(nodist_lib_libopenvswitch_la_SOURCES)
264
265 lib_LTLIBRARIES += lib/libsflow.la
266 lib_libsflow_la_LDFLAGS = -release $(VERSION)
267 lib_libsflow_la_SOURCES = \
268         lib/sflow_api.h \
269         lib/sflow.h \
270         lib/sflow_agent.c \
271         lib/sflow_sampler.c \
272         lib/sflow_poller.c \
273         lib/sflow_receiver.c
274 lib_libsflow_la_CPPFLAGS = $(AM_CPPFLAGS)
275 lib_libsflow_la_CFLAGS = $(AM_CFLAGS)
276 if HAVE_WNO_UNUSED
277 lib_libsflow_la_CFLAGS += -Wno-unused
278 endif
279 if HAVE_WNO_UNUSED_PARAMETER
280 lib_libsflow_la_CFLAGS += -Wno-unused-parameter
281 endif
282
283 if LINUX
284 lib_libopenvswitch_la_SOURCES += \
285         lib/dpif-linux.c \
286         lib/dpif-linux.h \
287         lib/netdev-linux.c \
288         lib/netdev-linux.h \
289         lib/netlink-notifier.c \
290         lib/netlink-notifier.h \
291         lib/netlink-protocol.h \
292         lib/netlink-socket.c \
293         lib/netlink-socket.h \
294         lib/rtnetlink-link.c \
295         lib/rtnetlink-link.h \
296         lib/route-table.c \
297         lib/route-table.h
298 endif
299
300 if HAVE_POSIX_AIO
301 lib_libopenvswitch_la_SOURCES += lib/async-append-aio.c
302 else
303 lib_libopenvswitch_la_SOURCES += lib/async-append-null.c
304 endif
305
306 if ESX
307 lib_libopenvswitch_la_SOURCES += \
308         lib/route-table-stub.c
309 endif
310
311 if HAVE_IF_DL
312 lib_libopenvswitch_la_SOURCES += \
313         lib/netdev-bsd.c \
314         lib/rtbsd.c \
315         lib/rtbsd.h \
316         lib/route-table-bsd.c
317 endif
318
319 if HAVE_OPENSSL
320 lib_libopenvswitch_la_SOURCES += lib/stream-ssl.c
321 nodist_lib_libopenvswitch_la_SOURCES += lib/dhparams.c
322 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
323         (echo '#include "lib/dhparams.h"' &&                            \
324          openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout &&      \
325          openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout &&      \
326          openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout)        \
327         | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
328         mv lib/dhparams.c.tmp lib/dhparams.c
329 else
330 lib_libopenvswitch_la_SOURCES += lib/stream-nossl.c
331 endif
332
333 EXTRA_DIST += \
334         lib/dh1024.pem \
335         lib/dh2048.pem \
336         lib/dh4096.pem \
337         lib/dirs.c.in
338
339 MAN_FRAGMENTS += \
340         lib/common.man \
341         lib/common-syn.man \
342         lib/coverage-unixctl.man \
343         lib/daemon.man \
344         lib/daemon-syn.man \
345         lib/memory-unixctl.man \
346         lib/ofp-version.man \
347         lib/ovs.tmac \
348         lib/service.man \
349         lib/service-syn.man \
350         lib/ssl-bootstrap.man \
351         lib/ssl-bootstrap-syn.man \
352         lib/ssl-peer-ca-cert.man \
353         lib/ssl.man \
354         lib/ssl-syn.man \
355         lib/table.man \
356         lib/unixctl.man \
357         lib/unixctl-syn.man \
358         lib/vconn-active.man \
359         lib/vconn-passive.man \
360         lib/vlog-unixctl.man \
361         lib/vlog-syn.man \
362         lib/vlog.man
363
364 # vswitch IDL
365 OVSIDL_BUILT += \
366         $(srcdir)/lib/vswitch-idl.c \
367         $(srcdir)/lib/vswitch-idl.h \
368         $(srcdir)/lib/vswitch-idl.ovsidl \
369         $(srcdir)/lib/vtep-idl.c \
370         $(srcdir)/lib/vtep-idl.h \
371         $(srcdir)/lib/vtep-idl.ovsidl
372
373 EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
374 VSWITCH_IDL_FILES = \
375         $(srcdir)/vswitchd/vswitch.ovsschema \
376         $(srcdir)/lib/vswitch-idl.ann
377 $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
378         $(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp
379         mv $@.tmp $@
380
381 EXTRA_DIST += $(srcdir)/lib/vtep-idl.ann
382 VTEP_IDL_FILES = \
383         $(srcdir)/vtep/vtep.ovsschema \
384         $(srcdir)/lib/vtep-idl.ann
385 $(srcdir)/lib/vtep-idl.ovsidl: $(VTEP_IDL_FILES)
386         $(OVSDB_IDLC) annotate $(VTEP_IDL_FILES) > $@.tmp
387         mv $@.tmp $@
388
389 lib/dirs.c: lib/dirs.c.in Makefile
390         ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
391                 -e 's,[@]srcdir[@],$(srcdir),g' \
392                 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
393                 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
394                 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
395                 -e 's,[@]bindir[@],"$(bindir)",g' \
396                 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
397                 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
398              > lib/dirs.c.tmp
399         mv lib/dirs.c.tmp lib/dirs.c
400
401 $(srcdir)/lib/ofp-errors.inc: \
402         lib/ofp-errors.h include/openflow/openflow-common.h \
403         $(srcdir)/build-aux/extract-ofp-errors
404         $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
405                 $(srcdir)/lib/ofp-errors.h \
406                 $(srcdir)/include/openflow/openflow-common.h > $@.tmp
407         mv $@.tmp $@
408 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
409 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
410
411 $(srcdir)/lib/ofp-msgs.inc: \
412         lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
413         $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
414                 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
415 $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
416 EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
417
418 INSTALL_DATA_LOCAL += lib-install-data-local
419 lib-install-data-local:
420         $(MKDIR_P) $(DESTDIR)$(RUNDIR)
421         $(MKDIR_P) $(DESTDIR)$(PKIDIR)
422         $(MKDIR_P) $(DESTDIR)$(LOGDIR)
423         $(MKDIR_P) $(DESTDIR)$(DBDIR)
424