summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lua-interface.cpp30
1 files changed, 27 insertions, 3 deletions
diff --git a/src/lua-interface.cpp b/src/lua-interface.cpp
index 267a615..f560bd3 100644
--- a/src/lua-interface.cpp
+++ b/src/lua-interface.cpp
@@ -51,11 +51,16 @@
#ifndef _MSVC
// this seems ignored under apple's gcc... dammit.
+// Gah. msys doesn't support that properly either.
#define WEAK __attribute__ ((weak))
#else
#define WEAK
#endif
+#if defined(__APPLE__) || defined(__MINGW32__)
+#define NO_SMART_MODULES
+#endif
+
extern "C" {
extern void luaconfigfiles_init(Lua * L) WEAK;
@@ -79,6 +84,13 @@ extern void luacd_init(Lua * L) WEAK;
#define main dll_main
#endif
+#ifdef LUA_INTERFACE_LIGHT
+#define MODULES_BUILT_IN
+#define LIGHT "-light"
+#else
+#define LIGHT
+#endif
+
#ifdef _WIN32
#include <windows.h>
@@ -312,15 +324,17 @@ int sLua_baselua_interface::baselua_interface_proceed_statics(Lua * L, int n, in
case BASELUA_INTERFACE_LOADMODULE:
filename = L->tostring();
if (0) {
-#if !(defined(__APPLE__) || defined(MODULES_BUILT_IN))
+#if !defined(NO_SMART_MODULES) || defined(MODULES_BUILT_IN)
} else if ((filename == "luaconfigfiles") && (luaconfigfiles_init != NULL)) {
luaconfigfiles_init(L);
+#ifndef LUA_INTERFACE_LIGHT
#ifndef _MSVC
} else if ((filename == "luaftgl") && (luaftgl_init != NULL)) {
luaftgl_init(L);
} else if ((filename == "luagl") && (luagl_init != NULL)) {
luagl_init(L);
#endif
+#endif
} else if ((filename == "luahandle") && (luahandle_init != NULL)) {
luahandle_init(L);
} else if ((filename == "luahttp") && (luahttp_init != NULL)) {
@@ -329,18 +343,23 @@ int sLua_baselua_interface::baselua_interface_proceed_statics(Lua * L, int n, in
luasmtp_init(L);
} else if ((filename == "lualibs") && (lualibs_init != NULL)) {
lualibs_init(L);
+#ifndef LUA_INTERFACE_LIGHT
#ifndef _MSVC
} else if ((filename == "luaocci") && (luaocci_init != NULL)) {
luaocci_init(L);
#endif
+#endif
} else if ((filename == "luaregex") && (luaregex_init != NULL)) {
luaregex_init(L);
+#ifndef LUA_INTERFACE_LIGHT
} else if ((filename == "luasql") && (luasql_init != NULL)) {
luasql_init(L);
+#endif
} else if ((filename == "luatask") && (luatask_init != NULL)) {
luatask_init(L);
} else if ((filename == "luaxml") && (luaxml_init != NULL)) {
luaxml_init(L);
+#ifndef LUA_INTERFACE_LIGHT
#ifndef _MSVC
} else if ((filename == "luaosmesa") && (luaosmesa_init != NULL)) {
luaosmesa_init(L);
@@ -348,6 +367,7 @@ int sLua_baselua_interface::baselua_interface_proceed_statics(Lua * L, int n, in
} else if ((filename == "luacd") && (luacd_init != NULL)) {
luacd_init(L);
#endif
+#endif
} else {
LuaLoadPlugin(filename, L);
}
@@ -537,7 +557,7 @@ Lua * start_full_lua(void) {
void showbanner() {
printm(M_BARE,
-"Lua-Interface version " VERSION " (c) 2003-2008 Nicolas \"Pixel\" Noble\n"
+"Lua-Interface" LIGHT " version " VERSION " (c) 2003-2009 Nicolas \"Pixel\" Noble\n"
LUA_RELEASE " " LUA_COPYRIGHT "\n"
#ifdef WIP
"Special version Work In Progress, compiled the " __DATE__ " at " __TIME__ "\n"
@@ -689,7 +709,7 @@ static void * interactive_prompt(void * __L) {
}
void autoload_exports(Lua * L) {
-#if not defined(__APPLE__) or defined(MODULES_BUILT_IN)
+#if !defined(NO_SMART_MODULES) || defined(MODULES_BUILT_IN)
if (lualibs_init)
lualibs_init(L);
if (luahandle_init)
@@ -702,12 +722,15 @@ void autoload_exports(Lua * L) {
luasmtp_init(L);
if (luaregex_init)
luaregex_init(L);
+#ifndef LUA_INTERFACE_LIGHT
if (luasql_init)
luasql_init(L);
+#endif
if (luatask_init)
luatask_init(L);
if (luaxml_init)
luaxml_init(L);
+#ifndef LUA_INTERFACE_LIGHT
#ifndef _MSVC
if (luaftgl_init)
luaftgl_init(L);
@@ -721,6 +744,7 @@ void autoload_exports(Lua * L) {
if (luacd_init)
luacd_init(L);
#endif
+#endif
}
virtual int startup() throw (GeneralException) {