From bcfd3131b355aff98d81c1be06e428c75bf04d6c Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <randrianasulu@gmail.com>
Date: Sat, 23 May 2026 20:02:43 +0300
Subject: [PATCH] Freebsd 15.0 fixes

---
 cinelerra-5.1/autogen.sh   | 8 ++++++--
 cinelerra-5.1/blds/bsd.bld | 6 ++++--
 cinelerra-5.1/configure.ac | 8 ++++++--
 3 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/cinelerra-5.1/autogen.sh b/cinelerra-5.1/autogen.sh
index 50f3a13d..02fc22ff 100755
--- a/cinelerra-5.1/autogen.sh
+++ b/cinelerra-5.1/autogen.sh
@@ -9,8 +9,12 @@ if [ "$1" = "clean" ]; then exit 0; fi
 
 #autoupdate
 mkdir m4
-autoreconf --install
+autoreconf -W all --install
 
 if [ "$(uname -o)" = "Android" ] || [ -e "/system/bin/app_process" ]; then
 sed -i 's/usr\/bin\/sh/usr\/bin\/bash/' configure
-fi
\ No newline at end of file
+fi
+
+if [ "$(uname -o)" = "FreeBSD" ] ; then
+gsed -i 's/bin\/sh/usr\/local\/bin\/bash/' configure
+fi
diff --git a/cinelerra-5.1/blds/bsd.bld b/cinelerra-5.1/blds/bsd.bld
index 6f78fd4b..d648ee18 100755
--- a/cinelerra-5.1/blds/bsd.bld
+++ b/cinelerra-5.1/blds/bsd.bld
@@ -1,12 +1,14 @@
 #!/usr/local/bin/bash
 #use: patch -p2 < bsd.patch
-export CONFIG_SHELL=/bin/bash
+export CONFIG_SHELL=/usr/local/bin/bash
+export SHELL=/usr/local/bin/bash
 export MAKE=gmake
 export C_INCLUDE_PATH=/usr/local/include
 export CPLUS_INCLUDE_PATH=/usr/local/include:/usr/local/include/OpenEXR:/usr/local/include/Imath
 export LIBRARY_PATH=/usr/local/lib
 alias make=gmake
-( ./autogen.sh
+alias echo=/bin/echo
+( $SHELL ./autogen.sh
   BSD=1 CC=clang CXX=clang++ CFLAGS="-g -O2 " \
   ./configure --with-single-user \
     --disable-static-build --without-libzmpeg --disable-lame --disable-twolame \
diff --git a/cinelerra-5.1/configure.ac b/cinelerra-5.1/configure.ac
index c8a37bce..376c20cd 100644
--- a/cinelerra-5.1/configure.ac
+++ b/cinelerra-5.1/configure.ac
@@ -30,7 +30,7 @@ if test x"$LIBTOOL" == x"no" ; then
 AC_MSG_ERROR([Please install libtool])
 fi
 
-AC_CHECK_PROGS(PYTHON,[python3 python3.12 python3.9 python],[no])
+AC_CHECK_PROGS(PYTHON,[python3 python3.11 python3.12 python3.9 python],[no])
 if test x"$PYTHON" == x"no" ; then
 AC_MSG_ERROR([Please install python/python3])
 fi
@@ -1295,9 +1295,13 @@ AC_OUTPUT
 exec > global_config
 if test [ "$(uname)"] = "NetBSD" ; then
 echo "SHELL := /usr/pkg/bin/bash"
-else
+fi
+if test [ "$(uname)"] = "Linux" ; then
 echo "SHELL := /bin/bash"
 fi
+if test [ "$(uname)"] = "FreeBSD" ; then
+echo "SHELL := /usr/local/bin/bash"
+fi
 echo "export SHELL"
 echo "WANT_JOBS := $WANT_JOBS"
 if test "x$WANT_CLANG" = "xyes" ; then
-- 
2.54.0

