From 805d302b116d4698ac7602a8c65c02cf9cc772ae Mon Sep 17 00:00:00 2001 From: pixel Date: Tue, 5 Aug 2008 15:03:54 +0000 Subject: Cleaning up a bit the -dbg version, and adding the luaosmesa module to it. --- Makefile | 7 ++--- src/lua-interface.cpp | 73 +++++++++++++++++++++++++++++++-------------------- src/luaidbg.c | 1 - 3 files changed, 49 insertions(+), 32 deletions(-) delete mode 100644 src/luaidbg.c diff --git a/Makefile b/Makefile index ee733b6..2889511 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ HAVES = -DHAVE_VSSCANF -DHAVE_LIBJPEG -DHAVE_FCNTL -DHAVE_MYSQL -DHAVE_UNISTD_H CPPFLAGS += $(INCLUDES) -g -DSTDC_HEADERS -DREADLINE_STATIC -DHOOK_STDS -fexceptions -DWORDS_LITTLEENDIAN -fexceptions -march=i686 $(HAVES) -DUSE_MPQLIB -LDFLAGS += -u gluNewTess -rdynamic -g -fexception -lpthread -ljpeg -lSegFault ../Mesa-7.0.2/lib/libGLU.a ../Mesa-7.0.2/lib/libOSMesa.a /usr/lib/libreadline.a /usr/lib/libncurses.a -lz -ldl -L/usr/lib/oracle/11.1.0.1/client/lib +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.2/lib/libGLU.a ../Mesa-7.0.2/lib/libOSMesa.a -Wl,--no-whole-archive 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 @@ -142,7 +142,6 @@ checkargs.c \ datecalc.c \ DEBUG_MODULES = \ -luaidbg.c \ tinystr.cpp \ tinyxml.cpp \ tinyxmlerror.cpp \ @@ -174,6 +173,8 @@ ajaxlib.lua \ htmllib.lua \ xmllib.lua \ httplib.lua \ +plugin-luaosmesa.cc \ +dds.c WHOLE_SOURCES = $(BALTISOT_SOURCES) $(LUA_SOURCES) $(LUAINTERFACE_SOURCES) DEBUG_SOURCES = $(DEBUG_MODULES) @@ -196,7 +197,7 @@ lua-interface: $(ALL_OBJECTS) $(LD) -o lua-interface $(ALL_OBJECTS) $(LDFLAGS) lua-interface-dbg: $(ALL_OBJECTS) $(DEBUG_OBJECTS) - $(LD) -o lua-interface-dbg $(ALL_OBJECTS) $(DEBUG_OBJECTS) $(LDFLAGS) -lfreetype -lftgl ../Mesa-7.0.2/lib/libGLU.a ../Mesa-7.0.2/lib/libOSMesa.a /usr/lib/libmysqlclient.a -locci -lclntsh + $(LD) -o lua-interface-dbg $(ALL_OBJECTS) $(DEBUG_OBJECTS) $(LDFLAGS) -lfreetype -lftgl ../Mesa-7.0.2/lib/libGLU.a ../Mesa-7.0.2/lib/libOSMesa.a /usr/lib/libmysqlclient.a -locci -lclntsh `Magick++-config --libs` clean: rm -f lua-interface luac *.o *.dep diff --git a/src/lua-interface.cpp b/src/lua-interface.cpp index f296351..3958ddb 100644 --- a/src/lua-interface.cpp +++ b/src/lua-interface.cpp @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: lua-interface.cpp,v 1.8 2008-08-05 11:33:13 pixel Exp $ */ +/* $Id: lua-interface.cpp,v 1.9 2008-08-05 15:03:54 pixel Exp $ */ #define WIP @@ -48,7 +48,8 @@ #include "lua-interface-hc.h" -extern void static_mode (void) __attribute__ ((weak)); +extern "C" { + extern void luaconfigfiles_init(Lua * L) __attribute__ ((weak)); extern void luaftgl_init(Lua * L) __attribute__ ((weak)); extern void luagl_init(Lua * L) __attribute__ ((weak)); @@ -60,6 +61,9 @@ extern void luaregex_init(Lua * L) __attribute__ ((weak)); extern void luasql_init(Lua * L) __attribute__ ((weak)); extern void luatask_init(Lua * L) __attribute__ ((weak)); extern void luaxml_init(Lua * L) __attribute__ ((weak)); +extern void luaosmesa_init(Lua * L) __attribute__ ((weak)); + +} #ifdef _WIN32 @@ -293,32 +297,30 @@ int sLua_baselua_interface::baselua_interface_proceed_statics(Lua * L, int n, in break; case BASELUA_INTERFACE_LOADMODULE: filename = L->tostring(); - if (static_mode) { - if (filename == "luaconfigfiles") { - luaconfigfiles_init(L); - } else if (filename == "luaftgl") { - luaftgl_init(L); - } else if (filename == "luagl") { - luagl_init(L); - } else if (filename == "luahandle") { - luahandle_init(L); - } else if (filename == "luahttp") { - luahttp_init(L); - } else if (filename == "lualibs") { - lualibs_init(L); - } else if (filename == "luaocci") { - luaocci_init(L); - } else if (filename == "luaregex") { - luaregex_init(L); - } else if (filename == "luasql") { - luasql_init(L); - } else if (filename == "luatask") { - luatask_init(L); - } else if (filename == "luaxml") { - luaxml_init(L); - } else { - L->error("lua-interface in static mode, and module unknown."); - } + if ((filename == "luaconfigfiles") && (luaconfigfiles_init != NULL)) { + luaconfigfiles_init(L); + } else if ((filename == "luaftgl") && (luaftgl_init != NULL)) { + luaftgl_init(L); + } else if ((filename == "luagl") && (luagl_init != NULL)) { + luagl_init(L); + } else if ((filename == "luahandle") && (luahandle_init != NULL)) { + luahandle_init(L); + } else if ((filename == "luahttp") && (luahttp_init != NULL)) { + luahttp_init(L); + } else if ((filename == "lualibs") && (lualibs_init != NULL)) { + lualibs_init(L); + } else if ((filename == "luaocci") && (luaocci_init != NULL)) { + luaocci_init(L); + } else if ((filename == "luaregex") && (luaregex_init != NULL)) { + luaregex_init(L); + } else if ((filename == "luasql") && (luasql_init != NULL)) { + luasql_init(L); + } else if ((filename == "luatask") && (luatask_init != NULL)) { + luatask_init(L); + } else if ((filename == "luaxml") && (luaxml_init != NULL)) { + luaxml_init(L); + } else if ((filename == "luaosmesa") && (luaosmesa_init != NULL)) { + luaosmesa_init(L); } else { LuaLoadPlugin(L->tostring(1), L); } @@ -657,6 +659,21 @@ static void * interactive_prompt(void * __L) { return NULL; } +void check_exports(void) { + printm(M_INFO, "luaconfigfiles = %p\n", luaconfigfiles_init); + printm(M_INFO, "luaftgl = %p\n", luaftgl_init); + printm(M_INFO, "luagl = %p\n", luagl_init); + printm(M_INFO, "luahandle = %p\n", luahandle_init); + printm(M_INFO, "luahttp = %p\n", luahttp_init); + printm(M_INFO, "lualibs = %p\n", lualibs_init); + printm(M_INFO, "luaocci = %p\n", luaocci_init); + printm(M_INFO, "luaregex = %p\n", luaregex_init); + printm(M_INFO, "luasql = %p\n", luasql_init); + printm(M_INFO, "luatask = %p\n", luatask_init); + printm(M_INFO, "luaxml = %p\n", luaxml_init); + printm(M_INFO, "luaosmesa = %p\n", luaosmesa_init); +} + virtual int startup() throw (GeneralException) { char c; diff --git a/src/luaidbg.c b/src/luaidbg.c deleted file mode 100644 index f0ebee4..0000000 --- a/src/luaidbg.c +++ /dev/null @@ -1 +0,0 @@ -int static_mode = 1; -- cgit v1.2.3