socket-util: Remove 'passcred' parameter from make_unix_socket().
[openvswitch] / lib / automake.mk
1 # Copyright (C) 2009, 2010, 2011, 2012 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 noinst_LIBRARIES += lib/libopenvswitch.a
9
10 lib_libopenvswitch_a_SOURCES = \
11         lib/aes128.c \
12         lib/aes128.h \
13         lib/autopath.c \
14         lib/autopath.h \
15         lib/backtrace.c \
16         lib/backtrace.h \
17         lib/bitmap.c \
18         lib/bitmap.h \
19         lib/bond.c \
20         lib/bond.h \
21         lib/bundle.c \
22         lib/bundle.h \
23         lib/byte-order.h \
24         lib/byteq.c \
25         lib/byteq.h \
26         lib/cfm.c \
27         lib/cfm.h \
28         lib/classifier.c \
29         lib/classifier.h \
30         lib/command-line.c \
31         lib/command-line.h \
32         lib/compiler.h \
33         lib/coverage.c \
34         lib/coverage.h \
35         lib/csum.c \
36         lib/csum.h \
37         lib/daemon.c \
38         lib/daemon.h \
39         lib/dhcp.h \
40         lib/dummy.c \
41         lib/dummy.h \
42         lib/dhparams.h \
43         lib/dirs.h \
44         lib/dpif-netdev.c \
45         lib/dpif-provider.h \
46         lib/dpif.c \
47         lib/dpif.h \
48         lib/heap.c \
49         lib/heap.h \
50         lib/dynamic-string.c \
51         lib/dynamic-string.h \
52         lib/entropy.c \
53         lib/entropy.h \
54         lib/fatal-signal.c \
55         lib/fatal-signal.h \
56         lib/flow.c \
57         lib/flow.h \
58         lib/hash.c \
59         lib/hash.h \
60         lib/hmap.c \
61         lib/hmap.h \
62         lib/hmapx.c \
63         lib/hmapx.h \
64         lib/json.c \
65         lib/json.h \
66         lib/jsonrpc.c \
67         lib/jsonrpc.h \
68         lib/lacp.c \
69         lib/lacp.h \
70         lib/leak-checker.c \
71         lib/leak-checker.h \
72         lib/learn.c \
73         lib/learn.h \
74         lib/learning-switch.c \
75         lib/learning-switch.h \
76         lib/list.c \
77         lib/list.h \
78         lib/lockfile.c \
79         lib/lockfile.h \
80         lib/mac-learning.c \
81         lib/mac-learning.h \
82         lib/memory.c \
83         lib/memory.h \
84         lib/meta-flow.c \
85         lib/meta-flow.h \
86         lib/multipath.c \
87         lib/multipath.h \
88         lib/netdev-dummy.c \
89         lib/netdev-provider.h \
90         lib/netdev.c \
91         lib/netdev.h \
92         lib/netflow.h \
93         lib/netlink.c \
94         lib/netlink.h \
95         lib/nx-match.c \
96         lib/nx-match.h \
97         lib/odp-util.c \
98         lib/odp-util.h \
99         lib/ofp-actions.c \
100         lib/ofp-actions.h \
101         lib/ofp-errors.c \
102         lib/ofp-errors.h \
103         lib/ofp-parse.c \
104         lib/ofp-parse.h \
105         lib/ofp-print.c \
106         lib/ofp-print.h \
107         lib/ofp-util.c \
108         lib/ofp-util.def \
109         lib/ofp-util.h \
110         lib/ofpbuf.c \
111         lib/ofpbuf.h \
112         lib/ovsdb-data.c \
113         lib/ovsdb-data.h \
114         lib/ovsdb-error.c \
115         lib/ovsdb-error.h \
116         lib/ovsdb-idl-provider.h \
117         lib/ovsdb-idl.c \
118         lib/ovsdb-idl.h \
119         lib/ovsdb-parser.c \
120         lib/ovsdb-parser.h \
121         lib/ovsdb-types.c \
122         lib/ovsdb-types.h \
123         lib/packets.c \
124         lib/packets.h \
125         lib/pcap.c \
126         lib/pcap.h \
127         lib/poll-loop.c \
128         lib/poll-loop.h \
129         lib/process.c \
130         lib/process.h \
131         lib/random.c \
132         lib/random.h \
133         lib/rconn.c \
134         lib/rconn.h \
135         lib/reconnect.c \
136         lib/reconnect.h \
137         lib/sat-math.h \
138         lib/sha1.c \
139         lib/sha1.h \
140         lib/shash.c \
141         lib/shash.h \
142         lib/simap.c \
143         lib/simap.h \
144         lib/signals.c \
145         lib/signals.h \
146         lib/smap.c \
147         lib/smap.h \
148         lib/socket-util.c \
149         lib/socket-util.h \
150         lib/sort.c \
151         lib/sort.h \
152         lib/sset.c \
153         lib/sset.h \
154         lib/stp.c \
155         lib/stp.h \
156         lib/stream-fd.c \
157         lib/stream-fd.h \
158         lib/stream-provider.h \
159         lib/stream-ssl.h \
160         lib/stream-tcp.c \
161         lib/stream-unix.c \
162         lib/stream.c \
163         lib/stream.h \
164         lib/stress.c \
165         lib/stress.h \
166         lib/string.c \
167         lib/string.h \
168         lib/svec.c \
169         lib/svec.h \
170         lib/table.c \
171         lib/table.h \
172         lib/tag.c \
173         lib/tag.h \
174         lib/timer.c \
175         lib/timer.h \
176         lib/timeval.c \
177         lib/timeval.h \
178         lib/token-bucket.c \
179         lib/token-bucket.h \
180         lib/type-props.h \
181         lib/unaligned.h \
182         lib/unicode.c \
183         lib/unicode.h \
184         lib/unixctl.c \
185         lib/unixctl.h \
186         lib/util.c \
187         lib/util.h \
188         lib/uuid.c \
189         lib/uuid.h \
190         lib/valgrind.h \
191         lib/vconn-provider.h \
192         lib/vconn-stream.c \
193         lib/vconn.c \
194         lib/vconn.h \
195         lib/vlan-bitmap.c \
196         lib/vlan-bitmap.h \
197         lib/vlandev.c \
198         lib/vlandev.h \
199         lib/vlog.c \
200         lib/vlog.h \
201         lib/vswitch-idl.c \
202         lib/vswitch-idl.h
203
204 nodist_lib_libopenvswitch_a_SOURCES = \
205         lib/dirs.c
206 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
207
208 noinst_LIBRARIES += lib/libsflow.a
209 lib_libsflow_a_SOURCES = \
210         lib/sflow_api.h \
211         lib/sflow.h \
212         lib/sflow_agent.c \
213         lib/sflow_sampler.c \
214         lib/sflow_poller.c \
215         lib/sflow_receiver.c
216 lib_libsflow_a_CFLAGS = $(AM_CFLAGS)
217 if HAVE_WNO_UNUSED
218 lib_libsflow_a_CFLAGS += -Wno-unused
219 endif
220 if HAVE_WNO_UNUSED_PARAMETER
221 lib_libsflow_a_CFLAGS += -Wno-unused-parameter
222 endif
223
224 if HAVE_NETLINK
225 lib_libopenvswitch_a_SOURCES += \
226         lib/dpif-linux.c \
227         lib/dpif-linux.h \
228         lib/netdev-linux.c \
229         lib/netdev-linux.h \
230         lib/netdev-vport.c \
231         lib/netdev-vport.h \
232         lib/netlink-notifier.c \
233         lib/netlink-notifier.h \
234         lib/netlink-protocol.h \
235         lib/netlink-socket.c \
236         lib/netlink-socket.h \
237         lib/rtnetlink-link.c \
238         lib/rtnetlink-link.h \
239         lib/route-table.c \
240         lib/route-table.h
241 endif
242
243 if HAVE_IF_DL
244 lib_libopenvswitch_a_SOURCES += \
245         lib/route-table-bsd.c
246 endif
247
248 if HAVE_OPENSSL
249 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
250 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
251 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
252         (echo '#include "lib/dhparams.h"' &&                            \
253          openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout &&      \
254          openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout &&      \
255          openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout)        \
256         | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
257         mv lib/dhparams.c.tmp lib/dhparams.c
258 else
259 lib_libopenvswitch_a_SOURCES += lib/stream-nossl.c
260 endif
261
262 EXTRA_DIST += \
263         lib/dh1024.pem \
264         lib/dh2048.pem \
265         lib/dh4096.pem \
266         lib/dirs.c.in
267
268 MAN_FRAGMENTS += \
269         lib/common.man \
270         lib/common-syn.man \
271         lib/coverage-unixctl.man \
272         lib/daemon.man \
273         lib/daemon-syn.man \
274         lib/leak-checker.man \
275         lib/memory-unixctl.man \
276         lib/ovs.tmac \
277         lib/ssl-bootstrap.man \
278         lib/ssl-bootstrap-syn.man \
279         lib/ssl-peer-ca-cert.man \
280         lib/ssl.man \
281         lib/ssl-syn.man \
282         lib/stress-unixctl.man \
283         lib/table.man \
284         lib/unixctl.man \
285         lib/unixctl-syn.man \
286         lib/vconn-active.man \
287         lib/vconn-passive.man \
288         lib/vlog-unixctl.man \
289         lib/vlog-syn.man \
290         lib/vlog.man
291
292 # vswitch IDL
293 OVSIDL_BUILT += \
294         lib/vswitch-idl.c \
295         lib/vswitch-idl.h \
296         lib/vswitch-idl.ovsidl
297
298 EXTRA_DIST += lib/vswitch-idl.ann
299 VSWITCH_IDL_FILES = vswitchd/vswitch.ovsschema lib/vswitch-idl.ann
300 lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
301         $(OVSDB_IDLC) -C $(srcdir) annotate $(VSWITCH_IDL_FILES) > $@.tmp
302         mv $@.tmp $@
303
304 lib/dirs.c: lib/dirs.c.in Makefile
305         ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
306                 -e 's,[@]srcdir[@],$(srcdir),g' \
307                 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
308                 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
309                 -e 's,[@]bindir[@],"$(bindir)",g' \
310                 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
311                 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
312              > lib/dirs.c.tmp
313         mv lib/dirs.c.tmp lib/dirs.c
314
315 $(srcdir)/lib/ofp-errors.inc: \
316         lib/ofp-errors.h $(srcdir)/build-aux/extract-ofp-errors
317         $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
318                 $(srcdir)/lib/ofp-errors.h > $@.tmp && mv $@.tmp $@
319 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
320 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
321
322 INSTALL_DATA_LOCAL += lib-install-data-local
323 lib-install-data-local:
324         $(MKDIR_P) $(DESTDIR)$(RUNDIR)
325         $(MKDIR_P) $(DESTDIR)$(PKIDIR)
326         $(MKDIR_P) $(DESTDIR)$(LOGDIR)
327
328 if !USE_LINKER_SECTIONS
329 # All distributed sources, with names adjust properly for referencing
330 # from $(builddir).
331 all_sources = \
332         `for file in $(DIST_SOURCES); do \
333                 if test -f $$file; then \
334                         echo $$file; \
335                 else \
336                         echo $(VPATH)/$$file; \
337                 fi; \
338          done`
339
340 lib/coverage.$(OBJEXT): lib/coverage.def
341 lib/coverage.def: $(DIST_SOURCES)
342         sed -n 's|^COVERAGE_DEFINE(\([_a-zA-Z0-9]\{1,\}\)).*$$|COVERAGE_COUNTER(\1)|p' $(all_sources) | LC_ALL=C sort -u > $@
343 CLEANFILES += lib/coverage.def
344
345 lib/stress.$(OBJEXT): lib/stress.def
346 lib/stress.def: $(DIST_SOURCES)
347         sed -n '/^STRESS_OPTION(/,/);$$/{s/);$$/)/;p}' $(all_sources) > $@
348 CLEANFILES += lib/stress.def
349
350 lib/vlog.$(OBJEXT): lib/vlog-modules.def
351 lib/vlog-modules.def: $(DIST_SOURCES)
352         sed -n 's|^VLOG_DEFINE_\(THIS_\)\{0,1\}MODULE(\([_a-zA-Z0-9]\{1,\}\)).*$$|VLOG_MODULE(\2)|p' $(all_sources) | LC_ALL=C sort -u > $@
353 CLEANFILES += lib/vlog-modules.def
354 endif