primecoin-core compile right way

this is official way to compile primecoin-core/bitcoin

ubuntu 16.04 compile primecoin-core 0.16.1 statically

error: unknown type name '__locale_t' __locale_t __loc)
sudo apt-get install libcurl4-gnutls-dev

tested in ubuntu 14.04,16.04,18.04 first system install

sudo apt update
sudo apt upgrade
sudo apt install -y build-essential autoconf libtool pkg-config libboost-all-dev libssl-dev libevent-dev libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler libqrencode-dev libminiupnpc-dev curl

cd depends
make
cd ..
./autogen.sh
./configure --enable-glibc-back-compat --prefix=`pwd`/depends/x86_64-pc-linux-gnu --disable-shared LDFLAGS="-static-libstdc++"
make STATIC=all

mkdir ./dist
cp ./src/primecoind ./src/primecoin-* ./src/qt/primecoin-qt ./dist
strip ./dist/*

//following config as backup, don't see other errors now.
if has following problem, not encountered so far:
./bitcoind: /lib64/libc.so.6: version `GLIBC_2.15' not found (required by ./bitcoind)
./bitcoind: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./bitcoind)
Answer:
./configure --enable-glibc-back-compat --prefix=`pwd`/depends/x86_64-pc-linux-gnu LDFLAGS="-static-libstdc++"

cross compile for win64/32

if want to compile win32 version just need change x86_64-w64-mingw32

sudo apt-get update
sudo apt-get install -y build-essential autoconf libtool pkg-config libboost-all-dev libssl-dev libevent-dev libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler libqrencode-dev libminiupnpc-dev curl

// cross compile specific depends
sudo apt install -y autotools-dev automake pkg-config bsdmainutils curl git g++-mingw-w64-x86-64 nsis

sudo apt install -y software-properties-common
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu zesty universe"
sudo apt update
sudo apt upgrade
# Set the default mingw32 g++ compiler option to posix.
sudo update-alternatives --config x86_64-w64-mingw32-g++

# strip out problematic Windows %PATH% imported var
PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g')

cd depends
make HOST=x86_64-w64-mingw32
cd ..
./autogen.sh
./configure --prefix=`pwd`/depends/x86_64-w64-mingw32 --disable-shared
make STATIC=all

mkdir release
cp ./src/primecoind.* ./src/primecoin-* ./src/qt/primecoin-qt.* ./release

// package installer
makensis share/setup.nsi

cross compile for mac

sudo apt-get update
sudo apt-get install -y build-essential autoconf libtool pkg-config libboost-all-dev libssl-dev libevent-dev libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler libqrencode-dev libminiupnpc-dev curl

for mac cross build
sudo apt-get install curl librsvg2-bin libtiff-tools bsdmainutils cmake imagemagick libcap-dev libz-dev libbz2-dev python-setuptools

need SDKs of Xcode_7.3.1.dmg
hdiutil attach Xcode_7.3.1.dmg
tar -C /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ -czf MacOSX10.11.sdk.tar.gz MacOSX10.11.sdk
unpack to depends/SDKs/MacOSX10.11.sdk

cd depends
make HOST=x86_64-apple-darwin11
cd ..
./autogen.sh
./configure --prefix=`pwd`/depends/x86_64-apple-darwin11 --disable-shared
make STATIC=all
make deploy