summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpixel <pixel>2008-08-04 09:36:35 +0000
committerpixel <pixel>2008-08-04 09:36:35 +0000
commit88aa1ca175c3f9c73ab2d0fd7f1636f87c1f8167 (patch)
tree45f999eca7e277693c9ca91e5f8d8797abc00848
parent0ca7e7e67883af752430f5095d262424f71619d5 (diff)
Adding built-in debugging system.
-rw-r--r--Makefile51
-rw-r--r--Makefile.mingw321
-rw-r--r--allmodules.lua2
-rw-r--r--src/lua-interface.cpp46
-rw-r--r--src/luaidbg.c1
5 files changed, 94 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index e6c1aaf..ee733b6 100644
--- a/Makefile
+++ b/Makefile
@@ -9,12 +9,18 @@ INCLUDES = \
-I../Baltisot/lib/zlib/include \
-I../Baltisot/lib/lua/include -I../Baltisot/lib/lua/includes \
-I../lua-modules/src \
+\
+-I ../Mesa-7.0.2/include \
+-I ../tinyxml \
+-I /usr/include/mysql \
+-I /usr/include/FTGL -I /usr/include/freetype2 \
+-I /usr/include/oracle/11.1.0.1/client/
-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
+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
-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
+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
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
@@ -28,6 +34,7 @@ lua-plugin.cc \
BALTISOT_SOURCES = \
Main.cc \
\
+RandISAAC.cc \
Exceptions.cc \
String.cc \
Regex.cc \
@@ -134,14 +141,49 @@ generic.cc \
checkargs.c \
datecalc.c \
+DEBUG_MODULES = \
+luaidbg.c \
+tinystr.cpp \
+tinyxml.cpp \
+tinyxmlerror.cpp \
+tinyxmlparser.cpp \
+plugin-luaconfigfiles.cc \
+LuaConfigFile.cc \
+plugin-luaxml.cc \
+LuaXML.cc \
+plugin-luaocci.cc \
+LuaOCCI.cc \
+plugin-luahandle.cc \
+plugin-luahttp.cc \
+LuaHttp.cc \
+plugin-luaregex.cc \
+LuaRegex.cc \
+plugin-luatask.cc \
+plugin-luasql.cc \
+SQL.cc \
+LuaSQL.cc \
+plugin-lualibs.cc \
+loadlualibs.cc \
+plugin-luagl.cc \
+LuaGL.cc \
+plugin-luaftgl.cc \
+LuaFTGL.cc \
+supportlib.lua \
+tasklib.lua \
+ajaxlib.lua \
+htmllib.lua \
+xmllib.lua \
+httplib.lua \
WHOLE_SOURCES = $(BALTISOT_SOURCES) $(LUA_SOURCES) $(LUAINTERFACE_SOURCES)
+DEBUG_SOURCES = $(DEBUG_MODULES)
LUAINTERFACE_OBJECTS = $(addsuffix .o, $(notdir $(basename $(LUAINTERFACE_SOURCES))))
LUAC_OBJECTS = $(addsuffix .o, $(notdir $(basename $(LUAC_SOURCES) $(LUA_SOURCES))))
+DEBUG_OBJECTS = $(addsuffix .o, $(notdir $(basename $(DEBUG_SOURCES))))
ALL_OBJECTS = $(addsuffix .o, $(notdir $(basename $(WHOLE_SOURCES))))
-ALL_DEPS = $(addsuffix .dep, $(notdir $(basename $(WHOLE_SOURCES))))
+ALL_DEPS = $(addsuffix .dep, $(notdir $(basename $(WHOLE_SOURCES) $(DEBUG_SOURCES))))
all: dep luac lua-interface
@@ -153,6 +195,9 @@ luac: $(LUAC_OBJECTS)
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
+
clean:
rm -f lua-interface luac *.o *.dep
diff --git a/Makefile.mingw32 b/Makefile.mingw32
index c8d136b..12b9892 100644
--- a/Makefile.mingw32
+++ b/Makefile.mingw32
@@ -30,6 +30,7 @@ lua-plugin.cc \
BALTISOT_SOURCES = \
Main.cc \
\
+RandISAAC.cc \
Exceptions.cc \
String.cc \
Regex.cc \
diff --git a/allmodules.lua b/allmodules.lua
index 6b1be8d..86e27dd 100644
--- a/allmodules.lua
+++ b/allmodules.lua
@@ -3,11 +3,9 @@ loadmodule "luaconfigfiles"
loadmodule "luagl"
loadmodule "luaftgl"
loadmodule "luahandle"
-loadmodule "luampqhandle"
loadmodule "luatask"
loadmodule "luahttp"
loadmodule "luaocci"
-loadmodule "luapaperidol"
loadmodule "luaregex"
loadmodule "luasql"
loadmodule "luaxml"
diff --git a/src/lua-interface.cpp b/src/lua-interface.cpp
index 9da24d9..6a773f1 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.5 2008-07-16 09:38:03 pixel Exp $ */
+/* $Id: lua-interface.cpp,v 1.6 2008-08-04 09:36:35 pixel Exp $ */
#define WIP
@@ -48,6 +48,19 @@
#include "lua-interface-hc.h"
+extern void static_mode (void) __attribute__ ((weak));
+extern void luaconfigfiles_init(Lua * L) __attribute__ ((weak));
+extern void luaftgl_init(Lua * L) __attribute__ ((weak));
+extern void luagl_init(Lua * L) __attribute__ ((weak));
+extern void luahandle_init(Lua * L) __attribute__ ((weak));
+extern void luahttp_init(Lua * L) __attribute__ ((weak));
+extern void lualibs_init(Lua * L) __attribute__ ((weak));
+extern void luaocci_init(Lua * L) __attribute__ ((weak));
+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));
+
#ifdef _WIN32
#include <windows.h>
@@ -279,7 +292,36 @@ int sLua_baselua_interface::baselua_interface_proceed_statics(Lua * L, int n, in
}
break;
case BASELUA_INTERFACE_LOADMODULE:
- LuaLoadPlugin(L->tostring(1), L);
+ 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.");
+ }
+ } else {
+ LuaLoadPlugin(L->tostring(1), L);
+ }
break;
case BASELUA_INTERFACE_UNLINK:
filename = L->tostring(1);
diff --git a/src/luaidbg.c b/src/luaidbg.c
new file mode 100644
index 0000000..f0ebee4
--- /dev/null
+++ b/src/luaidbg.c
@@ -0,0 +1 @@
+int static_mode = 1;