From 8e54afcc4865e53c2ed270d33e9fc82da1177c60 Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <randrianasulu@gmail.com>
Date: Sun, 3 Apr 2022 01:17:11 +0300
Subject: [PATCH 51/71] Hopefully  fix dyn liba52  on termux

---
 cinelerra-5.1/configure.ac       | 2 +-
 cinelerra-5.1/libzmpeg3/Makefile | 5 ++++-
 cinelerra-5.1/mpeg2enc/Makefile  | 7 +++++++
 cinelerra-5.1/mplexlo/Makefile   | 7 +++++++
 4 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/cinelerra-5.1/configure.ac b/cinelerra-5.1/configure.ac
index 7481d411..147a69de 100644
--- a/cinelerra-5.1/configure.ac
+++ b/cinelerra-5.1/configure.ac
@@ -28,7 +28,7 @@ CFG_CFLAGS+=" -D__STDC_CONSTANT_MACROS"
 CFG_CFLAGS+=" -D__STDC_LIMIT_MACROS"
 CFG_CFLAGS+=" -DPNG_SKIP_SETJMP_CHECK=1"
 CFG_CFLAGS+=" -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
-CFG_CFLAGS+=" -I/usr/include -I/usr/local/include"
+CFG_CFLAGS+=" -I/usr/include -I/usr/local/include -I/data/data/com.termux/files/usr/include/a52dec"
 CFG_CFLAGS+=" -I/usr/include/freetype2 -I/usr/local/include/freetype2"
 CFG_CFLAGS+=" -I/data/data/com.termux/files/usr/include/freetype2"
 CFG_CFLAGS+=" -I/usr/include/uuid -I/usr/local/include/uuid"
diff --git a/cinelerra-5.1/libzmpeg3/Makefile b/cinelerra-5.1/libzmpeg3/Makefile
index 1e59d36f..c5b8a083 100644
--- a/cinelerra-5.1/libzmpeg3/Makefile
+++ b/cinelerra-5.1/libzmpeg3/Makefile
@@ -79,9 +79,12 @@ UTILS += $(OBJDIR)/zmpeg3ifochk
 UTILS += $(OBJDIR)/zmpeg3cc2txt
 
 LIBS = -lm -lpthread
-ifeq ($(WITH_THIRDPARTY),no)
+ifeq ($(WANT_CIN_3RDPARTY),no)
 LIBS += -la52
 endif
+ifeq ($(shell uname -o), Android)
+LIBS += jpt.a
+endif
 
 LIBS += $(lib_a52dec) $(lib_djbfft) $(lib_libbthread)
 
diff --git a/cinelerra-5.1/mpeg2enc/Makefile b/cinelerra-5.1/mpeg2enc/Makefile
index 80e0f8f9..bab267cf 100644
--- a/cinelerra-5.1/mpeg2enc/Makefile
+++ b/cinelerra-5.1/mpeg2enc/Makefile
@@ -56,6 +56,13 @@ OBJ = \
 LIBS := $(LIBZMPEG3)/$(OBJDIR)/libzmpeg3.a
 LIBS += $(libraries)
 
+ifeq ($(WANT_CIN_3RDPARTY),no)
+LIBS += -la52
+endif
+ifeq ($(shell uname -o), Android)
+LIBS += jpt.a
+endif
+
 HVEG2LIB = $(OBJDIR)/hveg2enc.a
 HVEG2ENC = $(OBJDIR)/hveg2enc
 HVEG2ENC_G = $(OBJDIR)/hveg2enc_g
diff --git a/cinelerra-5.1/mplexlo/Makefile b/cinelerra-5.1/mplexlo/Makefile
index c1a8aae8..66126523 100644
--- a/cinelerra-5.1/mplexlo/Makefile
+++ b/cinelerra-5.1/mplexlo/Makefile
@@ -13,6 +13,13 @@ CFLAGS += $(static_incs)
 LIBS := $(LIBZMPEG3)/$(OBJDIR)/libzmpeg3.a
 LIBS += $(libraries)
 
+ifeq ($(WANT_CIN_3RDPARTY),no)
+LIBS += -la52
+endif
+ifeq ($(shell uname -o), Android)
+LIBS += jpt.a
+endif
+
 OUTPUT := $(OBJDIR)/mplexlo
 
 $(OUTPUT) all: $(OBJS)
-- 
2.35.1

