summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitmodules3
-rw-r--r--Makefile21
m---------libeio0
-rw-r--r--linux-config.h16
4 files changed, 34 insertions, 6 deletions
diff --git a/.gitmodules b/.gitmodules
index 55cf452..1ef9305 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,6 @@
[submodule "libcoro"]
path = libcoro
url = git.grumpycoder.net:/pub/repo.git/libcoro
+[submodule "libeio"]
+ path = libeio
+ url = git.grumpycoder.net:/pub/repo.git/libeio
diff --git a/Makefile b/Makefile
index 59fa941..a5463d3 100644
--- a/Makefile
+++ b/Makefile
@@ -12,6 +12,8 @@ LD = g++
AS = gcc -c
AR = ar rcs
+CPPFLAGS += -DPIC -fPIC
+LDFLAGS += -fPIC
ifeq ($(DEBUG),)
CPPFLAGS += -O3
else
@@ -19,7 +21,10 @@ CPPFLAGS += -g
LDFLAGS += -g
endif
+INCLUDES = includes libcoro libeio
+
ifeq ($(SYSTEM),Darwin)
+ LIBS += pthread
CONFIG_H = darwin-config.h
ARCH_FLAGS = -arch i386
LIBS = -liconv
@@ -33,21 +38,22 @@ ifeq ($(SYSTEM),Darwin)
AS = i686-apple-darwin-as -arch i386
endif
else
+ifeq ($(SYSTEM),Linux)
+ LIBS += pthread
CONFIG_H = linux-config.h
ARCH_FLAGS = -march=i686 -m32
ASFLAGS = -march=i686 --32
STRIP = strip --strip-unneeded
endif
+endif
-INCLUDES = -Iincludes -Ilibcoro
-
-CPPFLAGS_NO_ARCH += $(INCLUDES) -fexceptions -Wno-deprecated -imacros $(CONFIG_H)
+CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) -fexceptions -Wno-deprecated -imacros $(CONFIG_H)
CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS)
-LDFLAGS += $(ARCH_FLAGS) $(LIBS)
+LDFLAGS += $(ARCH_FLAGS) $(addprefix -l, $(LIBS))
vpath %.cc src:tests
-vpath %.c libcoro
+vpath %.c libcoro:libeio
BALAU_SOURCES = \
BString.cc \
@@ -60,6 +66,9 @@ TaskMan.cc \
LIBCORO_SOURCES = \
coro.c \
+LIBEIO_SOURCES = \
+eio.c \
+
TEST_SOURCES = \
test-Sanity.cc \
test-String.cc \
@@ -69,7 +78,7 @@ LIB = libBalau.a
BALAU_OBJECTS = $(addsuffix .o, $(notdir $(basename $(BALAU_SOURCES) $(LIBCORO_SOURCES))))
-WHOLE_SOURCES = $(BALAU_SOURCES) $(LIBCORO_SOURCES) $(TEST_SOURCES)
+WHOLE_SOURCES = $(BALAU_SOURCES) $(LIBCORO_SOURCES) $(LIBEIO_SOURCES) $(TEST_SOURCES)
TESTS = $(addsuffix .bin, $(notdir $(basename $(TEST_SOURCES))))
ALL_OBJECTS = $(addsuffix .o, $(notdir $(basename $(WHOLE_SOURCES))))
diff --git a/libeio b/libeio
new file mode 160000
+Subproject 6666ffcbf14029d651d1ab709aafa29a56a0130
diff --git a/linux-config.h b/linux-config.h
index 9ac5c07..4a0bf0b 100644
--- a/linux-config.h
+++ b/linux-config.h
@@ -2,3 +2,19 @@
#define WORDS_LITTLEENDIAN 1
#define CORO_ASM 1
#define _FILE_OFFSET_BITS 64
+#define EMBED_LIBEIO
+
+/* libeio config */
+#define HAVE_FALLOCATE 1
+#define HAVE_FDATASYNC 1
+#define HAVE_FUTIMES 1
+#define HAVE_PRCTL_SET_NAME 1
+#define HAVE_PREADWRITE 1
+#define HAVE_READAHEAD 1
+#define HAVE_SENDFILE 1
+#define HAVE_STDINT_H 1
+#define HAVE_SYNC_FILE_RANGE 1
+#define HAVE_SYS_PRCTL_H 1
+#define HAVE_SYS_SYNCFS 1
+#define HAVE_SYS_SYSCALL_H 1
+#define HAVE_UTIMES 1