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