libuv-svace-build
/
Makefile.am
560 строк · 21.4 Кб
1# Copyright (c) 2013, Ben Noordhuis <info@bnoordhuis.nl>
2#
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.
6#
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.
14
15ACLOCAL_AMFLAGS = -I m4
16
17AM_CPPFLAGS = -I$(top_srcdir)/include \
18-I$(top_srcdir)/src
19
20include_HEADERS=include/uv.h
21
22uvincludedir = $(includedir)/uv
23uvinclude_HEADERS = include/uv/errno.h \
24include/uv/threadpool.h \
25include/uv/version.h
26
27CLEANFILES =
28
29lib_LTLIBRARIES = libuv.la
30libuv_la_CFLAGS = $(AM_CFLAGS)
31libuv_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined -version-info 1:0:0
32libuv_la_SOURCES = src/fs-poll.c \
33src/heap-inl.h \
34src/idna.c \
35src/idna.h \
36src/inet.c \
37src/queue.h \
38src/random.c \
39src/strscpy.c \
40src/strscpy.h \
41src/thread-common.c \
42src/threadpool.c \
43src/timer.c \
44src/uv-data-getter-setters.c \
45src/uv-common.c \
46src/uv-common.h \
47src/version.c \
48src/strtok.c \
49src/strtok.h
50
51if SUNOS
52# Can't be turned into a CC_CHECK_CFLAGS in configure.ac, it makes compilers
53# on other platforms complain that the argument is unused during compilation.
54libuv_la_CFLAGS += -pthreads
55endif
56
57if WINNT
58
59uvinclude_HEADERS += include/uv/win.h include/uv/tree.h
60AM_CPPFLAGS += -I$(top_srcdir)/src/win \
61-DWIN32_LEAN_AND_MEAN \
62-D_WIN32_WINNT=0x0602
63libuv_la_SOURCES += src/win/async.c \
64src/win/atomicops-inl.h \
65src/win/core.c \
66src/win/detect-wakeup.c \
67src/win/dl.c \
68src/win/error.c \
69src/win/fs-event.c \
70src/win/fs.c \
71src/win/getaddrinfo.c \
72src/win/getnameinfo.c \
73src/win/handle.c \
74src/win/handle-inl.h \
75src/win/internal.h \
76src/win/loop-watcher.c \
77src/win/pipe.c \
78src/win/poll.c \
79src/win/process-stdio.c \
80src/win/process.c \
81src/win/req-inl.h \
82src/win/signal.c \
83src/win/stream.c \
84src/win/stream-inl.h \
85src/win/tcp.c \
86src/win/thread.c \
87src/win/tty.c \
88src/win/udp.c \
89src/win/util.c \
90src/win/winapi.c \
91src/win/winapi.h \
92src/win/winsock.c \
93src/win/winsock.h
94
95else # WINNT
96
97uvinclude_HEADERS += include/uv/unix.h
98AM_CPPFLAGS += -I$(top_srcdir)/src/unix
99libuv_la_SOURCES += src/unix/async.c \
100src/unix/core.c \
101src/unix/dl.c \
102src/unix/fs.c \
103src/unix/getaddrinfo.c \
104src/unix/getnameinfo.c \
105src/unix/internal.h \
106src/unix/loop-watcher.c \
107src/unix/loop.c \
108src/unix/pipe.c \
109src/unix/poll.c \
110src/unix/process.c \
111src/unix/random-devurandom.c \
112src/unix/signal.c \
113src/unix/stream.c \
114src/unix/tcp.c \
115src/unix/thread.c \
116src/unix/tty.c \
117src/unix/udp.c
118
119endif # WINNT
120
121EXTRA_DIST = test/fixtures/empty_file \
122test/fixtures/load_error.node \
123test/fixtures/lorem_ipsum.txt \
124test/fixtures/one_file/one_file \
125include \
126docs \
127img \
128CONTRIBUTING.md \
129LICENSE \
130LICENSE-extra \
131README.md
132
133
134
135TESTS = test/run-tests
136check_PROGRAMS = test/run-tests
137test_run_tests_CFLAGS = $(AM_CFLAGS)
138
139if WINNT
140check-am: test/run-tests_no_ext
141test/run-tests_no_ext: test/run-tests$(EXEEXT)
142cp test/run-tests$(EXEEXT) test/run-tests_no_ext
143endif
144
145if SUNOS
146# Can't be turned into a CC_CHECK_CFLAGS in configure.ac, it makes compilers
147# on other platforms complain that the argument is unused during compilation.
148test_run_tests_CFLAGS += -pthreads
149endif
150
151test_run_tests_LDFLAGS = $(AM_LDFLAGS)
152test_run_tests_SOURCES = test/blackhole-server.c \
153test/echo-server.c \
154test/run-tests.c \
155test/runner.c \
156test/runner.h \
157test/task.h \
158test/test-active.c \
159test/test-async.c \
160test/test-async-null-cb.c \
161test/test-barrier.c \
162test/test-callback-stack.c \
163test/test-close-fd.c \
164test/test-close-order.c \
165test/test-condvar.c \
166test/test-connect-unspecified.c \
167test/test-connection-fail.c \
168test/test-cwd-and-chdir.c \
169test/test-default-loop-close.c \
170test/test-delayed-accept.c \
171test/test-dlerror.c \
172test/test-eintr-handling.c \
173test/test-embed.c \
174test/test-emfile.c \
175test/test-env-vars.c \
176test/test-error.c \
177test/test-fail-always.c \
178test/test-fs-copyfile.c \
179test/test-fs-event.c \
180test/test-fs-poll.c \
181test/test-fs.c \
182test/test-fs-readdir.c \
183test/test-fs-fd-hash.c \
184test/test-fs-open-flags.c \
185test/test-fork.c \
186test/test-getters-setters.c \
187test/test-get-currentexe.c \
188test/test-get-loadavg.c \
189test/test-get-memory.c \
190test/test-get-passwd.c \
191test/test-getaddrinfo.c \
192test/test-gethostname.c \
193test/test-getnameinfo.c \
194test/test-getsockname.c \
195test/test-gettimeofday.c \
196test/test-handle-fileno.c \
197test/test-homedir.c \
198test/test-hrtime.c \
199test/test-idle.c \
200test/test-idna.c \
201test/test-iouring-pollhup.c \
202test/test-ip4-addr.c \
203test/test-ip6-addr.c \
204test/test-ip-name.c \
205test/test-ipc-heavy-traffic-deadlock-bug.c \
206test/test-ipc-send-recv.c \
207test/test-ipc.c \
208test/test-list.h \
209test/test-loop-handles.c \
210test/test-loop-alive.c \
211test/test-loop-close.c \
212test/test-loop-stop.c \
213test/test-loop-time.c \
214test/test-loop-configure.c \
215test/test-metrics.c \
216test/test-multiple-listen.c \
217test/test-mutexes.c \
218test/test-not-readable-nor-writable-on-read-error.c \
219test/test-not-writable-after-shutdown.c \
220test/test-osx-select.c \
221test/test-pass-always.c \
222test/test-ping-pong.c \
223test/test-pipe-bind-error.c \
224test/test-pipe-connect-error.c \
225test/test-pipe-connect-multiple.c \
226test/test-pipe-connect-prepare.c \
227test/test-pipe-getsockname.c \
228test/test-pipe-pending-instances.c \
229test/test-pipe-sendmsg.c \
230test/test-pipe-server-close.c \
231test/test-pipe-close-stdout-read-stdin.c \
232test/test-pipe-set-non-blocking.c \
233test/test-pipe-set-fchmod.c \
234test/test-platform-output.c \
235test/test-poll.c \
236test/test-poll-close.c \
237test/test-poll-close-doesnt-corrupt-stack.c \
238test/test-poll-closesocket.c \
239test/test-poll-multiple-handles.c \
240test/test-poll-oob.c \
241test/test-process-priority.c \
242test/test-process-title.c \
243test/test-process-title-threadsafe.c \
244test/test-queue-foreach-delete.c \
245test/test-random.c \
246test/test-readable-on-eof.c \
247test/test-ref.c \
248test/test-run-nowait.c \
249test/test-run-once.c \
250test/test-semaphore.c \
251test/test-shutdown-close.c \
252test/test-shutdown-eof.c \
253test/test-shutdown-simultaneous.c \
254test/test-shutdown-twice.c \
255test/test-signal-multiple-loops.c \
256test/test-signal-pending-on-close.c \
257test/test-signal.c \
258test/test-socket-buffer-size.c \
259test/test-spawn.c \
260test/test-stdio-over-pipes.c \
261test/test-strscpy.c \
262test/test-strtok.c \
263test/test-tcp-alloc-cb-fail.c \
264test/test-tcp-bind-error.c \
265test/test-tcp-bind6-error.c \
266test/test-tcp-close-accept.c \
267test/test-tcp-close-while-connecting.c \
268test/test-tcp-close-after-read-timeout.c \
269test/test-tcp-close.c \
270test/test-tcp-close-reset.c \
271test/test-tcp-create-socket-early.c \
272test/test-tcp-connect-error-after-write.c \
273test/test-tcp-connect-error.c \
274test/test-tcp-connect-timeout.c \
275test/test-tcp-connect6-error.c \
276test/test-tcp-flags.c \
277test/test-tcp-open.c \
278test/test-tcp-read-stop.c \
279test/test-tcp-reuseport.c \
280test/test-tcp-read-stop-start.c \
281test/test-tcp-rst.c \
282test/test-tcp-shutdown-after-write.c \
283test/test-tcp-unexpected-read.c \
284test/test-tcp-oob.c \
285test/test-tcp-write-to-half-open-connection.c \
286test/test-tcp-write-after-connect.c \
287test/test-tcp-writealot.c \
288test/test-tcp-write-fail.c \
289test/test-tcp-try-write.c \
290test/test-tcp-write-in-a-row.c \
291test/test-tcp-try-write-error.c \
292test/test-tcp-write-queue-order.c \
293test/test-test-macros.c \
294test/test-thread-equal.c \
295test/test-thread.c \
296test/test-thread-affinity.c \
297test/test-thread-priority.c \
298test/test-threadpool-cancel.c \
299test/test-threadpool.c \
300test/test-timer-again.c \
301test/test-timer-from-check.c \
302test/test-timer.c \
303test/test-tmpdir.c \
304test/test-tty-duplicate-key.c \
305test/test-tty-escape-sequence-processing.c \
306test/test-tty.c \
307test/test-udp-alloc-cb-fail.c \
308test/test-udp-bind.c \
309test/test-udp-connect.c \
310test/test-udp-connect6.c \
311test/test-udp-create-socket-early.c \
312test/test-udp-dgram-too-big.c \
313test/test-udp-ipv6.c \
314test/test-udp-mmsg.c \
315test/test-udp-multicast-interface.c \
316test/test-udp-multicast-interface6.c \
317test/test-udp-multicast-join.c \
318test/test-udp-multicast-join6.c \
319test/test-udp-multicast-ttl.c \
320test/test-udp-open.c \
321test/test-udp-options.c \
322test/test-udp-send-and-recv.c \
323test/test-udp-send-hang-loop.c \
324test/test-udp-send-immediate.c \
325test/test-udp-sendmmsg-error.c \
326test/test-udp-send-unreachable.c \
327test/test-udp-try-send.c \
328test/test-udp-recv-in-a-row.c \
329test/test-udp-reuseport.c \
330test/test-uname.c \
331test/test-walk-handles.c \
332test/test-watcher-cross-stop.c
333test_run_tests_LDADD = libuv.la
334
335if WINNT
336test_run_tests_SOURCES += test/runner-win.c \
337test/runner-win.h
338else
339test_run_tests_SOURCES += test/runner-unix.c \
340test/runner-unix.h
341endif
342
343if AIX
344test_run_tests_CFLAGS += -D_ALL_SOURCE \
345-D_XOPEN_SOURCE=500 \
346-D_LINUX_SOURCE_COMPAT
347endif
348
349if OS400
350test_run_tests_CFLAGS += -D_ALL_SOURCE \
351-D_XOPEN_SOURCE=500 \
352-D_LINUX_SOURCE_COMPAT
353endif
354
355if HAIKU
356test_run_tests_CFLAGS += -D_BSD_SOURCE
357endif
358
359if LINUX
360test_run_tests_CFLAGS += -D_GNU_SOURCE
361endif
362
363if SUNOS
364test_run_tests_CFLAGS += -D__EXTENSIONS__ \
365-D_XOPEN_SOURCE=500 \
366-D_REENTRANT
367endif
368
369if OS390
370test_run_tests_CFLAGS += -D_ISOC99_SOURCE \
371-D_UNIX03_THREADS \
372-D_UNIX03_SOURCE \
373-D_OPEN_SYS_IF_EXT=1 \
374-D_OPEN_SYS_SOCK_IPV6 \
375-D_OPEN_MSGQ_EXT \
376-D_XOPEN_SOURCE_EXTENDED \
377-D_ALL_SOURCE \
378-D_LARGE_TIME_API \
379-D_OPEN_SYS_FILE_EXT \
380-DPATH_MAX=255 \
381-qCHARS=signed \
382-qXPLINK \
383-qFLOAT=IEEE
384endif
385
386if AIX
387libuv_la_CFLAGS += -D_ALL_SOURCE \
388-D_XOPEN_SOURCE=500 \
389-D_LINUX_SOURCE_COMPAT \
390-D_THREAD_SAFE \
391-DHAVE_SYS_AHAFS_EVPRODS_H
392uvinclude_HEADERS += include/uv/aix.h
393libuv_la_SOURCES += src/unix/aix.c src/unix/aix-common.c
394endif
395
396if OS400
397libuv_la_CFLAGS += -D_ALL_SOURCE \
398-D_XOPEN_SOURCE=500 \
399-D_LINUX_SOURCE_COMPAT \
400-D_THREAD_SAFE
401uvinclude_HEADERS += include/uv/posix.h
402libuv_la_SOURCES += src/unix/aix-common.c \
403src/unix/ibmi.c \
404src/unix/posix-poll.c \
405src/unix/no-fsevents.c
406endif
407
408if ANDROID
409libuv_la_CFLAGS += -D_GNU_SOURCE
410endif
411
412if CYGWIN
413uvinclude_HEADERS += include/uv/posix.h
414libuv_la_CFLAGS += -D_GNU_SOURCE
415libuv_la_SOURCES += src/unix/cygwin.c \
416src/unix/bsd-ifaddrs.c \
417src/unix/no-fsevents.c \
418src/unix/no-proctitle.c \
419src/unix/posix-hrtime.c \
420src/unix/posix-poll.c \
421src/unix/procfs-exepath.c \
422src/unix/sysinfo-loadavg.c \
423src/unix/sysinfo-memory.c
424endif
425
426if DARWIN
427uvinclude_HEADERS += include/uv/darwin.h
428libuv_la_CFLAGS += -D_DARWIN_USE_64_BIT_INODE=1
429libuv_la_CFLAGS += -D_DARWIN_UNLIMITED_SELECT=1
430libuv_la_SOURCES += src/unix/bsd-ifaddrs.c \
431src/unix/darwin-proctitle.c \
432src/unix/darwin-stub.h \
433src/unix/darwin.c \
434src/unix/fsevents.c \
435src/unix/kqueue.c \
436src/unix/proctitle.c \
437src/unix/random-getentropy.c
438test_run_tests_LDFLAGS += -lutil
439endif
440
441if DRAGONFLY
442uvinclude_HEADERS += include/uv/bsd.h
443libuv_la_SOURCES += src/unix/bsd-ifaddrs.c \
444src/unix/bsd-proctitle.c \
445src/unix/freebsd.c \
446src/unix/kqueue.c \
447src/unix/posix-hrtime.c
448test_run_tests_LDFLAGS += -lutil
449endif
450
451if FREEBSD
452uvinclude_HEADERS += include/uv/bsd.h
453libuv_la_SOURCES += src/unix/bsd-ifaddrs.c \
454src/unix/bsd-proctitle.c \
455src/unix/freebsd.c \
456src/unix/kqueue.c \
457src/unix/posix-hrtime.c \
458src/unix/random-getrandom.c
459test_run_tests_LDFLAGS += -lutil
460endif
461
462if HAIKU
463uvinclude_HEADERS += include/uv/posix.h
464libuv_la_CFLAGS += -D_BSD_SOURCE
465libuv_la_SOURCES += src/unix/bsd-ifaddrs.c \
466src/unix/haiku.c \
467src/unix/no-fsevents.c \
468src/unix/no-proctitle.c \
469src/unix/posix-hrtime.c \
470src/unix/posix-poll.c
471endif
472
473if HURD
474uvinclude_HEADERS += include/uv/posix.h
475libuv_la_SOURCES += src/unix/bsd-ifaddrs.c \
476src/unix/no-fsevents.c \
477src/unix/no-proctitle.c \
478src/unix/posix-hrtime.c \
479src/unix/posix-poll.c \
480src/unix/hurd.c
481endif
482
483if LINUX
484uvinclude_HEADERS += include/uv/linux.h
485libuv_la_CFLAGS += -D_GNU_SOURCE
486libuv_la_SOURCES += src/unix/linux.c \
487src/unix/procfs-exepath.c \
488src/unix/proctitle.c \
489src/unix/random-getrandom.c \
490src/unix/random-sysctl-linux.c
491test_run_tests_LDFLAGS += -lutil
492endif
493
494if MSYS
495libuv_la_CFLAGS += -D_GNU_SOURCE
496libuv_la_SOURCES += src/unix/cygwin.c \
497src/unix/bsd-ifaddrs.c \
498src/unix/no-fsevents.c \
499src/unix/no-proctitle.c \
500src/unix/posix-hrtime.c \
501src/unix/posix-poll.c \
502src/unix/procfs-exepath.c \
503src/unix/sysinfo-loadavg.c \
504src/unix/sysinfo-memory.c
505endif
506
507if NETBSD
508uvinclude_HEADERS += include/uv/bsd.h
509libuv_la_SOURCES += src/unix/bsd-ifaddrs.c \
510src/unix/bsd-proctitle.c \
511src/unix/kqueue.c \
512src/unix/netbsd.c \
513src/unix/posix-hrtime.c
514test_run_tests_LDFLAGS += -lutil
515endif
516
517if OPENBSD
518uvinclude_HEADERS += include/uv/bsd.h
519libuv_la_SOURCES += src/unix/bsd-ifaddrs.c \
520src/unix/bsd-proctitle.c \
521src/unix/kqueue.c \
522src/unix/openbsd.c \
523src/unix/posix-hrtime.c \
524src/unix/random-getentropy.c
525test_run_tests_LDFLAGS += -lutil
526endif
527
528if SUNOS
529uvinclude_HEADERS += include/uv/sunos.h
530libuv_la_CFLAGS += -D__EXTENSIONS__ \
531-D_XOPEN_SOURCE=500 \
532-D_REENTRANT
533libuv_la_SOURCES += src/unix/no-proctitle.c \
534src/unix/sunos.c
535endif
536
537if OS390
538libuv_la_CFLAGS += -D_UNIX03_THREADS \
539-D_UNIX03_SOURCE \
540-D_OPEN_SYS_IF_EXT=1 \
541-D_OPEN_MSGQ_EXT \
542-D_XOPEN_SOURCE_EXTENDED \
543-D_ALL_SOURCE \
544-D_LARGE_TIME_API \
545-D_OPEN_SYS_SOCK_EXT3 \
546-D_OPEN_SYS_SOCK_IPV6 \
547-D_OPEN_SYS_FILE_EXT \
548-DUV_PLATFORM_SEM_T=int \
549-DPATH_MAX=255 \
550-qCHARS=signed \
551-qXPLINK \
552-qFLOAT=IEEE
553libuv_la_LDFLAGS += -qXPLINK
554libuv_la_SOURCES += src/unix/os390.c \
555src/unix/os390-syscalls.c \
556src/unix/proctitle.c
557endif
558
559pkgconfigdir = $(libdir)/pkgconfig
560pkgconfig_DATA = @PACKAGE_NAME@.pc
561