Made Eressea compile and run with lua 5.1

This commit is contained in:
Enno Rehling 2007-06-11 23:00:15 +00:00
parent 4a75e13cb0
commit 8c57e05798
6 changed files with 28 additions and 18 deletions

View File

@ -1,18 +1,16 @@
#C++ = g++-3.3 ; C++ = g++ ;
#CC = gcc-3.3 ; CC = gcc ;
#LINK = gcc-3.3 ; LINK = gcc ;
C++ = g++-4.0 ;
CC = gcc-4.0 ;
LINK = gcc-4.0 ;
# ECHO $(JAMUNAME) ;
# LINKFLAGS += -rdynamic ;
if $(MSPACES) { if $(MSPACES) {
CCFLAGS += -DMSPACES ; CCFLAGS += -DMSPACES ;
C++FLAGS += -DMSPACES ; C++FLAGS += -DMSPACES ;
} }
if ! $(LUA_VERSION) {
LUA_VERSION = 5.0 ;
}
if ! $(HAVE_LUA) { if ! $(HAVE_LUA) {
HAVE_LUA = 1 ; HAVE_LUA = 1 ;
} }
@ -99,7 +97,11 @@ rule iconv
rule luabind rule luabind
{ {
LINKLIBS on $(<) += -L$(LUABIND_ROOT)/lib ; 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 ; LINKLIBS on $(<) += -lm -lluabind ;
} }
@ -115,7 +117,11 @@ rule UsingLuabind
rule UsingLua rule UsingLua
{ {
SubDirHdrs /usr/include/lua50 ; if $(LUA_VERSION) = 5.1 {
SubDirHdrs /usr/include/lua5.1 ;
} else {
SubDirHdrs /usr/include/lua50 ;
}
} }
rule TargetDirectory rule TargetDirectory

View File

@ -1,8 +1,7 @@
#include "console.h" #include "console.h"
/* lua includes */ /* lua includes */
#include <lua50/lauxlib.h> #include <lua.hpp>
#include <lua50/lualib.h>
/* libc includes */ /* libc includes */
#include <assert.h> #include <assert.h>

View File

@ -10,7 +10,7 @@
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include <lua50/lua.h> #include <lua.hpp>
extern int lua_console(lua_State * L); extern int lua_console(lua_State * L);
extern int lua_do(lua_State * L); extern int lua_do(lua_State * L);

View File

@ -25,11 +25,14 @@ static lua_State *
lua_init(void) lua_init(void)
{ {
lua_State * L = lua_open(); lua_State * L = lua_open();
/*
luaopen_base(L); luaopen_base(L);
luaopen_math(L); luaopen_math(L);
luaopen_string(L); luaopen_string(L);
luaopen_io(L); luaopen_io(L);
luaopen_table(L); luaopen_table(L);
*/
luaL_openlibs(L);
luabind::open(L); luabind::open(L);
bind_objects(L); bind_objects(L);

View File

@ -262,11 +262,14 @@ static lua_State *
lua_init(void) lua_init(void)
{ {
lua_State * luaState = lua_open(); lua_State * luaState = lua_open();
/*
luaopen_base(luaState); luaopen_base(luaState);
luaopen_math(luaState); luaopen_math(luaState);
luaopen_string(luaState); luaopen_string(luaState);
luaopen_io(luaState); luaopen_io(luaState);
luaopen_table(luaState); luaopen_table(luaState);
*/
luaL_openlibs(luaState);
luabind::open(luaState); luabind::open(luaState);
bind_objects(luaState); bind_objects(luaState);
bind_eressea(luaState); bind_eressea(luaState);

View File

@ -2,10 +2,9 @@
extern "C" { extern "C" {
#endif #endif
#include <lua50/lua.h> #include <lua.h>
#include <lua50/lauxlib.h> #include <lauxlib.h>
#include <lua50/lualib.h> #include <lualib.h>
#ifdef __cplusplus #ifdef __cplusplus
} }