Finally I tested on other systems and found no obvious problems so I checked them into GIT.

One question:  in    0002-Second-round-of-netbsd-fixes.patch for the plugins/Makefile   why remove the "-o" in the line -PLATFORM = $(shell uname -o)    to just   +PLATFORM = $(shell uname)  ?  It seems OK to me but just trying to understand it.

On Thu, Jan 12, 2023 at 4:09 AM Andrew Randrianasulu <randrianasulu@gmail.com> wrote:
I tried to fix NetBSD build without breaking FreeBSD, Linux and termux..

It seems I successed!

Attached patches builds (and runs)

on NetBSD 9.2 I386
FreeBSD 12.3 amd64
Slackware 15.0 i586
Termux aarch64

all without-thirdparty for saving build time.

Can you test them on your usual systems?