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-alive.c \
149 test/test-loop-stop.c \
150 test/test-loop-time.c \
151 test/test-multiple-listen.c \
152 test/test-mutexes.c \
153 test/test-osx-select.c \
154 test/test-pass-always.c \
155 test/test-ping-pong.c \
156 test/test-pipe-bind-error.c \
157 test/test-pipe-connect-error.c \
158 test/test-pipe-server-close.c \
159 test/test-platform-output.c \
160 test/test-poll-close.c \
162 test/test-process-title.c \
164 test/test-run-nowait.c \
165 test/test-run-once.c \
166 test/test-semaphore.c \
167 test/test-shutdown-close.c \
168 test/test-shutdown-eof.c \
169 test/test-signal-multiple-loops.c \
172 test/test-stdio-over-pipes.c \
173 test/test-tcp-bind-error.c \
174 test/test-tcp-bind6-error.c \
175 test/test-tcp-close-accept.c \
176 test/test-tcp-close-while-connecting.c \
177 test/test-tcp-close.c \
178 test/test-tcp-connect-error-after-write.c \
179 test/test-tcp-connect-error.c \
180 test/test-tcp-connect-timeout.c \
181 test/test-tcp-connect6-error.c \
182 test/test-tcp-flags.c \
183 test/test-tcp-open.c \
184 test/test-tcp-read-stop.c \
185 test/test-tcp-shutdown-after-write.c \
186 test/test-tcp-unexpected-read.c \
187 test/test-tcp-write-to-half-open-connection.c \
188 test/test-tcp-writealot.c \
189 test/test-tcp-try-write.c \
191 test/test-threadpool-cancel.c \
192 test/test-threadpool.c \
193 test/test-timer-again.c \
194 test/test-timer-from-check.c \
197 test/test-udp-dgram-too-big.c \
198 test/test-udp-ipv6.c \
199 test/test-udp-multicast-join.c \
200 test/test-udp-multicast-ttl.c \
201 test/test-udp-open.c \
202 test/test-udp-options.c \
203 test/test-udp-send-and-recv.c \
204 test/test-walk-handles.c \
205 test/test-watcher-cross-stop.c
206 test_run_tests_LDADD = libuv.la
209 test_run_tests_SOURCES += test/runner-win.c \
212 test_run_tests_SOURCES += test/runner-unix.c \
219 libuv_la_CFLAGS += -D_ALL_SOURCE -D_XOPEN_SOURCE=500
220 libuv_la_SOURCES += src/unix/aix.c
224 include_HEADERS += include/uv-darwin.h
225 libuv_la_CFLAGS += -D_DARWIN_USE_64_BIT_INODE=1
226 libuv_la_SOURCES += src/unix/darwin.c \
227 src/unix/darwin-proctitle.c \
228 src/unix/fsevents.c \
234 include_HEADERS += include/uv-bsd.h
235 libuv_la_SOURCES += src/unix/freebsd.c src/unix/kqueue.c
239 include_HEADERS += include/uv-linux.h
240 libuv_la_SOURCES += src/unix/linux-core.c \
241 src/unix/linux-inotify.c \
242 src/unix/linux-syscalls.c \
243 src/unix/linux-syscalls.h \
248 include_HEADERS += include/uv-bsd.h
249 libuv_la_SOURCES += src/unix/kqueue.c src/unix/netbsd.c
253 include_HEADERS += include/uv-bsd.h
254 libuv_la_SOURCES += src/unix/kqueue.c src/unix/openbsd.c
258 include_HEADERS += include/uv-sunos.h
259 libuv_la_CFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=500
260 libuv_la_SOURCES += src/unix/sunos.c
264 BUILT_SOURCES = include/uv-dtrace.h
265 CLEANFILES += include/uv-dtrace.h
268 if DTRACE_NEEDS_OBJECTS
269 libuv_la_SOURCES += src/unix/uv-dtrace.d
270 libuv_la_DEPENDENCIES = src/unix/uv-dtrace.o
271 libuv_la_LIBADD = uv-dtrace.lo
272 CLEANFILES += src/unix/uv-dtrace.o src/unix/uv-dtrace.lo
276 pkgconfigdir = $(libdir)/pkgconfig
277 pkgconfig_DATA = @PACKAGE_NAME@.pc
281 include/uv-dtrace.h: src/unix/uv-dtrace.d
282 $(AM_V_GEN)$(DTRACE) $(DTRACEFLAGS) -h -xnolibs -s $< -o $(top_srcdir)/$@
285 if DTRACE_NEEDS_OBJECTS
288 src/unix/uv-dtrace.o: src/unix/uv-dtrace.d ${libuv_la_OBJECTS}
290 # It's ok to specify the output here, because we have 1 .d file, and we process
291 # every created .o, most projects don't need to include more than one .d
293 $(AM_V_GEN)$(DTRACE) $(DTRACEFLAGS) -G -o $(top_builddir)/uv-dtrace.o -s $< \
294 `find ${top_builddir}/src -name "*.o"`
295 $(AM_V_GEN)printf %s\\n \
296 '# ${top_builddir}/uv-dtrace.lo - a libtool object file' \
297 '# Generated by libtool (GNU libtool) 2.4' \
298 '# libtool wants a .lo not a .o' \
299 "pic_object='uv-dtrace.o'" \
300 "non_pic_object='uv-dtrace.o'" \
301 > ${top_builddir}/uv-dtrace.lo