1 # Copyright (c) 2013, Ben Noordhuis <info@bnoordhuis.nl>
3 # Permission to use, copy, modify, and/or distribute this software for any
4 # purpose with or without fee is hereby granted, provided that the above
5 # copyright notice and this permission notice appear in all copies.
7 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 ACLOCAL_AMFLAGS = -I m4
17 AM_CPPFLAGS = -I$(top_srcdir)/include \
20 include_HEADERS=include/uv.h include/uv-errno.h
24 lib_LTLIBRARIES = libuv.la
25 libuv_la_CFLAGS = @CFLAGS@
26 libuv_la_LDFLAGS = -no-undefined -version-info 11:0:0
27 libuv_la_SOURCES = src/fs-poll.c \
35 libuv_la_CFLAGS += -pthread
40 include_HEADERS += include/uv-win.h include/tree.h
41 AM_CPPFLAGS += -I$(top_srcdir)/src/win \
42 -DWIN32_LEAN_AND_MEAN \
44 LIBS += -lws2_32 -lpsapi -liphlpapi -lshell32
45 libuv_la_SOURCES += src/win/async.c \
46 src/win/atomicops-inl.h \
52 src/win/getaddrinfo.c \
54 src/win/handle-inl.h \
56 src/win/loop-watcher.c \
59 src/win/process-stdio.c \
65 src/win/stream-inl.h \
68 src/win/threadpool.c \
80 include_HEADERS += include/uv-unix.h
81 AM_CPPFLAGS += -I$(top_srcdir)/src/unix
82 libuv_la_SOURCES += src/unix/async.c \
83 src/unix/atomic-ops.h \
87 src/unix/getaddrinfo.c \
89 src/unix/loop-watcher.c \
99 src/unix/threadpool.c \
106 TESTS = test/run-tests
107 check_PROGRAMS = test/run-tests
108 test_run_tests_SOURCES = test/blackhole-server.c \
117 test/test-async-null-cb.c \
118 test/test-barrier.c \
119 test/test-callback-order.c \
120 test/test-callback-stack.c \
121 test/test-close-fd.c \
122 test/test-close-order.c \
123 test/test-condvar.c \
124 test/test-connection-fail.c \
125 test/test-cwd-and-chdir.c \
126 test/test-delayed-accept.c \
127 test/test-dlerror.c \
131 test/test-fail-always.c \
132 test/test-fs-event.c \
133 test/test-fs-poll.c \
135 test/test-get-currentexe.c \
136 test/test-get-loadavg.c \
137 test/test-get-memory.c \
138 test/test-getaddrinfo.c \
139 test/test-getsockname.c \
142 test/test-ip4-addr.c \
143 test/test-ip6-addr.c \
144 test/test-ipc-send-recv.c \
147 test/test-loop-handles.c \
148 test/test-loop-stop.c \
149 test/test-loop-time.c \
150 test/test-multiple-listen.c \
151 test/test-mutexes.c \
152 test/test-osx-select.c \
153 test/test-pass-always.c \
154 test/test-ping-pong.c \
155 test/test-pipe-bind-error.c \
156 test/test-pipe-connect-error.c \
157 test/test-platform-output.c \
158 test/test-poll-close.c \
160 test/test-process-title.c \
162 test/test-run-nowait.c \
163 test/test-run-once.c \
164 test/test-semaphore.c \
165 test/test-shutdown-close.c \
166 test/test-shutdown-eof.c \
167 test/test-signal-multiple-loops.c \
170 test/test-stdio-over-pipes.c \
171 test/test-tcp-bind-error.c \
172 test/test-tcp-bind6-error.c \
173 test/test-tcp-close-accept.c \
174 test/test-tcp-close-while-connecting.c \
175 test/test-tcp-close.c \
176 test/test-tcp-connect-error-after-write.c \
177 test/test-tcp-connect-error.c \
178 test/test-tcp-connect-timeout.c \
179 test/test-tcp-connect6-error.c \
180 test/test-tcp-flags.c \
181 test/test-tcp-open.c \
182 test/test-tcp-read-stop.c \
183 test/test-tcp-shutdown-after-write.c \
184 test/test-tcp-unexpected-read.c \
185 test/test-tcp-write-to-half-open-connection.c \
186 test/test-tcp-writealot.c \
187 test/test-tcp-try-write.c \
189 test/test-threadpool-cancel.c \
190 test/test-threadpool.c \
191 test/test-timer-again.c \
192 test/test-timer-from-check.c \
195 test/test-udp-dgram-too-big.c \
196 test/test-udp-ipv6.c \
197 test/test-udp-multicast-join.c \
198 test/test-udp-multicast-ttl.c \
199 test/test-udp-open.c \
200 test/test-udp-options.c \
201 test/test-udp-send-and-recv.c \
202 test/test-walk-handles.c \
203 test/test-watcher-cross-stop.c
204 test_run_tests_LDADD = libuv.la
207 test_run_tests_SOURCES += test/runner-win.c \
210 test_run_tests_SOURCES += test/runner-unix.c \
217 libuv_la_CFLAGS += -D_ALL_SOURCE -D_XOPEN_SOURCE=500
218 libuv_la_SOURCES += src/unix/aix.c
222 include_HEADERS += include/uv-darwin.h
223 libuv_la_CFLAGS += -D_DARWIN_USE_64_BIT_INODE=1
224 libuv_la_SOURCES += src/unix/darwin.c \
225 src/unix/darwin-proctitle.c \
226 src/unix/fsevents.c \
232 include_HEADERS += include/uv-bsd.h
233 libuv_la_SOURCES += src/unix/freebsd.c src/unix/kqueue.c
237 include_HEADERS += include/uv-linux.h
238 libuv_la_SOURCES += src/unix/linux-core.c \
239 src/unix/linux-inotify.c \
240 src/unix/linux-syscalls.c \
241 src/unix/linux-syscalls.h \
246 include_HEADERS += include/uv-bsd.h
247 libuv_la_SOURCES += src/unix/kqueue.c src/unix/netbsd.c
251 include_HEADERS += include/uv-bsd.h
252 libuv_la_SOURCES += src/unix/kqueue.c src/unix/openbsd.c
256 include_HEADERS += include/uv-sunos.h
257 libuv_la_CFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=500
258 libuv_la_SOURCES += src/unix/sunos.c
262 BUILT_SOURCES = include/uv-dtrace.h
263 CLEANFILES += include/uv-dtrace.h
266 if DTRACE_NEEDS_OBJECTS
267 libuv_la_SOURCES += src/unix/uv-dtrace.d
268 libuv_la_DEPENDENCIES = src/unix/uv-dtrace.o
269 libuv_la_LIBADD = uv-dtrace.lo
270 CLEANFILES += src/unix/uv-dtrace.o src/unix/uv-dtrace.lo
274 pkgconfigdir = $(libdir)/pkgconfig
275 pkgconfig_DATA = @PACKAGE_NAME@.pc
279 include/uv-dtrace.h: src/unix/uv-dtrace.d
280 $(AM_V_GEN)$(DTRACE) $(DTRACEFLAGS) -h -xnolibs -s $< -o $(top_srcdir)/$@
283 if DTRACE_NEEDS_OBJECTS
286 src/unix/uv-dtrace.o: src/unix/uv-dtrace.d ${libuv_la_OBJECTS}
288 # It's ok to specify the output here, because we have 1 .d file, and we process
289 # every created .o, most projects don't need to include more than one .d
291 $(AM_V_GEN)$(DTRACE) $(DTRACEFLAGS) -G -o $(top_builddir)/uv-dtrace.o -s $< \
292 `find ${top_builddir}/src -name "*.o"`
293 $(AM_V_GEN)printf %s\\n \
294 '# ${top_builddir}/uv-dtrace.lo - a libtool object file' \
295 '# Generated by libtool (GNU libtool) 2.4' \
296 '# libtool wants a .lo not a .o' \
297 "pic_object='uv-dtrace.o'" \
298 "non_pic_object='uv-dtrace.o'" \
299 > ${top_builddir}/uv-dtrace.lo