Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
src/ and include/ directories
Browse files Browse the repository at this point in the history
Helps #71 but does not update the MSVC files.
  • Loading branch information
ry committed Jul 7, 2011
1 parent 2b2980e commit ce8ff30
Show file tree
Hide file tree
Showing 184 changed files with 114 additions and 110 deletions.
89 changes: 45 additions & 44 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,51 +24,52 @@ ifdef MSVC
uname_S := MINGW
endif

CPPFLAGS += -Ic-ares/
CPPFLAGS += -Iinclude

CARES_OBJS =
CARES_OBJS += c-ares/ares__close_sockets.o
CARES_OBJS += c-ares/ares__get_hostent.o
CARES_OBJS += c-ares/ares__read_line.o
CARES_OBJS += c-ares/ares__timeval.o
CARES_OBJS += c-ares/ares_cancel.o
CARES_OBJS += c-ares/ares_data.o
CARES_OBJS += c-ares/ares_destroy.o
CARES_OBJS += c-ares/ares_expand_name.o
CARES_OBJS += c-ares/ares_expand_string.o
CARES_OBJS += c-ares/ares_fds.o
CARES_OBJS += c-ares/ares_free_hostent.o
CARES_OBJS += c-ares/ares_free_string.o
CARES_OBJS += c-ares/ares_gethostbyaddr.o
CARES_OBJS += c-ares/ares_gethostbyname.o
CARES_OBJS += c-ares/ares_getnameinfo.o
CARES_OBJS += c-ares/ares_getopt.o
CARES_OBJS += c-ares/ares_getsock.o
CARES_OBJS += c-ares/ares_init.o
CARES_OBJS += c-ares/ares_library_init.o
CARES_OBJS += c-ares/ares_llist.o
CARES_OBJS += c-ares/ares_mkquery.o
CARES_OBJS += c-ares/ares_nowarn.o
CARES_OBJS += c-ares/ares_options.o
CARES_OBJS += c-ares/ares_parse_a_reply.o
CARES_OBJS += c-ares/ares_parse_aaaa_reply.o
CARES_OBJS += c-ares/ares_parse_mx_reply.o
CARES_OBJS += c-ares/ares_parse_ns_reply.o
CARES_OBJS += c-ares/ares_parse_ptr_reply.o
CARES_OBJS += c-ares/ares_parse_srv_reply.o
CARES_OBJS += c-ares/ares_parse_txt_reply.o
CARES_OBJS += c-ares/ares_process.o
CARES_OBJS += c-ares/ares_query.o
CARES_OBJS += c-ares/ares_search.o
CARES_OBJS += c-ares/ares_send.o
CARES_OBJS += c-ares/ares_strcasecmp.o
CARES_OBJS += c-ares/ares_strdup.o
CARES_OBJS += c-ares/ares_strerror.o
CARES_OBJS += c-ares/ares_timeout.o
CARES_OBJS += c-ares/ares_version.o
CARES_OBJS += c-ares/ares_writev.o
CARES_OBJS += c-ares/bitncmp.o
CARES_OBJS += c-ares/inet_net_pton.o
CARES_OBJS += c-ares/inet_ntop.o
CARES_OBJS += src/ares/ares__close_sockets.o
CARES_OBJS += src/ares/ares__get_hostent.o
CARES_OBJS += src/ares/ares__read_line.o
CARES_OBJS += src/ares/ares__timeval.o
CARES_OBJS += src/ares/ares_cancel.o
CARES_OBJS += src/ares/ares_data.o
CARES_OBJS += src/ares/ares_destroy.o
CARES_OBJS += src/ares/ares_expand_name.o
CARES_OBJS += src/ares/ares_expand_string.o
CARES_OBJS += src/ares/ares_fds.o
CARES_OBJS += src/ares/ares_free_hostent.o
CARES_OBJS += src/ares/ares_free_string.o
CARES_OBJS += src/ares/ares_gethostbyaddr.o
CARES_OBJS += src/ares/ares_gethostbyname.o
CARES_OBJS += src/ares/ares_getnameinfo.o
CARES_OBJS += src/ares/ares_getopt.o
CARES_OBJS += src/ares/ares_getsock.o
CARES_OBJS += src/ares/ares_init.o
CARES_OBJS += src/ares/ares_library_init.o
CARES_OBJS += src/ares/ares_llist.o
CARES_OBJS += src/ares/ares_mkquery.o
CARES_OBJS += src/ares/ares_nowarn.o
CARES_OBJS += src/ares/ares_options.o
CARES_OBJS += src/ares/ares_parse_a_reply.o
CARES_OBJS += src/ares/ares_parse_aaaa_reply.o
CARES_OBJS += src/ares/ares_parse_mx_reply.o
CARES_OBJS += src/ares/ares_parse_ns_reply.o
CARES_OBJS += src/ares/ares_parse_ptr_reply.o
CARES_OBJS += src/ares/ares_parse_srv_reply.o
CARES_OBJS += src/ares/ares_parse_txt_reply.o
CARES_OBJS += src/ares/ares_process.o
CARES_OBJS += src/ares/ares_query.o
CARES_OBJS += src/ares/ares_search.o
CARES_OBJS += src/ares/ares_send.o
CARES_OBJS += src/ares/ares_strcasecmp.o
CARES_OBJS += src/ares/ares_strdup.o
CARES_OBJS += src/ares/ares_strerror.o
CARES_OBJS += src/ares/ares_timeout.o
CARES_OBJS += src/ares/ares_version.o
CARES_OBJS += src/ares/ares_writev.o
CARES_OBJS += src/ares/bitncmp.o
CARES_OBJS += src/ares/inet_net_pton.o
CARES_OBJS += src/ares/inet_ntop.o

ifneq (,$(findstring MINGW,$(uname_S)))
include config-mingw.mk
Expand Down
30 changes: 16 additions & 14 deletions config-mingw.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,38 +24,40 @@ CC = $(PREFIX)gcc
AR = $(PREFIX)ar
E=.exe

CFLAGS=-g --std=gnu89 -D_WIN32_WINNT=0x0501 -Ic-ares/config_win32
CFLAGS=$(CPPFLAGS) -g --std=gnu89 -D_WIN32_WINNT=0x0501 -Isrc/ares/config_win32
LINKFLAGS=-lm

CARES_OBJS += c-ares/windows_port.o
CARES_OBJS += src/ares/windows_port.o

RUNNER_CFLAGS=$(CFLAGS) -D_GNU_SOURCE # Need _GNU_SOURCE for strdup?
RUNNER_LINKFLAGS=$(LINKFLAGS)
RUNNER_LIBS=-lws2_32
RUNNER_SRC=test/runner-win.c

uv.a: uv-win.o uv-common.o uv-eio.o eio/eio.o $(CARES_OBJS)
$(AR) rcs uv.a uv-win.o uv-common.o uv-eio.o eio/eio.o $(CARES_OBJS)
uv.a: src/uv-win.o src/uv-common.o src/uv-eio.o src/eio/eio.o $(CARES_OBJS)
$(AR) rcs uv.a src/uv-win.o src/uv-common.o src/uv-eio.o src/eio/eio.o $(CARES_OBJS)

uv-win.o: uv-win.c uv.h uv-win.h
$(CC) $(CFLAGS) -c uv-win.c -o uv-win.o
src/uv-win.o: src/uv-win.c include/uv.h include/uv-win.h
$(CC) $(CFLAGS) -c src/uv-win.c -o src/uv-win.o

uv-common.o: uv-common.c uv.h uv-win.h
$(CC) $(CFLAGS) -c uv-common.c -o uv-common.o
src/uv-common.o: src/uv-common.c include/uv.h include/uv-win.h
$(CC) $(CFLAGS) -c src/uv-common.c -o src/uv-common.o

EIO_CPPFLAGS += $(CPPFLAGS)
EIO_CPPFLAGS += -DEIO_CONFIG_H=\"$(EIO_CONFIG)\"
EIO_CPPFLAGS += -DEIO_STACKSIZE=65536
EIO_CPPFLAGS += -D_GNU_SOURCE

eio/eio.o: eio/eio.c
$(CC) $(EIO_CPPFLAGS) $(CFLAGS) -c eio/eio.c -o eio/eio.o
src/eio/eio.o: src/eio/eio.c
$(CC) $(EIO_CPPFLAGS) $(CFLAGS) -c src/eio/eio.c -o src/eio/eio.o

uv-eio.o: uv-eio.c
$(CC) $(CPPFLAGS) -Ieio/ $(CFLAGS) -c uv-eio.c -o uv-eio.o
src/uv-eio.o: src/uv-eio.c
$(CC) $(CPPFLAGS) -Isrc/eio/ $(CFLAGS) -c src/uv-eio.c -o src/uv-eio.o

clean-platform:
-rm -f c-ares/*.o
-rm -f src/ares/*.o
-rm -f src/eio/*.o

distclean-platform:
-rm -f c-ares/*.o
-rm -f src/ares/*.o
-rm -f src/eio/*.o
53 changes: 27 additions & 26 deletions config-unix.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ CC = $(PREFIX)gcc
AR = $(PREFIX)ar
E=
CFLAGS=--std=gnu89 -g
CPPFLAGS += -Isrc/ev
LINKFLAGS=-lm

CPPFLAGS += -D_LARGEFILE_SOURCE
Expand All @@ -30,39 +31,39 @@ CPPFLAGS += -D_FILE_OFFSET_BITS=64
ifeq (SunOS,$(uname_S))
EV_CONFIG=config_sunos.h
EIO_CONFIG=config_sunos.h
CPPFLAGS += -Ic-ares/config_sunos
CPPFLAGS += -Isrc/ares/config_sunos
LINKFLAGS+=-lsocket -lnsl
UV_OS_FILE=uv-sunos.c
endif

ifeq (Darwin,$(uname_S))
EV_CONFIG=config_darwin.h
EIO_CONFIG=config_darwin.h
CPPFLAGS += -Ic-ares/config_darwin
CPPFLAGS += -Isrc/ares/config_darwin
LINKFLAGS+=-framework CoreServices
UV_OS_FILE=uv-darwin.c
endif

ifeq (Linux,$(uname_S))
EV_CONFIG=config_linux.h
EIO_CONFIG=config_linux.h
CPPFLAGS += -Ic-ares/config_linux
CPPFLAGS += -Isrc/ares/config_linux
LINKFLAGS+=-lrt
UV_OS_FILE=uv-linux.c
endif

ifeq (FreeBSD,$(uname_S))
EV_CONFIG=config_freebsd.h
EIO_CONFIG=config_freebsd.h
CPPFLAGS += -Ic-ares/config_freebsd
CPPFLAGS += -Isrc/ares/config_freebsd
LINKFLAGS+=
UV_OS_FILE=uv-freebsd.c
endif

ifneq (,$(findstring CYGWIN,$(uname_S)))
EV_CONFIG=config_cygwin.h
EIO_CONFIG=config_cygwin.h
CPPFLAGS += -Ic-ares/config_cygwin
CPPFLAGS += -Isrc/ares/config_cygwin
LINKFLAGS+=
UV_OS_FILE=uv-cygwin.c
endif
Expand All @@ -74,43 +75,43 @@ RUNNER_LINKFLAGS=$(LINKFLAGS) -pthread
RUNNER_LIBS=
RUNNER_SRC=test/runner-unix.c

uv.a: uv-unix.o uv-common.o uv-platform.o ev/ev.o uv-eio.o eio/eio.o $(CARES_OBJS)
$(AR) rcs uv.a uv-unix.o uv-platform.o uv-common.o uv-eio.o ev/ev.o \
eio/eio.o $(CARES_OBJS)
uv.a: src/uv-unix.o src/uv-common.o src/uv-platform.o src/ev/ev.o src/uv-eio.o src/eio/eio.o $(CARES_OBJS)
$(AR) rcs uv.a src/uv-unix.o src/uv-platform.o src/uv-common.o src/uv-eio.o src/ev/ev.o \
src/eio/eio.o $(CARES_OBJS)

uv-platform.o: $(UV_OS_FILE) uv.h uv-unix.h
$(CC) $(CPPFLAGS) $(CFLAGS) -c $(UV_OS_FILE) -o uv-platform.o
src/uv-platform.o: src/$(UV_OS_FILE) include/uv.h include/uv-unix.h
$(CC) $(CPPFLAGS) $(CFLAGS) -c src/$(UV_OS_FILE) -o src/uv-platform.o

uv-unix.o: uv-unix.c uv.h uv-unix.h
$(CC) $(CPPFLAGS) -Ieio $(CFLAGS) -c uv-unix.c -o uv-unix.o
src/uv-unix.o: src/uv-unix.c include/uv.h include/uv-unix.h
$(CC) $(CPPFLAGS) -Ieio $(CFLAGS) -c src/uv-unix.c -o src/uv-unix.o

uv-common.o: uv-common.c uv.h uv-unix.h
$(CC) $(CPPFLAGS) $(CFLAGS) -c uv-common.c -o uv-common.o
src/uv-common.o: src/uv-common.c include/uv.h include/uv-unix.h
$(CC) $(CPPFLAGS) $(CFLAGS) -c src/uv-common.c -o src/uv-common.o

ev/ev.o: ev/ev.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c ev/ev.c -o ev/ev.o -DEV_CONFIG_H=\"$(EV_CONFIG)\"
src/ev/ev.o: src/ev/ev.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c src/ev/ev.c -o src/ev/ev.o -DEV_CONFIG_H=\"$(EV_CONFIG)\"


EIO_CPPFLAGS += $(CPPFLAGS)
EIO_CPPFLAGS += -DEIO_CONFIG_H=\"$(EIO_CONFIG)\"
EIO_CPPFLAGS += -DEIO_STACKSIZE=65536
EIO_CPPFLAGS += -D_GNU_SOURCE

eio/eio.o: eio/eio.c
$(CC) $(EIO_CPPFLAGS) $(CFLAGS) -c eio/eio.c -o eio/eio.o
src/eio/eio.o: src/eio/eio.c
$(CC) $(EIO_CPPFLAGS) $(CFLAGS) -c src/eio/eio.c -o src/eio/eio.o

uv-eio.o: uv-eio.c
$(CC) $(CPPFLAGS) -Ieio/ $(CFLAGS) -c uv-eio.c -o uv-eio.o
src/uv-eio.o: src/uv-eio.c
$(CC) $(CPPFLAGS) -Isrc/eio/ $(CFLAGS) -c src/uv-eio.c -o src/uv-eio.o


clean-platform:
-rm -f c-ares/*.o
-rm -f ev/*.o
-rm -f eio/*.o
-rm -f src/ares/*.o
-rm -f src/ev/*.o
-rm -f src/eio/*.o
-rm -rf test/run-tests.dSYM run-benchmarks.dSYM

distclean-platform:
-rm -f c-ares/*.o
-rm -f ev/*.o
-rm -f eio/*.o
-rm -f src/ares/*.o
-rm -f src/ev/*.o
-rm -f src/eio/*.o
-rm -rf test/run-tests.dSYM run-benchmarks.dSYM
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion uv-unix.h → include/uv-unix.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include "ngx-queue.h"

#include "ev/ev.h"
#include "ev.h"

#include <sys/types.h>
#include <sys/socket.h>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion uv.h → include/uv.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extern "C" {
#include <stdint.h> /* int64_t */
#include <sys/types.h> /* size_t */

#include "c-ares/ares.h"
#include "ares.h"

#ifndef _SSIZE_T_
typedef intptr_t ssize_t;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion uv-common.c → src/uv-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

/* use inet_pton from c-ares if necessary */
#include "ares_config.h"
#include "c-ares/inet_net_pton.h"
#include "ares/inet_net_pton.h"

/* list used for ares task handles */
static uv_ares_task_t* uv_ares_handles_ = NULL;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/benchmark-ares.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* IN THE SOFTWARE.
*/

#include "../uv.h"
#include "uv.h"
#include "task.h"

#include <stdlib.h>
Expand Down
2 changes: 1 addition & 1 deletion test/benchmark-getaddrinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* IN THE SOFTWARE.
*/

#include "../uv.h"
#include "uv.h"
#include "task.h"

#include <stdlib.h>
Expand Down
2 changes: 1 addition & 1 deletion test/benchmark-ping-pongs.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* IN THE SOFTWARE.
*/

#include "../uv.h"
#include "uv.h"
#include "task.h"

#include <stdlib.h>
Expand Down
2 changes: 1 addition & 1 deletion test/benchmark-pump.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/

#include "task.h"
#include "../uv.h"
#include "uv.h"

#include <math.h>
#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion test/benchmark-sizes.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/

#include "task.h"
#include "../uv.h"
#include "uv.h"


BENCHMARK_IMPL(sizes) {
Expand Down
2 changes: 1 addition & 1 deletion test/dns-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* IN THE SOFTWARE.
*/

#include "../uv.h"
#include "uv.h"
#include "task.h"
#include <stdio.h>
#include <stdlib.h>
Expand Down
2 changes: 1 addition & 1 deletion test/echo-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* IN THE SOFTWARE.
*/

#include "../uv.h"
#include "uv.h"
#include "task.h"
#include <stdio.h>
#include <stdlib.h>
Expand Down
2 changes: 1 addition & 1 deletion test/test-async.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* IN THE SOFTWARE.
*/

#include "../uv.h"
#include "uv.h"
#include "task.h"
#include <stdio.h>
#include <stdlib.h>
Expand Down
2 changes: 1 addition & 1 deletion test/test-bind-error.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* IN THE SOFTWARE.
*/

#include "../uv.h"
#include "uv.h"
#include "task.h"
#include <stdio.h>
#include <stdlib.h>
Expand Down
2 changes: 1 addition & 1 deletion test/test-bind6-error.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* IN THE SOFTWARE.
*/

#include "../uv.h"
#include "uv.h"
#include "task.h"
#include <stdio.h>
#include <stdlib.h>
Expand Down
2 changes: 1 addition & 1 deletion test/test-callback-stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* stack.
*/

#include "../uv.h"
#include "uv.h"
#include "task.h"


Expand Down
Loading

0 comments on commit ce8ff30

Please sign in to comment.