1
0

checksparse.sh 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. #!/bin/sh
  2. # Copyright (c) 2013, Ben Noordhuis <info@bnoordhuis.nl>
  3. #
  4. # Permission to use, copy, modify, and/or distribute this software for any
  5. # purpose with or without fee is hereby granted, provided that the above
  6. # copyright notice and this permission notice appear in all copies.
  7. #
  8. # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. SPARSE=${SPARSE:-sparse}
  16. SPARSE_FLAGS=${SPARSE_FLAGS:-"
  17. -D__POSIX__
  18. -Wsparse-all
  19. -Wno-do-while
  20. -Wno-transparent-union
  21. -Iinclude
  22. -Isrc
  23. "}
  24. SOURCES="
  25. include/tree.h
  26. include/uv-unix.h
  27. include/uv.h
  28. src/fs-poll.c
  29. src/inet.c
  30. src/queue.h
  31. src/unix/async.c
  32. src/unix/core.c
  33. src/unix/dl.c
  34. src/unix/fs.c
  35. src/unix/getaddrinfo.c
  36. src/unix/internal.h
  37. src/unix/loop-watcher.c
  38. src/unix/loop.c
  39. src/unix/pipe.c
  40. src/unix/poll.c
  41. src/unix/process.c
  42. src/unix/signal.c
  43. src/unix/stream.c
  44. src/unix/tcp.c
  45. src/unix/thread.c
  46. src/unix/threadpool.c
  47. src/unix/timer.c
  48. src/unix/tty.c
  49. src/unix/udp.c
  50. src/uv-common.c
  51. src/uv-common.h
  52. "
  53. TESTS="
  54. test/benchmark-async-pummel.c
  55. test/benchmark-async.c
  56. test/benchmark-fs-stat.c
  57. test/benchmark-getaddrinfo.c
  58. test/benchmark-loop-count.c
  59. test/benchmark-million-async.c
  60. test/benchmark-million-timers.c
  61. test/benchmark-multi-accept.c
  62. test/benchmark-ping-pongs.c
  63. test/benchmark-pound.c
  64. test/benchmark-pump.c
  65. test/benchmark-sizes.c
  66. test/benchmark-spawn.c
  67. test/benchmark-tcp-write-batch.c
  68. test/benchmark-thread.c
  69. test/benchmark-udp-pummel.c
  70. test/blackhole-server.c
  71. test/dns-server.c
  72. test/echo-server.c
  73. test/run-benchmarks.c
  74. test/run-tests.c
  75. test/runner-unix.c
  76. test/runner-unix.h
  77. test/runner.c
  78. test/runner.h
  79. test/task.h
  80. test/test-active.c
  81. test/test-async.c
  82. test/test-barrier.c
  83. test/test-callback-order.c
  84. test/test-callback-stack.c
  85. test/test-condvar.c
  86. test/test-connection-fail.c
  87. test/test-cwd-and-chdir.c
  88. test/test-delayed-accept.c
  89. test/test-dlerror.c
  90. test/test-embed.c
  91. test/test-error.c
  92. test/test-fail-always.c
  93. test/test-fs-event.c
  94. test/test-fs-poll.c
  95. test/test-fs.c
  96. test/test-get-currentexe.c
  97. test/test-get-loadavg.c
  98. test/test-get-memory.c
  99. test/test-getaddrinfo.c
  100. test/test-getsockname.c
  101. test/test-hrtime.c
  102. test/test-idle.c
  103. test/test-ip6-addr.c
  104. test/test-ipc-send-recv.c
  105. test/test-ipc.c
  106. test/test-loop-handles.c
  107. test/test-multiple-listen.c
  108. test/test-mutexes.c
  109. test/test-pass-always.c
  110. test/test-ping-pong.c
  111. test/test-pipe-bind-error.c
  112. test/test-pipe-connect-error.c
  113. test/test-pipe-server-close.c
  114. test/test-platform-output.c
  115. test/test-poll-close.c
  116. test/test-poll.c
  117. test/test-process-title.c
  118. test/test-ref.c
  119. test/test-run-nowait.c
  120. test/test-run-once.c
  121. test/test-semaphore.c
  122. test/test-shutdown-close.c
  123. test/test-shutdown-eof.c
  124. test/test-signal-multiple-loops.c
  125. test/test-signal.c
  126. test/test-spawn.c
  127. test/test-stdio-over-pipes.c
  128. test/test-tcp-bind-error.c
  129. test/test-tcp-bind6-error.c
  130. test/test-tcp-close-while-connecting.c
  131. test/test-tcp-close-accept.c
  132. test/test-tcp-close.c
  133. test/test-tcp-connect-error-after-write.c
  134. test/test-tcp-connect-error.c
  135. test/test-tcp-connect-timeout.c
  136. test/test-tcp-connect6-error.c
  137. test/test-tcp-flags.c
  138. test/test-tcp-open.c
  139. test/test-tcp-read-stop.c
  140. test/test-tcp-shutdown-after-write.c
  141. test/test-tcp-unexpected-read.c
  142. test/test-tcp-write-error.c
  143. test/test-tcp-write-to-half-open-connection.c
  144. test/test-tcp-writealot.c
  145. test/test-thread.c
  146. test/test-threadpool-cancel.c
  147. test/test-threadpool.c
  148. test/test-timer-again.c
  149. test/test-timer.c
  150. test/test-tty.c
  151. test/test-udp-dgram-too-big.c
  152. test/test-udp-ipv6.c
  153. test/test-udp-multicast-join.c
  154. test/test-udp-multicast-ttl.c
  155. test/test-udp-open.c
  156. test/test-udp-options.c
  157. test/test-udp-send-and-recv.c
  158. test/test-walk-handles.c
  159. test/test-watcher-cross-stop.c
  160. "
  161. case `uname -s` in
  162. AIX)
  163. SPARSE_FLAGS="$SPARSE_FLAGS -D_AIX=1"
  164. SOURCES="$SOURCES
  165. src/unix/aix.c"
  166. ;;
  167. Darwin)
  168. SPARSE_FLAGS="$SPARSE_FLAGS -D__APPLE__=1"
  169. SOURCES="$SOURCES
  170. include/uv-bsd.h
  171. src/unix/darwin.c
  172. src/unix/kqueue.c
  173. src/unix/fsevents.c"
  174. ;;
  175. DragonFly)
  176. SPARSE_FLAGS="$SPARSE_FLAGS -D__DragonFly__=1"
  177. SOURCES="$SOURCES
  178. include/uv-bsd.h
  179. src/unix/kqueue.c
  180. src/unix/freebsd.c"
  181. ;;
  182. FreeBSD)
  183. SPARSE_FLAGS="$SPARSE_FLAGS -D__FreeBSD__=1"
  184. SOURCES="$SOURCES
  185. include/uv-bsd.h
  186. src/unix/kqueue.c
  187. src/unix/freebsd.c"
  188. ;;
  189. Linux)
  190. SPARSE_FLAGS="$SPARSE_FLAGS -D__linux__=1"
  191. SOURCES="$SOURCES
  192. include/uv-linux.h
  193. src/unix/linux-inotify.c
  194. src/unix/linux-core.c
  195. src/unix/linux-syscalls.c
  196. src/unix/linux-syscalls.h"
  197. ;;
  198. NetBSD)
  199. SPARSE_FLAGS="$SPARSE_FLAGS -D__NetBSD__=1"
  200. SOURCES="$SOURCES
  201. include/uv-bsd.h
  202. src/unix/kqueue.c
  203. src/unix/netbsd.c"
  204. ;;
  205. OpenBSD)
  206. SPARSE_FLAGS="$SPARSE_FLAGS -D__OpenBSD__=1"
  207. SOURCES="$SOURCES
  208. include/uv-bsd.h
  209. src/unix/kqueue.c
  210. src/unix/openbsd.c"
  211. ;;
  212. SunOS)
  213. SPARSE_FLAGS="$SPARSE_FLAGS -D__sun=1"
  214. SOURCES="$SOURCES
  215. include/uv-sunos.h
  216. src/unix/sunos.c"
  217. ;;
  218. esac
  219. for ARCH in __i386__ __x86_64__ __arm__ __mips__; do
  220. $SPARSE $SPARSE_FLAGS -D$ARCH=1 $SOURCES
  221. done
  222. # Tests are architecture independent.
  223. $SPARSE $SPARSE_FLAGS -Itest $TESTS