diff options
-rw-r--r-- | src/Makefile | 16 | ||||
-rwxr-xr-x | src/configure | 9 | ||||
-rw-r--r-- | src/endian.h | 2 | ||||
-rw-r--r-- | src/win32/sysExec.hpp | 4 |
4 files changed, 22 insertions, 9 deletions
diff --git a/src/Makefile b/src/Makefile index 34863b8..b402912 100644 --- a/src/Makefile +++ b/src/Makefile @@ -34,9 +34,7 @@ ifneq ($(MAKECMDGOALS),distclean) include include.mk endif - -ANYTUNOBJS := tunDevice.o \ - packetSource.o \ +ANYTUNOBJS := packetSource.o \ authAlgo.o \ authAlgoFactory.o \ cipher.o \ @@ -45,7 +43,6 @@ ANYTUNOBJS := tunDevice.o \ encryptedPacket.o \ options.o \ signalController.o \ - daemonService.o \ sysExec.o \ resolver.o \ buffer.o \ @@ -63,6 +60,17 @@ ANYTUNOBJS := tunDevice.o \ anytunError.o \ seqWindow.o +ifneq ($(TARGET),mingw) +ANYTUNOBJS := $(ANYTUNOBJS) \ + tunDevice.o \ + daemonService.o +else +ANYTUNOBJS := $(ANYTUNOBJS) \ + win32/tunDevice.o \ + win32/winService.o \ + win32/registryKey.o +endif + ANYSHOWOBJS := buffer.o \ syncBuffer.o \ keyDerivation.o \ diff --git a/src/configure b/src/configure index 4501704..28b5fe5 100755 --- a/src/configure +++ b/src/configure @@ -35,7 +35,7 @@ TARGET=`uname -s` EBUILD_COMPAT=0 -CXXFLAGS='-g -Wall -O2 -DLOG_SYSLOG -DLOG_FILE -DLOG_STDOUT' +CXXFLAGS='-g -Wall -O2' LDFLAGS='-g -Wall -O2 -lboost_thread -lboost_serialization -lboost_system -lboost_date_time' CROSS_PREFIX='' @@ -177,6 +177,7 @@ case $TARGET in ln -sf posix/posixDaemon.cpp daemonService.cpp echo "loading Linux specific TUN Device" LDFLAGS=$LDFLAGS' -lpthread' + LOG_TARGETS='-DLOG_SYSLOG -DLOG_FILE -DLOG_STDOUT' ;; OpenBSD|FreeBSD|NetBSD|GNU/kFreeBSD) rm -f tunDevice.cpp @@ -191,6 +192,7 @@ case $TARGET in echo "loading BSD specific TUN Device" CXXFLAGS=$CXXFLAGS' -I/usr/local/include' LDFLAGS=$LDFLAGS' -L/usr/local/lib -lpthread' + LOG_TARGETS='-DLOG_SYSLOG -DLOG_FILE -DLOG_STDOUT' ;; mingw) rm -f tunDevice.cpp @@ -198,8 +200,9 @@ case $TARGET in rm -f sysExec.hpp rm -f daemonService.h daemonService.cpp echo "loading Windows specific TUN Device" - CXXFLAGS=$CXXFLAGS' -DMINGW' + CXXFLAGS=$CXXFLAGS' -DMINGW -D_WIN32_WINNT=0x0501 -DWIN32_LEAN_AND_MEAN -DBOOST_WINDOWS' LDFLAGS=$LDFLAGS' -static' + LOG_TARGETS='-DWIN_EVENTLOG -DLOG_FILE -DLOG_STDOUT' ;; *) echo "platform not supported" @@ -207,6 +210,8 @@ case $TARGET in ;; esac +CXXFLAGS="$CXXFLAGS $LOG_TARGETS" + if [ -n "$BOOST_PREFIX" ]; then CXXFLAGS="$CXXFLAGS -I\"$BOOST_PREFIX/include\"" LDFLAGS="$LDFLAGS -L\"$BOOST_PREFIX/lib\"" diff --git a/src/endian.h b/src/endian.h index 498db4d..a701750 100644 --- a/src/endian.h +++ b/src/endian.h @@ -36,7 +36,7 @@ #ifndef _WIN32 #include <arpa/inet.h> #else -#include <Winsock2.h> +#include <winsock2.h> #endif #define SEQ_NR_T_NTOH(a) ntohl(a) diff --git a/src/win32/sysExec.hpp b/src/win32/sysExec.hpp index 3807a63..0fe10f3 100644 --- a/src/win32/sysExec.hpp +++ b/src/win32/sysExec.hpp @@ -69,7 +69,7 @@ bool endsWith(std::string const& string, std::string const& suffix) return string.find(suffix, string.size() - suffix.size()) != std::string::npos; } -void SysExec::doExec(StringVector args, StringList env) +void SysExec::doExec(StringVector args, StringList env_param) { std::vector<char> arguments; @@ -105,7 +105,7 @@ void SysExec::doExec(StringVector args, StringList env) STARTUPINFOA startup_info = getStartupInfo(); std::map<std::string, std::string> envDict; - for(StringList::const_iterator it = env.begin(); it != env.begin(); ++it) { + for(StringList::const_iterator it = env_param.begin(); it != env_param.begin(); ++it) { size_t delimiter_pos = it->find('='); envDict.insert(std::make_pair(it->substr(0, delimiter_pos), it->substr(delimiter_pos + 1))); } |