mirror of
https://github.com/holub/mame
synced 2025-10-04 08:28:39 +03:00
Made pnacl to compile (nw)
This commit is contained in:
parent
2582ce7f16
commit
3a811376d9
2
3rdparty/lua/src/liolib.c
vendored
2
3rdparty/lua/src/liolib.c
vendored
@ -81,7 +81,7 @@
|
|||||||
|
|
||||||
#if !defined(l_getc) /* { */
|
#if !defined(l_getc) /* { */
|
||||||
|
|
||||||
#if defined(LUA_USE_POSIX)
|
#if defined(LUA_USE_POSIX) && !defined(__native_client__)
|
||||||
#define l_getc(f) getc_unlocked(f)
|
#define l_getc(f) getc_unlocked(f)
|
||||||
#define l_lockfile(f) flockfile(f)
|
#define l_lockfile(f) flockfile(f)
|
||||||
#define l_unlockfile(f) funlockfile(f)
|
#define l_unlockfile(f) funlockfile(f)
|
||||||
|
9
makefile
9
makefile
@ -94,7 +94,8 @@
|
|||||||
|
|
||||||
# FORCE_VERSION_COMPILE = 1
|
# FORCE_VERSION_COMPILE = 1
|
||||||
|
|
||||||
# MS BUILD = 1
|
# MSBUILD = 1
|
||||||
|
# USE_LIBUV = 1
|
||||||
|
|
||||||
ifdef PREFIX_MAKEFILE
|
ifdef PREFIX_MAKEFILE
|
||||||
include $(PREFIX_MAKEFILE)
|
include $(PREFIX_MAKEFILE)
|
||||||
@ -676,6 +677,10 @@ ifdef PLATFORM
|
|||||||
TARGET_PARAMS += --PLATFORM='$(PLATFORM)'
|
TARGET_PARAMS += --PLATFORM='$(PLATFORM)'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifdef USE_LIBUV
|
||||||
|
PARAMS += --USE_LIBUV='$(USE_LIBUV)'
|
||||||
|
endif
|
||||||
|
|
||||||
#-------------------------------------------------
|
#-------------------------------------------------
|
||||||
# All scripts
|
# All scripts
|
||||||
#-------------------------------------------------
|
#-------------------------------------------------
|
||||||
@ -1024,7 +1029,7 @@ $(PROJECTDIR_MINI)/gmake-pnacl/Makefile: makefile $(SCRIPTS) $(GENIE)
|
|||||||
ifndef NACL_SDK_ROOT
|
ifndef NACL_SDK_ROOT
|
||||||
$(error NACL_SDK_ROOT is not set)
|
$(error NACL_SDK_ROOT is not set)
|
||||||
endif
|
endif
|
||||||
$(SILENT) $(GENIE) $(PARAMS) --gcc=pnacl --gcc_version=3.7.0 --osd=osdmini --targetos=pnacl --NOASM=1 gmake
|
$(SILENT) $(GENIE) $(PARAMS) --gcc=pnacl --gcc_version=3.7.0 --osd=osdmini --targetos=pnacl --NOASM=1 --USE_LIBUV=0 gmake
|
||||||
|
|
||||||
.PHONY: pnacl
|
.PHONY: pnacl
|
||||||
pnacl: generate $(PROJECTDIR_MINI)/gmake-pnacl/Makefile
|
pnacl: generate $(PROJECTDIR_MINI)/gmake-pnacl/Makefile
|
||||||
|
@ -387,6 +387,15 @@ newoption {
|
|||||||
description = "Target machine platform (x86,arm,...)",
|
description = "Target machine platform (x86,arm,...)",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
newoption {
|
||||||
|
trigger = "USE_LIBUV",
|
||||||
|
description = "Use libuv.",
|
||||||
|
allowed = {
|
||||||
|
{ "0", "Disabled" },
|
||||||
|
{ "1", "Enabled" },
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if _OPTIONS["SHLIB"]=="1" then
|
if _OPTIONS["SHLIB"]=="1" then
|
||||||
LIBTYPE = "SharedLib"
|
LIBTYPE = "SharedLib"
|
||||||
else
|
else
|
||||||
@ -411,6 +420,10 @@ if not _OPTIONS["NOASM"] then
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if not _OPTIONS["USE_LIBUV"] then
|
||||||
|
_OPTIONS["USE_LIBUV"] = "1"
|
||||||
|
end
|
||||||
|
|
||||||
if _OPTIONS["NOASM"]=="1" and not _OPTIONS["FORCE_DRC_C_BACKEND"] then
|
if _OPTIONS["NOASM"]=="1" and not _OPTIONS["FORCE_DRC_C_BACKEND"] then
|
||||||
_OPTIONS["FORCE_DRC_C_BACKEND"] = "1"
|
_OPTIONS["FORCE_DRC_C_BACKEND"] = "1"
|
||||||
end
|
end
|
||||||
@ -511,6 +524,11 @@ configuration { "gmake" }
|
|||||||
|
|
||||||
dofile ("toolchain.lua")
|
dofile ("toolchain.lua")
|
||||||
|
|
||||||
|
if _OPTIONS["USE_LIBUV"]=="0" then
|
||||||
|
defines {
|
||||||
|
"NO_LIBUV",
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
if _OPTIONS["targetos"]=="windows" then
|
if _OPTIONS["targetos"]=="windows" then
|
||||||
configuration { "x64" }
|
configuration { "x64" }
|
||||||
@ -1023,9 +1041,6 @@ configuration { "android*" }
|
|||||||
"-Wno-tautological-constant-out-of-range-compare",
|
"-Wno-tautological-constant-out-of-range-compare",
|
||||||
"-Wno-tautological-pointer-compare",
|
"-Wno-tautological-pointer-compare",
|
||||||
}
|
}
|
||||||
defines {
|
|
||||||
"_POSIX_BARRIERS=1",
|
|
||||||
}
|
|
||||||
archivesplit_size "20"
|
archivesplit_size "20"
|
||||||
|
|
||||||
configuration { "pnacl" }
|
configuration { "pnacl" }
|
||||||
|
@ -513,7 +513,7 @@ project "lualibs"
|
|||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
-- luv lua library objects
|
-- luv lua library objects
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
|
if _OPTIONS["USE_LIBUV"]=="1" then
|
||||||
project "luv"
|
project "luv"
|
||||||
uuid "d98ec5ca-da2a-4a50-88a2-52061ca53871"
|
uuid "d98ec5ca-da2a-4a50-88a2-52061ca53871"
|
||||||
kind "StaticLib"
|
kind "StaticLib"
|
||||||
@ -567,7 +567,7 @@ project "luv"
|
|||||||
MAME_DIR .. "3rdparty/luv/src/luv.c",
|
MAME_DIR .. "3rdparty/luv/src/luv.c",
|
||||||
MAME_DIR .. "3rdparty/luv/src/luv.h",
|
MAME_DIR .. "3rdparty/luv/src/luv.h",
|
||||||
}
|
}
|
||||||
|
end
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
-- SQLite3 library objects
|
-- SQLite3 library objects
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
@ -1007,6 +1007,7 @@ end
|
|||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
-- libuv library objects
|
-- libuv library objects
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
|
if _OPTIONS["USE_LIBUV"]=="1" then
|
||||||
project "uv"
|
project "uv"
|
||||||
uuid "cd2afe7f-139d-49c3-9000-fc9119f3cea0"
|
uuid "cd2afe7f-139d-49c3-9000-fc9119f3cea0"
|
||||||
kind "StaticLib"
|
kind "StaticLib"
|
||||||
@ -1196,7 +1197,7 @@ project "uv"
|
|||||||
"-Wshadow"
|
"-Wshadow"
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
end
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
-- HTTP parser library objects
|
-- HTTP parser library objects
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
|
@ -35,6 +35,14 @@ end
|
|||||||
"EGL",
|
"EGL",
|
||||||
"GLESv2",
|
"GLESv2",
|
||||||
}
|
}
|
||||||
|
configuration { "pnacl" }
|
||||||
|
kind "ConsoleApp"
|
||||||
|
targetextension ".pexe"
|
||||||
|
links {
|
||||||
|
"ppapi",
|
||||||
|
"ppapi_gles2",
|
||||||
|
"pthread",
|
||||||
|
}
|
||||||
configuration { }
|
configuration { }
|
||||||
|
|
||||||
addprojectflags()
|
addprojectflags()
|
||||||
@ -153,11 +161,15 @@ end
|
|||||||
"7z",
|
"7z",
|
||||||
"lua",
|
"lua",
|
||||||
"lualibs",
|
"lualibs",
|
||||||
"luv",
|
|
||||||
"uv",
|
|
||||||
"http-parser",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if _OPTIONS["USE_LIBUV"]=="1" then
|
||||||
|
links {
|
||||||
|
"luv",
|
||||||
|
"uv",
|
||||||
|
"http-parser",
|
||||||
|
}
|
||||||
|
end
|
||||||
if _OPTIONS["with-bundled-zlib"] then
|
if _OPTIONS["with-bundled-zlib"] then
|
||||||
links {
|
links {
|
||||||
"zlib",
|
"zlib",
|
||||||
|
@ -19,7 +19,9 @@
|
|||||||
#include "ui/ui.h"
|
#include "ui/ui.h"
|
||||||
#include "luaengine.h"
|
#include "luaengine.h"
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
#if !defined(NO_LIBUV)
|
||||||
#include "libuv/include/uv.h"
|
#include "libuv/include/uv.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
// LUA ENGINE
|
// LUA ENGINE
|
||||||
@ -49,9 +51,11 @@ lua_engine* lua_engine::luaThis = nullptr;
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
int luaopen_lsqlite3(lua_State *L);
|
int luaopen_lsqlite3(lua_State *L);
|
||||||
int luaopen_zlib(lua_State *L);
|
int luaopen_zlib(lua_State *L);
|
||||||
int luaopen_luv(lua_State *L);
|
|
||||||
int luaopen_lfs(lua_State *L);
|
int luaopen_lfs(lua_State *L);
|
||||||
|
#if !defined(NO_LIBUV)
|
||||||
|
int luaopen_luv(lua_State *L);
|
||||||
uv_loop_t* luv_loop(lua_State* L);
|
uv_loop_t* luv_loop(lua_State* L);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lstop(lua_State *L, lua_Debug *ar)
|
static void lstop(lua_State *L, lua_Debug *ar)
|
||||||
@ -1195,9 +1199,11 @@ lua_engine::lua_engine()
|
|||||||
lua_getfield(m_lua_state, -1, "preload");
|
lua_getfield(m_lua_state, -1, "preload");
|
||||||
lua_remove(m_lua_state, -2); // Remove package
|
lua_remove(m_lua_state, -2); // Remove package
|
||||||
|
|
||||||
|
#if !defined(NO_LIBUV)
|
||||||
// Store uv module definition at preload.uv
|
// Store uv module definition at preload.uv
|
||||||
lua_pushcfunction(m_lua_state, luaopen_luv);
|
lua_pushcfunction(m_lua_state, luaopen_luv);
|
||||||
lua_setfield(m_lua_state, -2, "luv");
|
lua_setfield(m_lua_state, -2, "luv");
|
||||||
|
#endif
|
||||||
|
|
||||||
lua_pushcfunction(m_lua_state, luaopen_zlib);
|
lua_pushcfunction(m_lua_state, luaopen_zlib);
|
||||||
lua_setfield(m_lua_state, -2, "zlib");
|
lua_setfield(m_lua_state, -2, "zlib");
|
||||||
@ -1661,10 +1667,11 @@ void lua_engine::periodic_check()
|
|||||||
msg.ready = 0;
|
msg.ready = 0;
|
||||||
msg.done = 1;
|
msg.done = 1;
|
||||||
}
|
}
|
||||||
|
#if !defined(NO_LIBUV)
|
||||||
auto loop = luv_loop(m_lua_state);
|
auto loop = luv_loop(m_lua_state);
|
||||||
if (loop!=nullptr)
|
if (loop!=nullptr)
|
||||||
uv_run(loop, UV_RUN_NOWAIT);
|
uv_run(loop, UV_RUN_NOWAIT);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user