diff options
author | Nicolas Noble <pixel@Aoshi.local> | 2008-11-28 17:26:01 -0800 |
---|---|---|
committer | Nicolas Noble <pixel@Aoshi.local> | 2008-11-28 17:26:01 -0800 |
commit | c9d980fd1e4cec1973ea3e7d54ae7057e9c29e08 (patch) | |
tree | 5dab5b0781bc53e04f546e700cc822b1956e5d88 | |
parent | f922b423225678f3f6431cc96b672e24e5cb9931 (diff) |
Early port under Darwin x86-64
-rw-r--r-- | Makefile | 22 | ||||
-rw-r--r-- | src/lua-interface.cpp | 8 |
2 files changed, 25 insertions, 5 deletions
@@ -1,3 +1,15 @@ +SYSTEM=$(shell uname) +ifeq ($(SYSTEM),Darwin) +ARCH_FLAGS=-m64 +LDFLAGS_MESA=-all-load ../Mesa-7.2/lib/libGLU.a ../Mesa-7.2/lib/libOSMesa.a +CPPFLAGS_READLINE= +LDFLAGS_READLINE=-lreadline -lncurses +else +ARCH_FLAGS=-march=i686 +LDFLAGS_MESA=-u gluNewTess -Wl,--whole-archive ../Mesa-7.2/lib/libGLU.a ../Mesa-7.2/lib/libOSMesa.a -Wl,--no-whole-archive +CPPFLAGS_READLINE=-DREADLINE_STATIC +LDFLAGS_READLINE=/usr/lib/libreadline.a /usr/lib/libncurses.a +endif CC = gcc CXX = g++ LD = g++ @@ -10,7 +22,7 @@ INCLUDES = \ -I../Baltisot/lib/lua/include -I../Baltisot/lib/lua/includes \ -I../lua-modules/src \ \ --I ../Mesa-7.0.3/include \ +-I ../Mesa-7.2/include \ -I ../tinyxml \ -I /usr/include/mysql \ -I /usr/include/FTGL -I /usr/include/freetype2 \ @@ -18,9 +30,11 @@ INCLUDES = \ HAVES = -DHAVE_VSSCANF -DHAVE_LIBJPEG -DHAVE_FCNTL -DHAVE_MYSQL -DHAVE_UNISTD_H -DHAVE_FORK -DHAVE_PIPE -DHAVE_FSYNC -DHAVE_MALLOC_H -DHAVE_ASPRINTF -DHAVE_BYTESWAP_H -CPPFLAGS += $(INCLUDES) -g -DSTDC_HEADERS -DREADLINE_STATIC -DHOOK_STDS -fexceptions -DWORDS_LITTLEENDIAN -fexceptions -march=i686 $(HAVES) -DUSE_MPQLIB +CPPFLAGS += $(INCLUDES) -g -DSTDC_HEADERS $(CPPFLAGS_READLINE) -DHOOK_STDS -fexceptions -DWORDS_LITTLEENDIAN -fexceptions $(ARCH_FLAGS) $(HAVES) -DUSE_MPQLIB -LDFLAGS += -u gluNewTess -rdynamic -g -fexception -lpthread -lSegFault /usr/lib/libreadline.a /usr/lib/libncurses.a -lz -ldl -L/usr/lib/oracle/11.1.0.1/client/lib -Wl,--whole-archive ../Mesa-7.0.3/lib/libGLU.a ../Mesa-7.0.3/lib/libOSMesa.a -Wl,--no-whole-archive +BASIC_LDFLAGS = $(ARCH_FLAGS) -rdynamic -g -fexception -lz -ldl -lpthread -liconv + +LDFLAGS += $(BASIC_LDFLAGS) $(LDFLAGS_READLINE) -L/usr/lib/oracle/11.1.0.1/client/lib $(LDFLAGS_MESA) vpath %.c ../Baltisot/lib:../Baltisot/src:../Baltisot/lib/zlib/src:../Baltisot/lib/lua/src:../Baltisot/lib/lua/src/LuaLib:src:../paperIdol/src:../mogltk/lib:../tinyxml:../lua-modules/src vpath %.cc ../Baltisot/lib:../Baltisot/src:../Baltisot/lib/zlib/src:../Baltisot/lib/lua/src:../Baltisot/lib/lua/src/LuaLib:src:../paperIdol/src:../mogltk/lib:../tinyxml:../lua-modules/src @@ -192,7 +206,7 @@ all: dep luac lua-interface dep: $(ALL_DEPS) luac: $(LUAC_OBJECTS) - $(LD) -o luac $(LUAC_OBJECTS) $(LDFLAGS) + $(LD) -o luac $(LUAC_OBJECTS) $(BASIC_LDFLAGS) lua-interface: $(ALL_OBJECTS) $(LD) -o lua-interface $(ALL_OBJECTS) $(LDFLAGS) diff --git a/src/lua-interface.cpp b/src/lua-interface.cpp index 172a365..79307a6 100644 --- a/src/lua-interface.cpp +++ b/src/lua-interface.cpp @@ -50,6 +50,7 @@ #include "lua-interface-hc.h" #ifndef _MSVC +// this seems ignored under apple's gcc... dammit. #define WEAK __attribute__ ((weak)) #else #define WEAK @@ -308,7 +309,9 @@ int sLua_baselua_interface::baselua_interface_proceed_statics(Lua * L, int n, in break; case BASELUA_INTERFACE_LOADMODULE: filename = L->tostring(); - if ((filename == "luaconfigfiles") && (luaconfigfiles_init != NULL)) { + if (0) { +#if not defined(__APPLE__) or defined(MODULES_BUILT_IN) + } else if ((filename == "luaconfigfiles") && (luaconfigfiles_init != NULL)) { luaconfigfiles_init(L); #ifndef _MSVC } else if ((filename == "luaftgl") && (luaftgl_init != NULL)) { @@ -340,6 +343,7 @@ int sLua_baselua_interface::baselua_interface_proceed_statics(Lua * L, int n, in } else if ((filename == "luaosmesa") && (luaosmesa_init != NULL)) { luaosmesa_init(L); #endif +#endif } else { LuaLoadPlugin(filename, L); } @@ -681,6 +685,7 @@ static void * interactive_prompt(void * __L) { } void autoload_exports(Lua * L) { +#if not defined(__APPLE__) or defined(MODULES_BUILT_IN) if (lualibs_init) lualibs_init(L); if (luahandle_init) @@ -709,6 +714,7 @@ void autoload_exports(Lua * L) { if (luaocci_init) luaocci_init(L); #endif +#endif } virtual int startup() throw (GeneralException) { |