From 6048f87e3c07d03df8a59da58c81608c5375f6dc Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 26 Sep 2013 00:41:14 +0200 Subject: Add initial Lua scripting support This is preliminary. There are still tons of issues, and any aspect of scripting may change in the future. I decided to merge this (preliminary) work now because it makes it easier to develop it, not because it's done. lua.rst is clear enough about it (plus some sarcasm). This requires linking to Lua. Lua has no official pkg-config file, but there are distribution specific .pc files, all with different names. Adding a non-pkg-config based configure test was considered, but we'd rather not. One major complication is that libquvi links against Lua too, and if the Lua version is different from mpv's, you will get a crash as soon as libquvi uses Lua. (libquvi by design always runs when a file is opened.) I would consider this the problem of distros and whoever builds mpv, but to make things easier for users, we add a terrible runtime test to the configure script, which probes whether libquvi will crash. This is disabled when cross-compiling, but in that case we hope the user knows what he is doing. --- Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 5199c7d28b..52741b8c7f 100644 --- a/Makefile +++ b/Makefile @@ -123,6 +123,8 @@ SOURCES-$(WAYLAND) += video/out/vo_wayland.c video/out/wayland_comm SOURCES-$(VF_LAVFI) += video/filter/vf_lavfi.c SOURCES-$(AF_LAVFI) += audio/filter/af_lavfi.c +SOURCES-$(LUA) += mpvcore/mp_lua.c + ifeq ($(HAVE_AVUTIL_REFCOUNTING),no) SOURCES-yes += video/decode/lavc_dr1.c endif @@ -397,6 +399,14 @@ sub/osd_libass.c: sub/osd_font.h sub/osd_font.h: TOOLS/file2string.pl sub/osd_font.otf ./$^ >$@ +mpvcore/mp_lua.c: mpvcore/lua/defaults.inc +mpvcore/lua/defaults.inc: TOOLS/file2string.pl mpvcore/lua/defaults.lua + ./$^ >$@ + +mpvcore/mp_lua.c: mpvcore/lua/assdraw.inc +mpvcore/lua/assdraw.inc: TOOLS/file2string.pl mpvcore/lua/assdraw.lua + ./$^ >$@ + # ./configure must be rerun if it changed config.mak: configure @echo "############################################################" @@ -495,6 +505,8 @@ clean: -$(RM) video/out/gl_video_shaders.h -$(RM) video/out/x11_icon.inc -$(RM) sub/osd_font.h + -$(RM) mpvcore/lua/defaults.inc + -$(RM) mpvcore/lua/assdraw.inc distclean: clean -$(RM) config.log config.mak config.h TAGS tags -- cgit v1.2.3