uv: Upgrade to v0.11.17
[platform/upstream/nodejs.git] / deps / uv / Makefile.am
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
15 ACLOCAL_AMFLAGS = -I m4
16
17 AM_CPPFLAGS = -I$(top_srcdir)/include \
18               -I$(top_srcdir)/src
19
20 include_HEADERS=include/uv.h include/uv-errno.h
21
22 CLEANFILES =
23
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 \
28                    src/inet.c \
29                    src/queue.h \
30                    src/uv-common.c \
31                    src/uv-common.h \
32                    src/version.c
33
34 if SUNOS
35 libuv_la_CFLAGS += -pthread
36 endif
37
38 if WINNT
39
40 include_HEADERS += include/uv-win.h include/tree.h
41 AM_CPPFLAGS += -I$(top_srcdir)/src/win \
42                -DWIN32_LEAN_AND_MEAN \
43                -D_WIN32_WINNT=0x0600
44 LIBS += -lws2_32 -lpsapi -liphlpapi -lshell32
45 libuv_la_SOURCES += src/win/async.c \
46                     src/win/atomicops-inl.h \
47                     src/win/core.c \
48                     src/win/dl.c \
49                     src/win/error.c \
50                     src/win/fs-event.c \
51                     src/win/fs.c \
52                     src/win/getaddrinfo.c \
53                     src/win/handle.c \
54                     src/win/handle-inl.h \
55                     src/win/internal.h \
56                     src/win/loop-watcher.c \
57                     src/win/pipe.c \
58                     src/win/poll.c \
59                     src/win/process-stdio.c \
60                     src/win/process.c \
61                     src/win/req.c \
62                     src/win/req-inl.h \
63                     src/win/signal.c \
64                     src/win/stream.c \
65                     src/win/stream-inl.h \
66                     src/win/tcp.c \
67                     src/win/thread.c \
68                     src/win/threadpool.c \
69                     src/win/timer.c \
70                     src/win/tty.c \
71                     src/win/udp.c \
72                     src/win/util.c \
73                     src/win/winapi.c \
74                     src/win/winapi.h \
75                     src/win/winsock.c \
76                     src/win/winsock.h
77
78 else  # WINNT
79
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 \
84                    src/unix/core.c \
85                    src/unix/dl.c \
86                    src/unix/fs.c \
87                    src/unix/getaddrinfo.c \
88                    src/unix/internal.h \
89                    src/unix/loop-watcher.c \
90                    src/unix/loop.c \
91                    src/unix/pipe.c \
92                    src/unix/poll.c \
93                    src/unix/process.c \
94                    src/unix/signal.c \
95                    src/unix/spinlock.h \
96                    src/unix/stream.c \
97                    src/unix/tcp.c \
98                    src/unix/thread.c \
99                    src/unix/threadpool.c \
100                    src/unix/timer.c \
101                    src/unix/tty.c \
102                    src/unix/udp.c
103
104 endif  # WINNT
105
106 TESTS = test/run-tests
107 check_PROGRAMS = test/run-tests
108 test_run_tests_SOURCES = test/blackhole-server.c \
109                          test/dns-server.c \
110                          test/echo-server.c \
111                          test/run-tests.c \
112                          test/runner.c \
113                          test/runner.h \
114                          test/task.h \
115                          test/test-active.c \
116                          test/test-async.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 \
128                          test/test-embed.c \
129                          test/test-emfile.c \
130                          test/test-error.c \
131                          test/test-fail-always.c \
132                          test/test-fs-event.c \
133                          test/test-fs-poll.c \
134                          test/test-fs.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 \
140                          test/test-hrtime.c \
141                          test/test-idle.c \
142                          test/test-ip4-addr.c \
143                          test/test-ip6-addr.c \
144                          test/test-ipc-send-recv.c \
145                          test/test-ipc.c \
146                          test/test-list.h \
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 \
161                          test/test-poll.c \
162                          test/test-process-title.c \
163                          test/test-ref.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 \
170                          test/test-signal.c \
171                          test/test-spawn.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 \
190                          test/test-thread.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 \
195                          test/test-timer.c \
196                          test/test-tty.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
207
208 if WINNT
209 test_run_tests_SOURCES += test/runner-win.c \
210                           test/runner-win.h
211 else
212 test_run_tests_SOURCES += test/runner-unix.c \
213                           test/runner-unix.h
214 endif
215
216
217
218 if AIX
219 libuv_la_CFLAGS += -D_ALL_SOURCE -D_XOPEN_SOURCE=500
220 libuv_la_SOURCES += src/unix/aix.c
221 endif
222
223 if DARWIN
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 \
229                     src/unix/kqueue.c \
230                     src/unix/proctitle.c
231 endif
232
233 if FREEBSD
234 include_HEADERS += include/uv-bsd.h
235 libuv_la_SOURCES += src/unix/freebsd.c src/unix/kqueue.c
236 endif
237
238 if LINUX
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 \
244                     src/unix/proctitle.c
245 endif
246
247 if NETBSD
248 include_HEADERS += include/uv-bsd.h
249 libuv_la_SOURCES += src/unix/kqueue.c src/unix/netbsd.c
250 endif
251
252 if OPENBSD
253 include_HEADERS += include/uv-bsd.h
254 libuv_la_SOURCES += src/unix/kqueue.c src/unix/openbsd.c
255 endif
256
257 if SUNOS
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
261 endif
262
263 if HAVE_DTRACE
264 BUILT_SOURCES = include/uv-dtrace.h
265 CLEANFILES += include/uv-dtrace.h
266 endif
267
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
273 endif
274
275 if HAVE_PKG_CONFIG
276 pkgconfigdir = $(libdir)/pkgconfig
277 pkgconfig_DATA = @PACKAGE_NAME@.pc
278 endif
279
280 if HAVE_DTRACE
281 include/uv-dtrace.h: src/unix/uv-dtrace.d
282         $(AM_V_GEN)$(DTRACE) $(DTRACEFLAGS) -h -xnolibs -s $< -o $(top_srcdir)/$@
283 endif
284
285 if DTRACE_NEEDS_OBJECTS
286 SUFFIXES = .d
287
288 src/unix/uv-dtrace.o: src/unix/uv-dtrace.d ${libuv_la_OBJECTS}
289
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
292 .d.o:
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
302 endif