Skip to content

Commit

Permalink
[dist] Upgrade libuv
Browse files Browse the repository at this point in the history
  • Loading branch information
AvianFlu committed Feb 7, 2013
1 parent d32094e commit 4ee21e7
Show file tree
Hide file tree
Showing 143 changed files with 5,387 additions and 1,759 deletions.
3 changes: 0 additions & 3 deletions deps/libuv/LICENSE
Expand Up @@ -33,9 +33,6 @@ The externally maintained libraries used by libuv are:

- ngx_queue.h (from Nginx), copyright Igor Sysoev. Two clause BSD license.

- libev, located at ev/ is copyright Marc Alexander Lehmann, and
dual-licensed under the MIT license and GPL2.

- inet_pton and inet_ntop implementations, contained in src/inet.c, are
copyright the Internet Systems Consortium, Inc., and licensed under the ISC
license.
Expand Down
64 changes: 23 additions & 41 deletions deps/libuv/Makefile
Expand Up @@ -18,54 +18,36 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
SRCDIR ?= $(CURDIR)

ifdef MSVC
uname_S := MINGW
endif

CPPFLAGS += -Iinclude -Iinclude/uv-private

ifneq (,$(findstring MINGW,$(uname_S)))
include config-mingw.mk
else
include config-unix.mk
endif

TESTS=test/blackhole-server.c test/echo-server.c test/test-*.c
BENCHMARKS=test/blackhole-server.c test/echo-server.c test/dns-server.c test/benchmark-*.c
ifeq (,$(builddir_name))

all: libuv.a
VPATH := $(SRCDIR)
include $(SRCDIR)/build.mk

test/run-tests$(E): test/*.h test/run-tests.c $(RUNNER_SRC) test/runner-unix.c $(TESTS) libuv.a
$(CC) $(CPPFLAGS) $(RUNNER_CFLAGS) -o test/run-tests test/run-tests.c \
test/runner.c $(RUNNER_SRC) $(TESTS) libuv.a $(RUNNER_LIBS) $(RUNNER_LINKFLAGS)
else # Out of tree build.

test/run-benchmarks$(E): test/*.h test/run-benchmarks.c test/runner.c $(RUNNER_SRC) $(BENCHMARKS) libuv.a
$(CC) $(CPPFLAGS) $(RUNNER_CFLAGS) -o test/run-benchmarks test/run-benchmarks.c \
test/runner.c $(RUNNER_SRC) $(BENCHMARKS) libuv.a $(RUNNER_LIBS) $(RUNNER_LINKFLAGS)
# Drop all built-in rules.
.SUFFIXES:

test/echo.o: test/echo.c test/echo.h
$(CC) $(CPPFLAGS) $(CFLAGS) -c test/echo.c -o test/echo.o
.PHONY: $(builddir_name)
$(builddir_name): $(builddir_name)/.buildstamp
$(MAKE) -C $@ -f $(CURDIR)/Makefile $(MAKECMDGOALS) \
SRCDIR=$(CURDIR) builddir_name=

$(builddir_name)/.buildstamp:
mkdir -p $(dir $@)
touch $@

.PHONY: clean clean-platform distclean distclean-platform test bench
# Add no-op rules for Makefiles to stop make from trying to rebuild them.
Makefile:: ;
%.mk:: ;

# Turn everything else into a no-op rule that depends on the build directory.
%:: $(builddir_name) ;

test: test/run-tests$(E)
test/run-tests
.PHONY: clean
clean:
$(RM) -fr $(builddir_name)

#test-%: test/run-tests$(E)
# test/run-tests $(@:test-%=%)

bench: test/run-benchmarks$(E)
test/run-benchmarks

#bench-%: test/run-benchmarks$(E)
# test/run-benchmarks $(@:bench-%=%)

clean: clean-platform
$(RM) -f src/*.o *.a test/run-tests$(E) test/run-benchmarks$(E)

distclean: distclean-platform
$(RM) -f src/*.o *.a test/run-tests$(E) test/run-benchmarks$(E)
endif
31 changes: 23 additions & 8 deletions deps/libuv/README.md
@@ -1,8 +1,8 @@
# libuv [![Build Status](https://secure.travis-ci.org/joyent/libuv.png)](http://travis-ci.org/joyent/libuv)
# libuv

libuv is a new platform layer for Node. Its purpose is to abstract IOCP on
Windows and libev on Unix systems. We intend to eventually contain all
platform differences in this library.
Windows and epoll/kqueue/event ports/etc. on Unix systems. We intend to
eventually contain all platform differences in this library.

http://nodejs.org/

Expand Down Expand Up @@ -56,28 +56,43 @@ http://nodejs.org/
For GCC (including MinGW) there are two methods building: via normal
makefiles or via GYP. GYP is a meta-build system which can generate MSVS,
Makefile, and XCode backends. It is best used for integration into other
projects. The old (more stable) system is using Makefiles.
projects. The old system is using plain GNU Makefiles.

To build via Makefile simply execute:

make

To build with Visual Studio run the vcbuilds.bat file which will
MinGW users should run this instead:

make OS=mingw

Out-of-tree builds are supported:

make builddir_name=/path/to/builddir

To build with Visual Studio run the vcbuild.bat file which will
checkout the GYP code into build/gyp and generate the uv.sln and
related files.

Windows users can also build from cmd-line using msbuild. This is
done by running vcbuild.bat from Visual Studio command prompt.

To have GYP generate build script for another system you will need to
checkout GYP into the project tree manually:
To have GYP generate build script for another system, make sure that
you have Python 2.6 or 2.7 installed, then checkout GYP into the
project tree manually:

mkdir -p build
svn co http://gyp.googlecode.com/svn/trunk build/gyp

Or:

mkdir -p build
git clone https://git.chromium.org/external/gyp.git build/gyp

Unix users run

./gyp_uv -f make
make
make -C out

Macintosh users run

Expand Down
163 changes: 163 additions & 0 deletions deps/libuv/build.mk
@@ -0,0 +1,163 @@
# Copyright Joyent, Inc. and other Node contributors. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

OS ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"')

CPPFLAGS += -I$(SRCDIR)/include -I$(SRCDIR)/include/uv-private

ifeq (darwin,$(OS))
SOEXT = dylib
else
SOEXT = so
endif

ifneq (,$(findstring mingw,$(OS)))
include $(SRCDIR)/config-mingw.mk
else
include $(SRCDIR)/config-unix.mk
endif

BENCHMARKS= \
test/benchmark-async-pummel.o \
test/benchmark-async.o \
test/benchmark-fs-stat.o \
test/benchmark-getaddrinfo.o \
test/benchmark-loop-count.o \
test/benchmark-million-async.o \
test/benchmark-million-timers.o \
test/benchmark-multi-accept.o \
test/benchmark-ping-pongs.o \
test/benchmark-pound.o \
test/benchmark-pump.o \
test/benchmark-sizes.o \
test/benchmark-spawn.o \
test/benchmark-tcp-write-batch.o \
test/benchmark-thread.o \
test/benchmark-udp-pummel.o \
test/blackhole-server.o \
test/dns-server.o \
test/echo-server.o \

TESTS= \
test/blackhole-server.o \
test/dns-server.o \
test/echo-server.o \
test/test-active.o \
test/test-async.o \
test/test-barrier.o \
test/test-callback-order.o \
test/test-callback-stack.o \
test/test-condvar.o \
test/test-connection-fail.o \
test/test-cwd-and-chdir.o \
test/test-delayed-accept.o \
test/test-dlerror.o \
test/test-embed.o \
test/test-error.o \
test/test-fail-always.o \
test/test-fs.o \
test/test-fs-event.o \
test/test-fs-poll.o \
test/test-getaddrinfo.o \
test/test-get-currentexe.o \
test/test-get-loadavg.o \
test/test-get-memory.o \
test/test-getsockname.o \
test/test-hrtime.o \
test/test-idle.o \
test/test-ipc.o \
test/test-ipc-send-recv.o \
test/test-loop-handles.o \
test/test-multiple-listen.o \
test/test-mutexes.o \
test/test-pass-always.o \
test/test-ping-pong.o \
test/test-pipe-bind-error.o \
test/test-pipe-connect-error.o \
test/test-platform-output.o \
test/test-poll.o \
test/test-poll-close.o \
test/test-process-title.o \
test/test-ref.o \
test/test-run-nowait.o \
test/test-run-once.o \
test/test-semaphore.o \
test/test-shutdown-close.o \
test/test-shutdown-eof.o \
test/test-signal.o \
test/test-signal-multiple-loops.o \
test/test-spawn.o \
test/test-stdio-over-pipes.o \
test/test-tcp-bind6-error.o \
test/test-tcp-bind-error.o \
test/test-tcp-close.o \
test/test-tcp-close-while-connecting.o \
test/test-tcp-connect6-error.o \
test/test-tcp-connect-error-after-write.o \
test/test-tcp-connect-error.o \
test/test-tcp-connect-timeout.o \
test/test-tcp-flags.o \
test/test-tcp-open.o \
test/test-tcp-read-stop.o \
test/test-tcp-shutdown-after-write.o \
test/test-tcp-unexpected-read.o \
test/test-tcp-writealot.o \
test/test-tcp-write-to-half-open-connection.o \
test/test-thread.o \
test/test-threadpool.o \
test/test-threadpool-cancel.o \
test/test-timer-again.o \
test/test-timer.o \
test/test-tty.o \
test/test-udp-dgram-too-big.o \
test/test-udp-ipv6.o \
test/test-udp-multicast-join.o \
test/test-udp-multicast-ttl.o \
test/test-udp-open.o \
test/test-udp-options.o \
test/test-udp-send-and-recv.o \
test/test-util.o \
test/test-walk-handles.o \

all: libuv.a

run-tests$(E): test/run-tests.o test/runner.o $(RUNNER_SRC) $(TESTS) libuv.$(SOEXT)
$(CC) $(CPPFLAGS) $(RUNNER_CFLAGS) -o $@ $^ $(RUNNER_LIBS) $(RUNNER_LDFLAGS)

run-benchmarks$(E): test/run-benchmarks.o test/runner.o $(RUNNER_SRC) $(BENCHMARKS) libuv.$(SOEXT)
$(CC) $(CPPFLAGS) $(RUNNER_CFLAGS) -o $@ $^ $(RUNNER_LIBS) $(RUNNER_LDFLAGS)

test/echo.o: test/echo.c test/echo.h


.PHONY: clean clean-platform distclean distclean-platform test bench


test: run-tests$(E)
$(CURDIR)/$<

bench: run-benchmarks$(E)
$(CURDIR)/$<

clean: clean-platform
$(RM) -f *.a *.so test/run-tests$(E) test/run-benchmarks$(E)

distclean: distclean-platform
$(RM) -f *.a *.so test/run-tests$(E) test/run-benchmarks$(E)

0 comments on commit 4ee21e7

Please sign in to comment.