From f91bafb8668985a3ec6ff5e6085f83f73b1c0dfb Mon Sep 17 00:00:00 2001
From: turbocat <turbocat@kolibrios.org>
Date: Thu, 8 Jul 2021 20:46:48 +0000
Subject: [PATCH] Fplay: Added to autobuild.

git-svn-id: svn://kolibrios.org@9040 a494cfbc-eb01-0410-851d-a64ba20cac60
---
 contrib/media/fplay/Makefile    |  2 +-
 contrib/media/fplay/Tupfile.lua | 31 +++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 1 deletion(-)
 create mode 100644 contrib/media/fplay/Tupfile.lua

diff --git a/contrib/media/fplay/Makefile b/contrib/media/fplay/Makefile
index f6f45416f4..e6bd9eed14 100644
--- a/contrib/media/fplay/Makefile
+++ b/contrib/media/fplay/Makefile
@@ -55,7 +55,7 @@ $(NAME): $(OBJECTS) Makefile
 
 
 clean: 
-	-rm -f *.o 
+	-rm -f $(OBJECTS)
 
 
 
diff --git a/contrib/media/fplay/Tupfile.lua b/contrib/media/fplay/Tupfile.lua
new file mode 100644
index 0000000000..2a1e2f21ba
--- /dev/null
+++ b/contrib/media/fplay/Tupfile.lua
@@ -0,0 +1,31 @@
+if tup.getconfig("NO_GCC") ~= "" or tup.getconfig("NO_FASM") ~= "" then return end
+HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../../programs" or tup.getconfig("HELPERDIR")
+tup.include(HELPERDIR .. "/use_gcc.lua")
+tup.include(HELPERDIR .. "/use_newlib.lua")
+
+CFLAGS = " -c -O2 -fno-ident -std=c99 -fomit-frame-pointer -mno-ms-bitfields -U_Win32 -U_WIN32 -U__MINGW32__ -DPACKAGE_NAME='\"Fplay-vaapi\"' -DDEBUG=1 -D_GNU_SOURCE -DHAVE_VAAPI -I../../sdk/sources/newlib/libc/include -I../../sdk/sources/ffmpeg/ffmpeg-2.8 -I../../sdk/sources/freetype/include -I../../sdk/sources/vaapi/libva-1.6.2 "
+
+LDFLAGS = " -static --subsystem native --stack 0x200000 -Map fplay.map -Tapp-dynamic.lds --image-base 0 "
+
+LIBS= " -lavdevice.dll -lavformat.dll -lavcodec.dll -lavutil.dll -lswscale.dll -lswresample.dll -lsound -lpixlib3 -lfreetype.dll -lva.dll -lgcc -lc.dll "
+
+compile_gcc{
+    "audio.c",
+    "decoder.c",
+    "fplay.c",
+    "vaapi.c",
+    "video.c",
+    "utils.c",
+    "winlib/button.c",
+    "winlib/caption.c",
+    "winlib/fontlib.c",
+    "winlib/frame.c",
+    "winlib/panel.c",
+    "winlib/window.c",
+}
+tup.rule("opendial.asm", "fasm %f %o ", "opendial.o")
+tup.rule("skin/skin.asm", "fasm %f %o ", "skin/skin.o")
+
+tup.append_table(OBJS, {"opendial.o", "skin/skin.o"})
+
+link_gcc("Fplay")