diff --git a/.gitignore b/.gitignore index 37c54960f..67876dc66 100755 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,11 @@ x64 agents/iguana.exe Debug/* +iguana/nanomsglib +iguana/nanomsgsrc +OSlibs/linux +OSlibs/osx + iguana/pnacl/Release/iguana_unstripped.pexe iguana/pnacl/Release/iguana.pexe diff --git a/iguana/build_static_nanomsg.sh b/iguana/build_static_nanomsg.sh index 777e42f92..104025c79 100755 --- a/iguana/build_static_nanomsg.sh +++ b/iguana/build_static_nanomsg.sh @@ -1,7 +1,19 @@ #!/bin/bash #Check if libnanomsg-static.a file is already exists or not -file="../OSlibs/linux/$(uname -m)/libnanomsg-static.a" +if [[ "$OSTYPE" == "linux-gnu" ]]; then + echo "Linux" + file="../OSlibs/linux/$(uname -m)/libnanomsg-static.a" + makedir="../OSlibs/linux/$(uname -m)/" + copytarget="../OSlibs/linux/$(uname -m)/libnanomsg-static.a" +elif [[ "$OSTYPE" == "darwin"* ]]; then + # Mac OSX + echo "Mac OSX" + file="../OSlibs/osx/$(uname -m)/libnanomsg-static.a" + makedir="../OSlibs/osx/$(uname -m)/" + copytarget="../OSlibs/osx/$(uname -m)/libnanomsg-static.a" +fi + if [ ! -f "$file" ] then echo "$0: File '${file}' not found." @@ -26,8 +38,8 @@ then cd ../.. pwd - mkdir -p ../OSlibs/linux/$(uname -m)/ - cp -av nanomsglib/lib/libnanomsg.a ../OSlibs/linux/$(uname -m)/libnanomsg-static.a + mkdir -p $makedir + cp -av nanomsglib/lib/libnanomsg.a $copytarget fi diff --git a/iguana/exchanges/client_static b/iguana/exchanges/client_static new file mode 100755 index 000000000..484c1cf57 --- /dev/null +++ b/iguana/exchanges/client_static @@ -0,0 +1,11 @@ +#!/bin/bash +source passphrase +source coins +pkill -15 marketmaker; +git pull; +cd ..; +make -f m_mm_StaticNanoMsg -j2 all; +rm -rf ./marketmaker +cp -av ../agents/marketmaker ./ +./marketmaker "{\"gui\":\"nogui\",\"client\":1, \"userhome\":\"/${HOME#"/"}\", \"passphrase\":\"$passphrase\", \"coins\":$coins}" & + diff --git a/iguana/exchanges/install b/iguana/exchanges/install index 6f5c28723..f6150cb1b 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,5 +1,5 @@ #!/bin/bash -cp install get_supernet trackbtc auto_chipskmd auto_chipsbtc pendingswaps fundvalue balances dynamictrust getcoin kickstart tradesarray claim deposit10 deposit1 invreset sendrawtransaction processfiles stop millis mnzservers bot_buy bot_list bot_statuslist bot_pause bot_resume bot_sell bot_settings bot_status bot_stop guistats pubkeystats pendings coinswaps baserelswaps setpassphrase notarizations getrawtransaction parselog statsdisp m_js trust trusted setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status ../dexscripts +cp install get_supernet trackbtc auto_chipskmd auto_chipsbtc pendingswaps fundvalue balances dynamictrust getcoin kickstart tradesarray claim deposit10 deposit1 invreset sendrawtransaction processfiles stop millis mnzservers bot_buy bot_list bot_statuslist bot_pause bot_resume bot_sell bot_settings bot_status bot_stop guistats pubkeystats pendings coinswaps baserelswaps setpassphrase notarizations getrawtransaction parselog statsdisp m_js trust trusted setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug buy sell bestfit orderbook client run_osx client_osx client_static run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status ../dexscripts cp coins.json .. cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . diff --git a/iguana/m_mm b/iguana/m_mm index 5a227a69a..0f42e38da 100755 --- a/iguana/m_mm +++ b/iguana/m_mm @@ -1,3 +1,16 @@ cd secp256k1; ./m_unix; cd .. cd ../crypto777; ./m_LP; cd ../iguana -gcc -g -o marketmaker -I../crypto777 exchanges/mm.c ../crypto777/cJSON.c mini-gmp.c groestl.c segwit_addr.c secp256k1.o ../agents/libcrypto777.a -lnanomsg -lcurl -lpthread -lm + +if [[ "$OSTYPE" == "linux-gnu" ]]; then + echo "Linux" + # Default is dynamic nanomsg for linux using this script + nanomsg_lib="-lnanomsg" +elif [[ "$OSTYPE" == "darwin"* ]]; then + # Mac OSX + echo "Mac OSX" + # on osx this script generates static libnanomsg and uses it to compile static marketmaker binary + ./build_static_nanomsg.sh + nanomsg_lib="../OSlibs/osx/$(uname -m)/libnanomsg-static.a" +fi + +gcc -g -o marketmaker -I../crypto777 exchanges/mm.c ../crypto777/cJSON.c mini-gmp.c groestl.c segwit_addr.c secp256k1.o ../agents/libcrypto777.a $nanomsg_lib -lcurl -lpthread -lm