diff --git a/src/Jamrules b/src/Jamrules index 038f7cb98..fe38b906c 100644 --- a/src/Jamrules +++ b/src/Jamrules @@ -1,18 +1,16 @@ -#C++ = g++-3.3 ; -#CC = gcc-3.3 ; -#LINK = gcc-3.3 ; -C++ = g++-4.0 ; -CC = gcc-4.0 ; -LINK = gcc-4.0 ; -# ECHO $(JAMUNAME) ; - -# LINKFLAGS += -rdynamic ; +C++ = g++ ; +CC = gcc ; +LINK = gcc ; if $(MSPACES) { CCFLAGS += -DMSPACES ; C++FLAGS += -DMSPACES ; } +if ! $(LUA_VERSION) { + LUA_VERSION = 5.0 ; +} + if ! $(HAVE_LUA) { HAVE_LUA = 1 ; } @@ -99,7 +97,11 @@ rule iconv rule luabind { LINKLIBS on $(<) += -L$(LUABIND_ROOT)/lib ; - LINKLIBS on $(<) += -llua50 -llualib50 ; + if $(LUA_VERSION) = 5.1 { + LINKLIBS on $(<) += -llua5.1 ; + } else { + LINKLIBS on $(<) += -llua50 -llualib50 ; + } LINKLIBS on $(<) += -lm -lluabind ; } @@ -115,7 +117,11 @@ rule UsingLuabind rule UsingLua { - SubDirHdrs /usr/include/lua50 ; + if $(LUA_VERSION) = 5.1 { + SubDirHdrs /usr/include/lua5.1 ; + } else { + SubDirHdrs /usr/include/lua50 ; + } } rule TargetDirectory diff --git a/src/eressea/console.c b/src/eressea/console.c index 84fe5322a..23d93cc6a 100644 --- a/src/eressea/console.c +++ b/src/eressea/console.c @@ -1,8 +1,7 @@ #include "console.h" /* lua includes */ -#include -#include +#include /* libc includes */ #include diff --git a/src/eressea/console.h b/src/eressea/console.h index fcc53b0de..09faf042a 100644 --- a/src/eressea/console.h +++ b/src/eressea/console.h @@ -10,7 +10,7 @@ #ifdef __cplusplus extern "C" { #endif -#include +#include extern int lua_console(lua_State * L); extern int lua_do(lua_State * L); diff --git a/src/eressea/gmmain.cpp b/src/eressea/gmmain.cpp index 1e25b7804..809e0f846 100644 --- a/src/eressea/gmmain.cpp +++ b/src/eressea/gmmain.cpp @@ -25,11 +25,14 @@ static lua_State * lua_init(void) { lua_State * L = lua_open(); +/* luaopen_base(L); luaopen_math(L); luaopen_string(L); luaopen_io(L); luaopen_table(L); +*/ + luaL_openlibs(L); luabind::open(L); bind_objects(L); diff --git a/src/eressea/server.cpp b/src/eressea/server.cpp index 8555fd1cd..14bac20e5 100644 --- a/src/eressea/server.cpp +++ b/src/eressea/server.cpp @@ -262,11 +262,14 @@ static lua_State * lua_init(void) { lua_State * luaState = lua_open(); +/* luaopen_base(luaState); luaopen_math(luaState); luaopen_string(luaState); luaopen_io(luaState); luaopen_table(luaState); + */ + luaL_openlibs(luaState); luabind::open(luaState); bind_objects(luaState); bind_eressea(luaState); diff --git a/src/lua.hpp b/src/lua.hpp index 14d8eeeed..5ff75c612 100644 --- a/src/lua.hpp +++ b/src/lua.hpp @@ -2,10 +2,9 @@ extern "C" { #endif -#include -#include -#include - +#include +#include +#include #ifdef __cplusplus }