summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile19
-rw-r--r--darwin-config.h25
-rw-r--r--darwin-eprintf.c7
-rw-r--r--includes/BString.h2
-rw-r--r--linux-config.h2
-rw-r--r--mingw32-config.h2
6 files changed, 49 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 74e2817..9eb4d53 100644
--- a/Makefile
+++ b/Makefile
@@ -34,12 +34,13 @@ ifeq ($(SYSTEM),Darwin)
STRIP = strip -x
ifeq ($(TRUESYSTEM),Linux)
CROSSCOMPILE = true
+ ARCH_FLAGS =
CC = i686-apple-darwin9-gcc
CXX = i686-apple-darwin9-g++
- LD = i686-apple-darwin-g++ -arch i386 -mmacosx-version-min=10.5
- STRIP = i686-apple-darwin-strip -x
- AS = i686-apple-darwin-as -arch i386
- AR = i686-apple-darwin-ar rcs
+ LD = i686-apple-darwin9-g++ -arch i386 -mmacosx-version-min=10.5
+ STRIP = i686-apple-darwin9-strip -x
+ AS = i686-apple-darwin9-as -arch i386
+ AR = i686-apple-darwin9-ar rcs
endif
endif
@@ -127,6 +128,12 @@ relocatable.c \
endif
+ifeq ($(SYSTEM),Darwin)
+DARWIN_SOURCES = \
+darwin-eprintf.c \
+
+endif
+
LIBCORO_SOURCES = \
coro.c \
@@ -145,9 +152,9 @@ test-Handles.cc \
LIB = libBalau.a
-BALAU_OBJECTS = $(addsuffix .o, $(notdir $(basename $(BALAU_SOURCES) $(LIBCORO_SOURCES) $(LIBEIO_SOURCES) $(LIBEV_SOURCES) $(WIN32_SOURCES))))
+BALAU_OBJECTS = $(addsuffix .o, $(notdir $(basename $(BALAU_SOURCES) $(LIBCORO_SOURCES) $(LIBEIO_SOURCES) $(LIBEV_SOURCES) $(WIN32_SOURCES) $(DARWIN_SOURCES))))
-WHOLE_SOURCES = $(BALAU_SOURCES) $(LIBCORO_SOURCES) $(LIBEIO_SOURCES) $(LIBEV_SOURCES) $(WIN32_SOURCES) $(TEST_SOURCES)
+WHOLE_SOURCES = $(BALAU_SOURCES) $(LIBCORO_SOURCES) $(LIBEIO_SOURCES) $(LIBEV_SOURCES) $(WIN32_SOURCES) $(DARWIN_SOURCES) $(TEST_SOURCES)
TESTS = $(addsuffix .$(BINEXT), $(notdir $(basename $(TEST_SOURCES))))
ALL_OBJECTS = $(addsuffix .o, $(notdir $(basename $(WHOLE_SOURCES))))
diff --git a/darwin-config.h b/darwin-config.h
index 98f087f..b37d5b5 100644
--- a/darwin-config.h
+++ b/darwin-config.h
@@ -1,4 +1,29 @@
+#define PIC 1
+
#define STDC_HEADERS 1
#define WORDS_LITTLEENDIAN 1
#define CORO_SJLJ 1
#define _FILE_OFFSET_BITS 64
+
+#define EMBED_LIBEIO 1
+#define EV_STANDALONE 1
+
+#define HAVE_DLFCN_H 1
+#define HAVE_INTTYPES_H 1
+#define HAVE_MEMORY_H 1
+#define HAVE_STDINT_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STRINGS_H 1
+#define HAVE_STRING_H 1
+#define HAVE_SYS_STAT_H 1
+#define HAVE_SYS_SYSCALL_H 1
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_UNISTD_H 1
+
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+
+#define HAVE_POLL_H 1
+#define HAVE_SYS_EVENT_H 1
+#define HAVE_SYS_SELECT_H 1
diff --git a/darwin-eprintf.c b/darwin-eprintf.c
new file mode 100644
index 0000000..d5b2553
--- /dev/null
+++ b/darwin-eprintf.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+void __eprintf(const char * msg, const char * file, unsigned line, const char * e) {
+ fprintf(stderr, msg, file, line, e);
+ abort();
+}
diff --git a/includes/BString.h b/includes/BString.h
index 5356310..794126f 100644
--- a/includes/BString.h
+++ b/includes/BString.h
@@ -3,7 +3,9 @@
#include <stdarg.h>
#include <string.h>
#include <stdint.h>
+#ifndef __APPLE__
#include <malloc.h>
+#endif
#include <stdlib.h>
#include <string>
diff --git a/linux-config.h b/linux-config.h
index cb3b1b1..4531a67 100644
--- a/linux-config.h
+++ b/linux-config.h
@@ -4,7 +4,7 @@
#define WORDS_LITTLEENDIAN 1
#define CORO_ASM 1
#define _FILE_OFFSET_BITS 64
-#define EMBED_LIBEIO
+#define EMBED_LIBEIO 1
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
diff --git a/mingw32-config.h b/mingw32-config.h
index d5f419b..4910388 100644
--- a/mingw32-config.h
+++ b/mingw32-config.h
@@ -11,7 +11,7 @@
#define WORDS_LITTLEENDIAN 1
#define CORO_LOSER 1
#define _FILE_OFFSET_BITS 64
-#define EMBED_LIBEIO
+#define EMBED_LIBEIO 1
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1