Makefile.am 21 KB

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