milis/talimatname/genel/x/xmoto/lua52_compat.patch

46 lines
2.2 KiB
Diff

diff --git a/configure.in b/configure.in
index 452f196..dbceb05 100644
--- a/configure.in
+++ b/configure.in
@@ -157,8 +157,8 @@ AM_CONDITIONAL([USE_SDLGFX], test "$USE_SDLGFX" = "1")
# m
AC_CHECK_LIB(m, floor, , AC_MSG_ERROR(No math library found))
-AC_SEARCH_LIBS(lua_pushboolean,lua lua5.1 lua50, [], [AC_MSG_ERROR(liblua5.1, liblua50, or liblua required)])
-AC_SEARCH_LIBS(luaopen_math,lualib lualib5.1 lualib50, [], [AC_MSG_ERROR(liblualib5.1, liblualib50, or liblualib required)])
+AC_SEARCH_LIBS(lua_pushboolean,lua lua5.2 lua5.1 lua50, [], [AC_MSG_ERROR(liblua5.2 liblua5.1, liblua50, or liblua required)])
+AC_SEARCH_LIBS(luaopen_math,lualib liblua5.2 lualib5.1 lualib50, [], [AC_MSG_ERROR(liblualib5.2 liblualib5.1, liblualib50, or liblualib required)])
dnl ***** Check lua headers, as they are prone to be located random places on random systems! *****
dnl The following three lines where suggested by Eric Piel, but they don't seem to work on my system
@@ -174,6 +174,8 @@ AC_CHECK_HEADER(lua/lua.h, AC_DEFINE(HAVE_LUA_LUA_H) [USE_LUA_VERSION="unkn
AC_CHECK_HEADER(lua50/lua.h, AC_DEFINE(HAVE_LUA50_LUA_H) [USE_LUA_VERSION="5.0"])
AC_CHECK_HEADER(lua51/lua.h, AC_DEFINE(HAVE_LUA51_LUA_H) [USE_LUA_VERSION="5.1"])
AC_CHECK_HEADER(lua5.1/lua.h, AC_DEFINE(HAVE_LUA5_1_LUA_H)[USE_LUA_VERSION="5.1"])
+AC_CHECK_HEADER(lua52/lua.h, AC_DEFINE(HAVE_LUA52_LUA_H) [USE_LUA_VERSION="5.2"])
+AC_CHECK_HEADER(lua5.2/lua.h, AC_DEFINE(HAVE_LUA5_2_LUA_H)[USE_LUA_VERSION="5.2"])
AC_DEFINE(LUA_COMPAT_MODULE, 1)
AC_LANG_PUSH([C++])
diff --git a/src/include/xm_lua.h b/src/include/xm_lua.h
index 8a2cc17..f470de2 100644
--- a/src/include/xm_lua.h
+++ b/src/include/xm_lua.h
@@ -4,7 +4,15 @@ extern "C" {
#include "lauxlib.h"
#include "lualib.h"
#else
- #if defined(HAVE_LUA5_1_LUA_H)
+ #if defined(HAVE_LUA5_2_LUA_H)
+ #include <lua5.2/lua.h>
+ #include <lua5.2/lauxlib.h>
+ #include <lua5.2/lualib.h>
+ #elif defined(HAVE_LUA52_LUA_H)
+ #include <lua52/lua.h>
+ #include <lua52/lauxlib.h>
+ #include <lua52/lualib.h>
+ #elif defined(HAVE_LUA5_1_LUA_H)
#include <lua5.1/lua.h>
#include <lua5.1/lauxlib.h>
#include <lua5.1/lualib.h>