Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 177670
Collapse All | Expand All

(-)CEGUI-0.5.0/aclocal.m4 (+11 lines)
Lines 551-556 Link Here
551
551
552
AC_DEFUN([CEGUI_CHECK_LUA],[
552
AC_DEFUN([CEGUI_CHECK_LUA],[
553
    PKG_CHECK_MODULES(Lua, lua >= 5.0 lua < 5.1, [cegui_found_lua=yes], [cegui_found_lua=no])
553
    PKG_CHECK_MODULES(Lua, lua >= 5.0 lua < 5.1, [cegui_found_lua=yes], [cegui_found_lua=no])
554
    
555
    LUA_VERSION_FLAGS="";
556
    if test x$cegui_found_lua = xno; then
557
       PKG_CHECK_MODULES(Lua, lua >= 5.1, [cegui_found_lua=yes], [cegui_found_lua=no])
558
       
559
       if test x$cegui_found_lua = xyes; then
560
	  LUA_VERSION_FLAGS="$LUA_VERSION_FLAGS -DLUA51"
561
  	  AC_MSG_NOTICE([Lua version >=5.1])
562
       fi
563
    fi
564
    AC_SUBST(LUA_VERSION_FLAGS)
554
565
555
    AC_ARG_ENABLE([lua-module], AC_HELP_STRING([--disable-lua-module], [Disables building of the Lua scripting module.]),
566
    AC_ARG_ENABLE([lua-module], AC_HELP_STRING([--disable-lua-module], [Disables building of the Lua scripting module.]),
556
                [cegui_with_lua=$enableval], [cegui_with_lua=yes])
567
                [cegui_with_lua=$enableval], [cegui_with_lua=yes])
(-)CEGUI-0.5.0/ScriptingModules/CEGUILua/LuaScriptModule/src/CEGUILua.cpp (-4 / +27 lines)
Lines 35-46 Link Here
35
35
36
// include Lua libs and tolua++
36
// include Lua libs and tolua++
37
extern "C" {
37
extern "C" {
38
#include "lua.h"
38
#include "tolua++.h"
39
#include "lualib.h"
39
#include "lualib.h"
40
#include "lauxlib.h"
41
}
40
}
42
41
43
#include "tolua++.h"
44
42
45
// prototype for bindings initialisation function
43
// prototype for bindings initialisation function
46
int tolua_CEGUI_open(lua_State* tolua_S);
44
int tolua_CEGUI_open(lua_State* tolua_S);
Lines 55-65 Link Here
55
*************************************************************************/
53
*************************************************************************/
56
LuaScriptModule::LuaScriptModule()
54
LuaScriptModule::LuaScriptModule()
57
{
55
{
56
#ifdef LUA51
57
       static const luaL_Reg lualibs[] = { 
58
          {"", luaopen_base}, 
59
          {LUA_LOADLIBNAME, luaopen_package}, 
60
          {LUA_TABLIBNAME, luaopen_table}, 
61
          {LUA_IOLIBNAME, luaopen_io}, 
62
          {LUA_OSLIBNAME, luaopen_os}, 
63
          {LUA_STRLIBNAME, luaopen_string}, 
64
          {LUA_MATHLIBNAME, luaopen_math}, 
65
#if defined(DEBUG) || defined (_DEBUG) 
66
          {LUA_DBLIBNAME, luaopen_debug}, 
67
#endif 
68
          {NULL, NULL} 
69
        };
70
#endif /* LUA51 */
71
58
	// create a lua state
72
	// create a lua state
59
	d_ownsState = true;
73
	d_ownsState = true;
60
	d_state = lua_open();
74
	d_state = lua_open();
61
75
62
	// init all standard libraries
76
	// init all standard libraries
77
#ifdef LUA51
78
        const luaL_Reg *lib = lualibs; 
79
        for (; lib->func; lib++) 
80
        { 
81
           lua_pushcfunction(d_state, lib->func); 
82
           lua_pushstring(d_state, lib->name); 
83
           lua_call(d_state, 1, 0); 
84
        }	
85
#else /* LUA51 */
63
	luaopen_base(d_state);
86
	luaopen_base(d_state);
64
	luaopen_io(d_state);
87
	luaopen_io(d_state);
65
	luaopen_string(d_state);
88
	luaopen_string(d_state);
Lines 68-74 Link Here
68
#if defined(DEBUG) || defined (_DEBUG)
91
#if defined(DEBUG) || defined (_DEBUG)
69
	luaopen_debug(d_state);
92
	luaopen_debug(d_state);
70
#endif
93
#endif
71
94
#endif /* LUA51 */
72
	setModuleIdentifierString();
95
	setModuleIdentifierString();
73
}
96
}
74
97
(-)CEGUI-0.5.0/ScriptingModules/CEGUILua/LuaScriptModule/src/Makefile.am (-1 / +2 lines)
Lines 1-6 Link Here
1
INCLUDES = -I$(top_srcdir)/include \
1
INCLUDES = -I$(top_srcdir)/include \
2
           -I$(top_srcdir)/ScriptingModules/CEGUILua/tolua++ \
2
           -I$(top_srcdir)/ScriptingModules/CEGUILua/tolua++ \
3
           -I$(top_srcdir)/ScriptingModules/CEGUILua/LuaScriptModule/include
3
           -I$(top_srcdir)/ScriptingModules/CEGUILua/LuaScriptModule/include \
4
           ${LUA_VERSION_FLAGS}
4
lib_LTLIBRARIES = libCEGUILuaScriptModule.la
5
lib_LTLIBRARIES = libCEGUILuaScriptModule.la
5
6
6
libCEGUILuaScriptModule_la_LDFLAGS = -version-info @CEGUI_VERSION_INFO@
7
libCEGUILuaScriptModule_la_LDFLAGS = -version-info @CEGUI_VERSION_INFO@

Return to bug 177670