From 87c8cc5b2dd81f9b17eb40d2eb165d3e946aaf21 Mon Sep 17 00:00:00 2001 From: Emil Renner Berthing Date: Sat, 11 Jun 2011 19:41:55 +0200 Subject: fix compilation on OSX --- Makefile | 8 +++++++- config.Darwin | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 config.Darwin diff --git a/Makefile b/Makefile index 573fb18..40b7613 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,12 @@ BINDIR = $(PREFIX)/bin INCDIR = $(PREFIX)/include PKG_CONFIG_PATH = $(PREFIX)/lib/pkgconfig +ifeq ($(OS),Darwin) +SHARED = -dynamiclib -Wl,-undefined,dynamic_lookup +else +SHARED = -shared +endif + ifeq ($(LUA),embedded) CFLAGS += -Ilua -DLUA_USE_LINUX -DLUA_ROOT='"$(PREFIX)/"' LIBRARIES = -lm @@ -97,7 +103,7 @@ lem: $(objects) utils.so: utils.pic.o $Mecho ' LD $@' - $O$(CC) -shared $(LDFLAGS) $^ -o $@ + $O$(CC) $(SHARED) $(LDFLAGS) $^ -o $@ %-strip: % $Mecho ' STRIP $<' diff --git a/config.Darwin b/config.Darwin new file mode 100644 index 0000000..d1203ad --- /dev/null +++ b/config.Darwin @@ -0,0 +1,41 @@ +/* + * This file is part of LEM, a Lua Event Machine. + * Copyright 2011 Emil Renner Berthing + * + * LEM is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * LEM is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with LEM. If not, see . + */ + +#define EV_STANDALONE 1 +#define EV_USE_MONOTONIC 1 +#define EV_USE_CLOCK_SYSCALL 0 +#define EV_USE_NANOSLEEP 1 +#define EV_USE_EVENTFD 0 + +#define EV_USE_SELECT 0 +#define EV_USE_POLL 0 +#define EV_USE_EPOLL 0 +#define EV_USE_KQUEUE 1 +#define EV_USE_PORT 0 + +#define EV_MULTIPLICITY 0 + +#define EV_PERIODIC_ENABLE 0 +#define EV_IDLE_ENABLE 1 +#define EV_EMBED_ENABLE 0 +#define EV_STAT_ENABLE 0 +#define EV_FORK_ENABLE 0 +#define EV_ASYNC_ENABLE 0 + +#define EV_MINPRI 0 +#define EV_MAXPRI 0 -- cgit v1.2.1