Checked into GIT x265 updated snapshot of 17122023, along with modified 0013-Multibit...patch as Andrew provided WITH NEW NAME of x265_3.517122023 because until x265_3.5 is deleted in thirdparty/src, the configure file requires a bigger number so that tar file is used.

Modified patch3 as recommended below for the Multibit patchset.

As Andrea has recommended, I am OK with making multibit automatically the default rather than separate IF CAN FIX THE "syntax error" that I found out is not only in ubuntu 16 but is in what I use as the Fedora baseline build.  Partial log below:

cmake version 3.17.4 -- The C compiler identification is GNU 10.3.1 -- The CXX compiler identification is GNU 10.3.1 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc - works --
...

/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `cmake version 3.17.4 -- The C compiler identification is GNU 10.3.1 -- The CXX compiler identification is GNU 10.3
...
make[3]: [Makefile:4: all] Error 1 (ignored)
make[3]: Leaving directory '/mnt0/build5/cinelerra-5.1/thirdparty/x265_3.517122023'

Will send full log file to see if Andrew knows what it is.




Compiling with multibit on Ubuntu 16, results in an Error in the log file, although it seems to work anyway.  Errors are:
./libx265_main12.a(api.cpp.o): In function `x265_12bit::x265_api_get_208(int)':
api.cpp:(.text+0x2004): undefined reference to `dlopen'
api.cpp:(.text+0x201c): undefined reference to `dlsym'
api.cpp:(.text+0x20ad): undefined reference to `dlopen'
./libx265_main12.a(api.cpp.o): In function `x265_12bit::x265_api_query(int, int, int*)':
api.cpp:(.text+0x2167): undefined reference to `dlopen'
api.cpp:(.text+0x217f): undefined reference to `dlsym'
api.cpp:(.text+0x224d): undefined reference to `dlopen'
collect2: error: ld returned 1 exit status
make[5]: *** [x265] Error 1
make[4]: *** [CMakeFiles/cli.dir/all] Error 2
make[3]: *** [all] Error 2

sounds like at least one shared lib was missing from final linking stage,like "-ldl". For me on termux another android-specific files was missed, so I added this file to ffmpeg-specific env. variable before configure in termux.bld and disabled cli x265 encoder (because ffmpeg need just *.a library).

I guess you can change x265 multibit patch3 , last cmake line

+cd ../8bit
+ln -sf ../10bit/libx265.a libx265_main10.a                                                        
+ln -sf ../12bit/libx265.a libx265_main12.a
+cmake ../source -DEXTRA_LIB="x265_main10.a;x265_main12.a" -DENABLE_SHARED=OFF -DEXTRA_LINK_FLAGS=-L. -DLINKED_10BIT=ON -DLINKED_12BIT=ON

by adding also DENABLE_CLI=OFF like in previous entry.