Skip to content

Commit

Permalink
Merge pull request #17 from tindy2013/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
tindy2013 authored Aug 29, 2019
2 parents 616ea75 + ec4e239 commit c0b0654
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 7 deletions.
3 changes: 2 additions & 1 deletion build.macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ c++ -I/usr/local/include -I/usr/local/opt/[email protected]/include -Wall -fexceptions
c++ -I/usr/local/include -I/usr/local/opt/[email protected]/include -Wall -fexceptions -D_MACOS -DCURL_STATICLIB -g -std=c++11 -c multithread-test.cpp -o obj/multithread-test.o
c++ -I/usr/local/include -I/usr/local/opt/[email protected]/include -Wall -fexceptions -D_MACOS -DCURL_STATICLIB -g -std=c++11 -c printout.cpp -o obj/printout.o
c++ -I/usr/local/include -I/usr/local/opt/[email protected]/include -Wall -fexceptions -D_MACOS -DCURL_STATICLIB -g -std=c++11 -c processes.cpp -o obj/processes.o
c++ -I/usr/local/include -I/usr/local/opt/[email protected]/include -Wall -fexceptions -D_MACOS -DCURL_STATICLIB -g -std=c++11 -c rapidjson_extra.cpp -o obj/rapidjson_extra.o
c++ -I/usr/local/include -I/usr/local/opt/[email protected]/include -I/usr/local/include/freetype2 -Wall -fexceptions -D_MACOS -DCURL_STATICLIB -g -std=c++11 -c renderer.cpp -o obj/renderer.o
c++ -I/usr/local/include -I/usr/local/opt/[email protected]/include -Wall -fexceptions -D_MACOS -DCURL_STATICLIB -g -std=c++11 -c rulematch.cpp -o obj/rulematch.o
c++ -I/usr/local/include -I/usr/local/opt/[email protected]/include -Wall -fexceptions -D_MACOS -DCURL_STATICLIB -g -std=c++11 -c socket.cpp -o obj/socket.o
c++ -I/usr/local/include -I/usr/local/opt/[email protected]/include -Wall -fexceptions -D_MACOS -DCURL_STATICLIB -g -std=c++11 -c speedtestutil.cpp -o obj/speedtestutil.o
c++ -I/usr/local/include -I/usr/local/opt/[email protected]/include -Wall -fexceptions -D_MACOS -DCURL_STATICLIB -g -std=c++11 -c tcping.cpp -o obj/tcping.o
c++ -I/usr/local/include -I/usr/local/opt/[email protected]/include -Wall -fexceptions -D_MACOS -DCURL_STATICLIB -g -std=c++11 -c webget.cpp -o obj/webget.o
c++ -g -o stairspeedtest obj/geoip.o obj/logger.o obj/main.o obj/misc.o obj/multithread-test.o obj/printout.o obj/processes.o obj/renderer.o obj/rulematch.o obj/socket.o obj/speedtestutil.o obj/tcping.o obj/webget.o -L/usr/local/opt/[email protected]/lib -lcurl -lPNGwriter -lpng -lfreetype -lz -lssl -lcrypto -lyaml-cpp -ldl -lpthread
c++ -g -o stairspeedtest obj/geoip.o obj/logger.o obj/main.o obj/misc.o obj/multithread-test.o obj/printout.o obj/processes.o obj/rapidjson_extra.o obj/renderer.o obj/rulematch.o obj/socket.o obj/speedtestutil.o obj/tcping.o obj/webget.o -L/usr/local/opt/[email protected]/lib -lcurl -lPNGwriter -lpng -lfreetype -lz -lssl -lcrypto -lyaml-cpp -ldl -lpthread
chmod +x stairspeedtest

5 changes: 3 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c misc.cpp -o obj/misc
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c multithread-test.cpp -o obj/multithread-test.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c printout.cpp -o obj/printout.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c processes.cpp -o obj/processes.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c renderer.cpp -o obj/renderer.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c rapidjson_extra.cpp -o obj/rapidjson_extra.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -I/usr/local/include/freetype2 -I/usr/include/freetype2 -std=c++11 -c renderer.cpp -o obj/renderer.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c rulematch.cpp -o obj/rulematch.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c socket.cpp -o obj/socket.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c speedtestutil.cpp -o obj/speedtestutil.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c tcping.cpp -o obj/tcping.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c webget.cpp -o obj/webget.o
g++ -g -o stairspeedtest obj/geoip.o obj/logger.o obj/main.o obj/misc.o obj/multithread-test.o obj/printout.o obj/processes.o obj/renderer.o obj/rulematch.o obj/socket.o obj/speedtestutil.o obj/tcping.o obj/webget.o -lcurl -lPNGwriter -lpng16 -lfreetype -lz -lssl -lcrypto -ldl -lpthread -lyaml-cpp -s
g++ -g -o stairspeedtest obj/geoip.o obj/logger.o obj/main.o obj/misc.o obj/multithread-test.o obj/printout.o obj/processes.o obj/rapidjson_extra.o obj/renderer.o obj/rulematch.o obj/socket.o obj/speedtestutil.o obj/tcping.o obj/webget.o -lcurl -lPNGwriter -lpng16 -lfreetype -lz -lssl -lcrypto -ldl -lpthread -lyaml-cpp -s
chmod +x stairspeedtest

21 changes: 21 additions & 0 deletions build.static.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
mkdir obj
mkdir bin
set -e
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c geoip.cpp -o obj/geoip.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c logger.cpp -o obj/logger.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c main.cpp -o obj/main.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c misc.cpp -o obj/misc.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c multithread-test.cpp -o obj/multithread-test.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c printout.cpp -o obj/printout.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c processes.cpp -o obj/processes.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c rapidjson_extra.cpp -o obj/rapidjson_extra.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -I/usr/local/include/freetype2 -I/usr/include/freetype2 -std=c++11 -c renderer.cpp -o obj/renderer.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c rulematch.cpp -o obj/rulematch.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c socket.cpp -o obj/socket.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c speedtestutil.cpp -o obj/speedtestutil.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c tcping.cpp -o obj/tcping.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c webget.cpp -o obj/webget.o
g++ -g -o stairspeedtest obj/geoip.o obj/logger.o obj/main.o obj/misc.o obj/multithread-test.o obj/printout.o obj/processes.o obj/rapidjson_extra.o obj/renderer.o obj/rulematch.o obj/socket.o obj/speedtestutil.o obj/tcping.o obj/webget.o -lcurl -lPNGwriter -lpng16 -lfreetype -lz -lssl -lcrypto -ldl -lpthread -lyaml-cpp -s -static
chmod +x stairspeedtest

12 changes: 12 additions & 0 deletions config.alpine.shared.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -e

apk add gcc g++ cmake make

apk add libpng-dev curl-dev freetype-dev zlib-dev openssl rapidjson-dev yaml-cpp-dev

git clone https://github.com/pngwriter/pngwriter
cd pngwriter
cmake .
make install -j4
cd ..
25 changes: 25 additions & 0 deletions config.alpine.static.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
set -e

apk add gcc g++ cmake make autoconf automake libtool

apk add libpng-dev libressl-dev freetype-dev freetype-static zlib-dev openssl rapidjson-dev

git clone https://github.com/curl/curl
cd curl
./buildconf
./configure
make install -j4
cd ..

git clone https://github.com/jbeder/yaml-cpp
cd yaml-cpp
cmake .
make install -j4
cd ..

git clone https://github.com/pngwriter/pngwriter
cd pngwriter
cmake .
make install -j4
cd ..
6 changes: 4 additions & 2 deletions socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
#define SOCKADDR_IN sockaddr_in
#define ZeroMemory(d,l) memset((d), 0, (l))
#define ioctlsocket ioctl
#ifdef _MACOS
#ifndef SA_INTERRUPT
#define SA_INTERRUPT 0 //ignore this setting
#endif
#ifndef MSG_NOSIGNAL
#define MSG_NOSIGNAL 0 //ignore this setting
#endif // _MACOS
#endif
#ifndef __hpux
#include <sys/select.h>
#endif /* __hpux */
Expand Down
8 changes: 7 additions & 1 deletion tcping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@ int tcping(nodeInfo *node)
draw_progress(loopcounter, node->rawPing);
loopcounter++;
if(loopcounter < times_to_ping)
sleep(1000);
{
if(retVal != 1)
sleep(1000); //passed, sleep longer
else
sleep(200); //not passed, sleep shorter
}

}
cerr<<endl;
float pingval = 0.0;
Expand Down
2 changes: 1 addition & 1 deletion version.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef VERSION_H_INCLUDED
#define VERSION_H_INCLUDED

#define VERSION "v0.2.14-beta"
#define VERSION "v0.2.15-beta"

#endif // VERSION_H_INCLUDED

0 comments on commit c0b0654

Please sign in to comment.