From 0d9620ec0749e867e063472d75578262a2db7c56 Mon Sep 17 00:00:00 2001 From: satindergrewal Date: Wed, 7 Feb 2018 23:34:16 +1300 Subject: [PATCH] linux nanomsg static lib fix compiles and places the static nanomsg lib files on compile --- iguana/build_static_nanomsg.sh | 33 +++++++++++++++++++++++++++++++++ iguana/m_LP_StaticNanoMsg | 1 + iguana/m_mm_StaticNanoMsg | 2 ++ 3 files changed, 36 insertions(+) create mode 100755 iguana/build_static_nanomsg.sh diff --git a/iguana/build_static_nanomsg.sh b/iguana/build_static_nanomsg.sh new file mode 100755 index 0000000000..777e42f922 --- /dev/null +++ b/iguana/build_static_nanomsg.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +#Check if libnanomsg-static.a file is already exists or not +file="../OSlibs/linux/$(uname -m)/libnanomsg-static.a" +if [ ! -f "$file" ] +then + echo "$0: File '${file}' not found." + #Download nanomsg library 1.0 stable + rm -rf nanomsgsrc + git clone https://github.com/nanomsg/nanomsg.git nanomsgsrc + + #Create destination folder + mkdir nanomsglib + + #Switch into nanomsgsrc folder + cd nanomsgsrc + + #Create build directory and switch into it + mkdir build && cd build + + #Compile + cmake .. -DCMAKE_INSTALL_PREFIX=../../nanomsglib/ -DCMAKE_BUILD_TYPE=Debug -DNN_STATIC_LIB=1 + cmake --build . + ctest -C Debug . + cmake --build . --target install + + cd ../.. + pwd + mkdir -p ../OSlibs/linux/$(uname -m)/ + cp -av nanomsglib/lib/libnanomsg.a ../OSlibs/linux/$(uname -m)/libnanomsg-static.a +fi + + diff --git a/iguana/m_LP_StaticNanoMsg b/iguana/m_LP_StaticNanoMsg index f121efc88a..12dd63b2f6 100755 --- a/iguana/m_LP_StaticNanoMsg +++ b/iguana/m_LP_StaticNanoMsg @@ -2,6 +2,7 @@ #./configure --enable-endomorphism --enable-module-ecdh --enable-module-schnorr --enable-module-rangeproof --enable-experimental --enable-module_recovery rm -f ../agents/iguana *.o git pull +./build_static_nanomsg.sh cd secp256k1; ./m_unix; cd .. cd ../crypto777; make -f m_LP_StaticNanoMsg all; make -f m_LP_StaticNanoMsg clean; cd ../iguana diff --git a/iguana/m_mm_StaticNanoMsg b/iguana/m_mm_StaticNanoMsg index 2c224b7647..6d686ac013 100755 --- a/iguana/m_mm_StaticNanoMsg +++ b/iguana/m_mm_StaticNanoMsg @@ -2,6 +2,8 @@ # author: fadedreamz@SuperNet.org # date: Aug, 2017 +./build_static_nanomsg.sh + LIB_ARCH=$(uname -m) .PHONY: clean all