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 ;
#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

View File

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

View File

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

View File

@ -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);

View File

@ -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);

View File

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