]> git.proxmox.com Git - mirror_ovs.git/blob - lib/automake.mk
lib: Disable Linux-specific libraries on non-Linux systems.
[mirror_ovs.git] / lib / automake.mk
1 # Copyright (C) 2009, 2010 Nicira Networks, 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/backtrace.c \
14 lib/backtrace.h \
15 lib/bitmap.c \
16 lib/bitmap.h \
17 lib/byteq.c \
18 lib/byteq.h \
19 lib/classifier.c \
20 lib/classifier.h \
21 lib/command-line.c \
22 lib/command-line.h \
23 lib/compiler.h \
24 lib/coverage.c \
25 lib/coverage.h \
26 lib/coverage-counters.h \
27 lib/csum.c \
28 lib/csum.h \
29 lib/daemon.c \
30 lib/daemon.h \
31 lib/dhcp-client.c \
32 lib/dhcp-client.h \
33 lib/dhcp.c \
34 lib/dhcp.h \
35 lib/dhparams.h \
36 lib/dirs.h \
37 lib/dpif-netdev.c \
38 lib/dpif-provider.h \
39 lib/dpif.c \
40 lib/dpif.h \
41 lib/dynamic-string.c \
42 lib/dynamic-string.h \
43 lib/fatal-signal.c \
44 lib/fatal-signal.h \
45 lib/flow.c \
46 lib/flow.h \
47 lib/hash.c \
48 lib/hash.h \
49 lib/hmap.c \
50 lib/hmap.h \
51 lib/json.c \
52 lib/json.h \
53 lib/jsonrpc.c \
54 lib/jsonrpc.h \
55 lib/leak-checker.c \
56 lib/leak-checker.h \
57 lib/learning-switch.c \
58 lib/learning-switch.h \
59 lib/list.c \
60 lib/list.h \
61 lib/lockfile.c \
62 lib/lockfile.h \
63 lib/mac-learning.c \
64 lib/mac-learning.h \
65 lib/netdev-provider.h \
66 lib/netdev.c \
67 lib/netdev.h \
68 lib/odp-util.c \
69 lib/odp-util.h \
70 lib/ofp-print.c \
71 lib/ofp-print.h \
72 lib/ofpbuf.c \
73 lib/ofpbuf.h \
74 lib/ovsdb-data.c \
75 lib/ovsdb-data.h \
76 lib/ovsdb-error.c \
77 lib/ovsdb-error.h \
78 lib/ovsdb-idl-provider.h \
79 lib/ovsdb-idl.c \
80 lib/ovsdb-idl.h \
81 lib/ovsdb-parser.c \
82 lib/ovsdb-parser.h \
83 lib/ovsdb-types.c \
84 lib/ovsdb-types.h \
85 lib/packets.c \
86 lib/packets.h \
87 lib/pcap.c \
88 lib/pcap.h \
89 lib/poll-loop.c \
90 lib/poll-loop.h \
91 lib/port-array.c \
92 lib/port-array.h \
93 lib/process.c \
94 lib/process.h \
95 lib/queue.c \
96 lib/queue.h \
97 lib/random.c \
98 lib/random.h \
99 lib/rconn.c \
100 lib/rconn.h \
101 lib/reconnect.c \
102 lib/reconnect.h \
103 lib/sat-math.h \
104 lib/sha1.c \
105 lib/sha1.h \
106 lib/shash.c \
107 lib/shash.h \
108 lib/signals.c \
109 lib/signals.h \
110 lib/socket-util.c \
111 lib/socket-util.h \
112 lib/sort.c \
113 lib/sort.h \
114 lib/stp.c \
115 lib/stp.h \
116 lib/stream-fd.c \
117 lib/stream-fd.h \
118 lib/stream-provider.h \
119 lib/stream-ssl.h \
120 lib/stream-tcp.c \
121 lib/stream-unix.c \
122 lib/stream.c \
123 lib/stream.h \
124 lib/string.h \
125 lib/svec.c \
126 lib/svec.h \
127 lib/tag.c \
128 lib/tag.h \
129 lib/timeval.c \
130 lib/timeval.h \
131 lib/type-props.h \
132 lib/unaligned.h \
133 lib/unicode.c \
134 lib/unicode.h \
135 lib/unixctl.c \
136 lib/unixctl.h \
137 lib/util.c \
138 lib/util.h \
139 lib/uuid.c \
140 lib/uuid.h \
141 lib/valgrind.h \
142 lib/vconn-provider.h \
143 lib/vconn-stream.c \
144 lib/vconn.c \
145 lib/vconn.h \
146 lib/vlog-modules.def \
147 lib/vlog.c \
148 lib/vlog.h \
149 lib/xtoxll.h
150 nodist_lib_libopenvswitch_a_SOURCES = \
151 lib/coverage-counters.c \
152 lib/dirs.c
153 CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES)
154
155 noinst_LIBRARIES += lib/libsflow.a
156 lib_libsflow_a_SOURCES = \
157 lib/sflow_api.h \
158 lib/sflow.h \
159 lib/sflow_agent.c \
160 lib/sflow_sampler.c \
161 lib/sflow_poller.c \
162 lib/sflow_receiver.c
163 lib_libsflow_a_CFLAGS = $(AM_CFLAGS)
164 if HAVE_WNO_UNUSED
165 lib_libsflow_a_CFLAGS += -Wno-unused
166 endif
167
168 if HAVE_NETLINK
169 lib_libopenvswitch_a_SOURCES += \
170 lib/dpif-linux.c \
171 lib/netdev-gre.c \
172 lib/netdev-linux.c \
173 lib/netdev-patch.c \
174 lib/netdev-vport.c \
175 lib/netdev-vport.h \
176 lib/netlink-protocol.h \
177 lib/netlink.c \
178 lib/netlink.h \
179 lib/rtnetlink.c \
180 lib/rtnetlink.h
181 endif
182
183 if HAVE_OPENSSL
184 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
185 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c
186 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
187 (echo '#include "lib/dhparams.h"' && \
188 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
189 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
190 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
191 | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
192 mv lib/dhparams.c.tmp lib/dhparams.c
193 endif
194
195 EXTRA_DIST += \
196 lib/dh1024.pem \
197 lib/dh2048.pem \
198 lib/dh4096.pem \
199 lib/dhparams.h
200
201 EXTRA_DIST += \
202 lib/common.man \
203 lib/common-syn.man \
204 lib/daemon.man \
205 lib/daemon-syn.man \
206 lib/dpif.man \
207 lib/leak-checker.man \
208 lib/ssl-bootstrap.man \
209 lib/ssl-bootstrap-syn.man \
210 lib/ssl-peer-ca-cert.man \
211 lib/ssl.man \
212 lib/ssl-syn.man \
213 lib/unixctl.man \
214 lib/unixctl-syn.man \
215 lib/vconn-active.man \
216 lib/vconn-passive.man \
217 lib/vlog-unixctl.man \
218 lib/vlog-syn.man \
219 lib/vlog.man
220
221
222 lib/dirs.c: Makefile
223 ($(ro_c) && \
224 echo 'const char ovs_pkgdatadir[] = "$(pkgdatadir)";' && \
225 echo 'const char ovs_rundir[] = "@RUNDIR@";' && \
226 echo 'const char ovs_logdir[] = "@LOGDIR@";' && \
227 echo 'const char ovs_bindir[] = "$(bindir)";') > lib/dirs.c.tmp
228 mv lib/dirs.c.tmp lib/dirs.c
229
230 install-data-local:
231 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
232 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
233 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
234
235 # All the source files that have coverage counters.
236 COVERAGE_FILES = \
237 lib/dpif.c \
238 lib/flow.c \
239 lib/lockfile.c \
240 lib/hmap.c \
241 lib/mac-learning.c \
242 lib/netdev.c \
243 lib/netdev-linux.c \
244 lib/netlink.c \
245 lib/odp-util.c \
246 lib/poll-loop.c \
247 lib/process.c \
248 lib/rconn.c \
249 lib/rtnetlink.c \
250 lib/stream.c \
251 lib/timeval.c \
252 lib/unixctl.c \
253 lib/util.c \
254 lib/vconn.c \
255 ofproto/ofproto.c \
256 ofproto/pktbuf.c \
257 vswitchd/bridge.c \
258 vswitchd/ovs-brcompatd.c
259 lib/coverage-counters.c: $(COVERAGE_FILES) lib/coverage-scan.pl
260 (cd $(srcdir) && $(PERL) lib/coverage-scan.pl $(COVERAGE_FILES)) > $@.tmp
261 mv $@.tmp $@
262 EXTRA_DIST += lib/coverage-scan.pl