From 9c98d71d46be976548601b6d19c356ed84cfcce4 Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <randrianasulu@gmail.com>
Date: Thu, 19 Feb 2026 16:25:51 +0300
Subject: [PATCH 5/5] Add python3.12, python3.9 to configure.ac check, use in
 guicast/Makefile

---
 cinelerra-5.1/configure.ac     |  2 +-
 cinelerra-5.1/guicast/Makefile | 20 ++++----------------
 2 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/cinelerra-5.1/configure.ac b/cinelerra-5.1/configure.ac
index 23edd2fa..d832a6a0 100644
--- a/cinelerra-5.1/configure.ac
+++ b/cinelerra-5.1/configure.ac
@@ -29,7 +29,7 @@ if test x"$LIBTOOL" == x"no" ; then
 AC_MSG_ERROR([Please install libtool])
 fi
 
-AC_CHECK_PROGS(PYTHON,[python3 python],[no])
+AC_CHECK_PROGS(PYTHON,[python3 python3.12 python3.9 python],[no])
 if test x"$PYTHON" == x"no" ; then
 AC_MSG_ERROR([Please install python/python3])
 fi
diff --git a/cinelerra-5.1/guicast/Makefile b/cinelerra-5.1/guicast/Makefile
index 0e893f91..929502a1 100644
--- a/cinelerra-5.1/guicast/Makefile
+++ b/cinelerra-5.1/guicast/Makefile
@@ -135,24 +135,12 @@ $(shell echo $(CFLAGS) > $(OBJDIR)/c_flags)
 $(shell echo $(OBJS) > $(OBJDIR)/objs)
 
 all: $(OUTPUT) $(UTILS)
-PLATFORM = $(uname -s)
-ifneq ($(PLATFORM), FreeBSD)
-python = $(shell find /usr/local/bin -name python3\* | head -n 1)
-endif
-ifneq ($(PLATFORM), Linux)
-python = $(shell which python)
-endif
 
-ifeq ($(python),)
-python = $(shell which python3.9)
-endif
+python = $(shell echo $(PYTHON))
 
-ifeq ($(python),)
-python = $(shell which python3.12)
-endif
-
-ifeq ($(python),)
-python = $(shell which python3)
+PLATFORM = $(uname -s)
+ifeq ($(PLATFORM), FreeBSD)
+python = $(shell find /usr/local/bin -name python3\* | head -n 1)
 endif
 
 
-- 
2.53.0

