From 74adacf6ec1de10b623112605b5d9610163522ec Mon Sep 17 00:00:00 2001 From: Pixel Date: Sun, 9 Oct 2011 13:24:33 -0700 Subject: Adding libev. --- .gitmodules | 3 +++ Makefile | 14 +++++++++----- libev | 1 + linux-config.h | 22 ++++++++++++++++++++++ 4 files changed, 35 insertions(+), 5 deletions(-) create mode 160000 libev diff --git a/.gitmodules b/.gitmodules index 1ef9305..d9dd7a4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "libeio"] path = libeio url = git.grumpycoder.net:/pub/repo.git/libeio +[submodule "libev"] + path = libev + url = git.grumpycoder.net:/pub/repo.git/libev diff --git a/Makefile b/Makefile index a5463d3..5d0ed2b 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ LD = g++ AS = gcc -c AR = ar rcs -CPPFLAGS += -DPIC -fPIC +CPPFLAGS += -fPIC LDFLAGS += -fPIC ifeq ($(DEBUG),) CPPFLAGS += -O3 @@ -21,7 +21,7 @@ CPPFLAGS += -g LDFLAGS += -g endif -INCLUDES = includes libcoro libeio +INCLUDES = includes libcoro libeio libev ifeq ($(SYSTEM),Darwin) LIBS += pthread @@ -53,7 +53,7 @@ CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS) LDFLAGS += $(ARCH_FLAGS) $(addprefix -l, $(LIBS)) vpath %.cc src:tests -vpath %.c libcoro:libeio +vpath %.c libcoro:libeio:libev BALAU_SOURCES = \ BString.cc \ @@ -66,6 +66,10 @@ TaskMan.cc \ LIBCORO_SOURCES = \ coro.c \ +LIBEV_SOURCES = \ +ev.c \ +event.c \ + LIBEIO_SOURCES = \ eio.c \ @@ -76,9 +80,9 @@ test-Tasks.cc \ LIB = libBalau.a -BALAU_OBJECTS = $(addsuffix .o, $(notdir $(basename $(BALAU_SOURCES) $(LIBCORO_SOURCES)))) +BALAU_OBJECTS = $(addsuffix .o, $(notdir $(basename $(BALAU_SOURCES) $(LIBCORO_SOURCES) $(LIBEIO_SOURCES) $(LIBEV_SOURCES)))) -WHOLE_SOURCES = $(BALAU_SOURCES) $(LIBCORO_SOURCES) $(LIBEIO_SOURCES) $(TEST_SOURCES) +WHOLE_SOURCES = $(BALAU_SOURCES) $(LIBCORO_SOURCES) $(LIBEIO_SOURCES) $(LIBEV_SOURCES) $(TEST_SOURCES) TESTS = $(addsuffix .bin, $(notdir $(basename $(TEST_SOURCES)))) ALL_OBJECTS = $(addsuffix .o, $(notdir $(basename $(WHOLE_SOURCES)))) diff --git a/libev b/libev new file mode 160000 index 0000000..71c4c24 --- /dev/null +++ b/libev @@ -0,0 +1 @@ +Subproject commit 71c4c2467848e78e6b7098bbcb4ac30ce62a40a2 diff --git a/linux-config.h b/linux-config.h index 4a0bf0b..10e8bee 100644 --- a/linux-config.h +++ b/linux-config.h @@ -1,9 +1,15 @@ +#define PIC 1 + #define STDC_HEADERS 1 #define WORDS_LITTLEENDIAN 1 #define CORO_ASM 1 #define _FILE_OFFSET_BITS 64 #define EMBED_LIBEIO +#ifndef _GNU_SOURCE +#define _GNU_SOURCE 1 +#endif + /* libeio config */ #define HAVE_FALLOCATE 1 #define HAVE_FDATASYNC 1 @@ -18,3 +24,19 @@ #define HAVE_SYS_SYNCFS 1 #define HAVE_SYS_SYSCALL_H 1 #define HAVE_UTIMES 1 + +/* libev config */ +#define HAVE_CLOCK_SYSCALL 1 +#define HAVE_EPOLL_CTL 1 +#define HAVE_EVENTFD 1 +#define HAVE_FLOOR 1 +#define HAVE_INOTIFY_INIT 1 +#define HAVE_NANOSLEEP 1 +#define HAVE_POLL 1 +#define HAVE_POLL_H 1 +#define HAVE_SELECT 1 +#define HAVE_SIGNALFD 1 +#define HAVE_SYS_EPOLL_H 1 +#define HAVE_SYS_INOTIFY_H 1 +#define HAVE_SYS_SELECT_H 1 +#define HAVE_SYS_SIGNALFD_H 1 -- cgit v1.2.3