Download:
 - net-snmp-5.9.1.tar.gz from https://sourceforge.net/projects/net-snmp/files/net-snmp/5.9.1/net-snmp-5.9.1.tar.gz
 - openssl-3.1.6.tar.gz from https://www.openssl.org/source/openssl-3.1.6.tar.gz

unzip -o ~/moshell/commonjars/src/openssh/patches.zip -d ~/moshell/commonjars/src/openssh
unzip -o ~/moshell/commonjars/src/netsnmp/patches.zip -d ~/moshell/commonjars/src/netsnmp

Linux 64-bit: Compile on a workstation with old libc 2.11.3, eg seliiuts02929 or ottlsvr18 or sekilx484.wrbs.rnd.ki.sw.ericsson.se or sekilx1260.wrbs.rnd.ki.sw.ericsson.se
MacOS: compile libraries with Apple clang

export CC=gcc
module add perl/5.20.0
module add python/3.9.0
module add gcc/10.2.0
module add make/4.3

rm -rf /tmp/netsnmp
mkdir /tmp/netsnmp
cp ~/net-snmp-5.9.1.tar.gz ~/openssl-3.1.6.tar.gz /tmp/netsnmp

cd /tmp/netsnmp
rm -rf openssl-3.1.6
rm -rf sslinst
tar xf openssl-3.1.6.tar.gz

cd openssl-3.1.6
cp ~/moshell/commonjars/src/openssh/patches/0001-Moshell-SSL-mods-3.1.1.patch .
cp ~/moshell/commonjars/src/openssh/patches/0001-Restore-SHA1-security-strength.patch .
cp ~/moshell/commonjars/src/openssh/patches/0001-Allow-client-unsafe-renegotiation.patch .
patch -p1 -i 0001-Moshell-SSL-mods-3.1.1.patch
patch -p1 -i 0001-Restore-SHA1-security-strength.patch
patch -p1 -i 0001-Allow-client-unsafe-renegotiation.patch
./config -fPIC no-shared no-threads --prefix="/tmp/netsnmp/sslinst" && make depend && make && make install

cd /tmp/netsnmp
rm -rf net-snmp-5.9.1
tar xf net-snmp-5.9.1.tar.gz
cd net-snmp-5.9.1
cp ~/moshell/commonjars/src/netsnmp/patches/snmpwalk-591.patch .
patch -p1 -i snmpwalk-591.patch
chmod 755 configure
env CFLAGS="-g -O2 -fPIC -ldl" ./configure --with-ldflags="-L/tmp/netsnmp/sslinst/lib64 -Bstatic" --enable-static --enable-shared=no --with-default-snmp-version=3 --with-sys-contact="@@no.where" --with-sys-location="Unknown" --with-logfile="/var/log/snmpd.log" --with-persistent-directory="/var/net-snmp" && make

//MacOS:
//env CFLAGS="-g -O2 -fPIC" ./configure --with-ldflags="-L/tmp/netsnmp/sslinst/lib" --enable-static --enable-shared=no --with-default-snmp-version=3 --with-sys-contact="@@no.where" --with-sys-location="Unknown" --with-logfile="/var/log/snmpd.log" --with-persistent-directory="/var/net-snmp" && make

-------------------------------
snpwalk can then be found at ./apps/snmpwalk
strip ./apps/snmpwalk
Also include the folder "mibs" to the file moshell/commonjars/pm/netsnmp-mibs.zip

