diff --git a/LICENSE b/LICENSE index 2cb10225..9a1e4527 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2013-2015, The PurpleI2P Project +Copyright (c) 2013-2020, The PurpleI2P Project All rights reserved. diff --git a/Makefile b/Makefile index 7bb3ceda..3e0b23cf 100644 --- a/Makefile +++ b/Makefile @@ -54,7 +54,7 @@ NEEDED_CXXFLAGS += -MMD -MP -I$(LIB_SRC_DIR) -I$(LIB_CLIENT_SRC_DIR) LIB_OBJS += $(patsubst %.cpp,obj/%.o,$(LIB_SRC)) LIB_CLIENT_OBJS += $(patsubst %.cpp,obj/%.o,$(LIB_CLIENT_SRC)) DAEMON_OBJS += $(patsubst %.cpp,obj/%.o,$(DAEMON_SRC)) -DEPS := $(LIB_OBJS:.o=.d) $(LIB_CLIENT_OBJS:.o=.d) $(DAEMON_OBJS:.o=.d) +DEPS += $(LIB_OBJS:.o=.d) $(LIB_CLIENT_OBJS:.o=.d) $(DAEMON_OBJS:.o=.d) all: mk_obj_dir $(ARLIB) $(ARLIB_CLIENT) $(I2PD) @@ -82,7 +82,7 @@ obj/%.o: %.cpp -include $(DEPS) $(I2PD): $(DAEMON_OBJS) $(ARLIB) $(ARLIB_CLIENT) - $(CXX) -o $@ $^ $(LDFLAGS) $(LDLIBS) + $(CXX) -o $@ $(LDFLAGS) $^ $(LDLIBS) $(SHLIB): $(LIB_OBJS) ifneq ($(USE_STATIC),yes) @@ -130,3 +130,4 @@ doxygen: .PHONY: api_client .PHONY: mk_obj_dir .PHONY: install +.PHONY: strip diff --git a/Makefile.linux b/Makefile.linux index 6a7590c1..ee6a902b 100644 --- a/Makefile.linux +++ b/Makefile.linux @@ -33,7 +33,7 @@ ifeq ($(USE_STATIC),yes) # NOTE: on glibc you will get this warning: # Using 'getaddrinfo' in statically linked applications requires at runtime # the shared libraries from the glibc version used for linking - LIBDIR := /usr/lib + LIBDIR := /usr/lib/$(SYS) LDLIBS += $(LIBDIR)/libboost_system.a LDLIBS += $(LIBDIR)/libboost_date_time.a LDLIBS += $(LIBDIR)/libboost_filesystem.a @@ -41,20 +41,20 @@ ifeq ($(USE_STATIC),yes) LDLIBS += $(LIBDIR)/libssl.a LDLIBS += $(LIBDIR)/libcrypto.a LDLIBS += $(LIBDIR)/libz.a - LDLIBS += -lpthread -static-libstdc++ -static-libgcc -lrt -ldl - USE_AESNI := no +ifeq ($(USE_UPNP),yes) + LDLIBS += $(LIBDIR)/libminiupnpc.a +endif + LDLIBS += -lpthread -ldl else LDLIBS += -lcrypto -lssl -lz -lboost_system -lboost_date_time -lboost_filesystem -lboost_program_options -lpthread +ifeq ($(USE_UPNP),yes) + LDLIBS += -lminiupnpc +endif endif # UPNP Support (miniupnpc 1.5 and higher) ifeq ($(USE_UPNP),yes) NEEDED_CXXFLAGS += -DUSE_UPNP -ifeq ($(USE_STATIC),yes) - LDLIBS += $(LIBDIR)/libminiupnpc.a -else - LDLIBS += -lminiupnpc -endif endif ifeq ($(USE_AESNI),yes) diff --git a/Makefile.mingw b/Makefile.mingw index 4cd2c292..ce1966a1 100644 --- a/Makefile.mingw +++ b/Makefile.mingw @@ -1,9 +1,11 @@ -USE_WIN32_APP=yes -CXX = g++ +# Build application with GUI (tray, main window) +USE_WIN32_APP := yes + WINDRES = windres -CXXFLAGS := $(CXX_DEBUG) -D_MT -DWIN32 -D_WINDOWS -DWIN32_LEAN_AND_MEAN -fPIC -msse + +CXXFLAGS := $(CXX_DEBUG) -D_MT -DWIN32_LEAN_AND_MEAN -fPIC -msse INCFLAGS = -I$(DAEMON_SRC_DIR) -IWin32 -LDFLAGS := ${LD_DEBUG} -Wl,-Bstatic -static-libgcc -static-libstdc++ +LDFLAGS := ${LD_DEBUG} -Wl,-Bstatic -static-libgcc # detect proper flag for c++11 support by compilers CXXVER := $(shell $(CXX) -dumpversion) @@ -38,7 +40,6 @@ LDLIBS += \ -liphlpapi \ -lole32 \ -luuid \ - -lstdc++ \ -lpthread ifeq ($(USE_WIN32_APP), yes) diff --git a/Win32/Resource.rc2 b/Win32/Resource.rc2 index 6a4f481d..9eecbc1f 100644 --- a/Win32/Resource.rc2 +++ b/Win32/Resource.rc2 @@ -25,7 +25,7 @@ BEGIN VALUE "FileDescription", "C++ I2P daemon" VALUE "FileVersion", I2PD_VERSION VALUE "InternalName", CODENAME - VALUE "LegalCopyright", "Copyright (C) 2013-2017, The PurpleI2P Project" + VALUE "LegalCopyright", "Copyright (C) 2013-2020, The PurpleI2P Project" VALUE "OriginalFilename", "i2pd" VALUE "ProductName", "Purple I2P" VALUE "ProductVersion", I2P_VERSION diff --git a/build/build_mingw.cmd b/build/build_mingw.cmd index e791039e..aaf25843 100644 --- a/build/build_mingw.cmd +++ b/build/build_mingw.cmd @@ -2,7 +2,7 @@ setlocal enableextensions enabledelayedexpansion title Building i2pd -REM Copyright (c) 2013-2017, The PurpleI2P Project +REM Copyright (c) 2013-2020, The PurpleI2P Project REM This file is part of Purple i2pd project and licensed under BSD3 REM See full license text in LICENSE file at top of project tree diff --git a/contrib/android_binary_pack/build-archive b/contrib/android_binary_pack/build-archive index bb56cace..c439dd7f 100755 --- a/contrib/android_binary_pack/build-archive +++ b/contrib/android_binary_pack/build-archive @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (c) 2013-2017, The PurpleI2P Project +# Copyright (c) 2013-2020, The PurpleI2P Project # # This file is part of Purple i2pd project and licensed under BSD3 # diff --git a/contrib/android_binary_pack/i2pd b/contrib/android_binary_pack/i2pd index aeaae804..c31cb4ad 100755 --- a/contrib/android_binary_pack/i2pd +++ b/contrib/android_binary_pack/i2pd @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (c) 2013-2019, The PurpleI2P Project +# Copyright (c) 2013-2020, The PurpleI2P Project # # This file is part of Purple i2pd project and licensed under BSD3 # @@ -21,13 +21,13 @@ arch=$(uname -m) screenfind=$(which screen) if [ -z $screenfind ]; then - echo "Can't find 'screen' installed. That script needs it!"; - exit 1; + echo "Can't find 'screen' installed. That script needs it!"; + exit 1; fi if [ -z i2pd-$arch ]; then - echo "Can't find i2pd binary for your archtecture."; - exit 1; + echo "Can't find i2pd binary for your archtecture."; + exit 1; fi screen -AmdS i2pd ./i2pd-$arch --datadir=$DIR diff --git a/libi2pd/FS.cpp b/libi2pd/FS.cpp index 32fc3ec0..bd1a7ad2 100644 --- a/libi2pd/FS.cpp +++ b/libi2pd/FS.cpp @@ -46,13 +46,13 @@ namespace fs { dataDir = cmdline_param; return; } -#if defined(WIN32) || defined(_WIN32) +#ifdef _WIN32 char localAppData[MAX_PATH]; // check executable directory first if(!GetModuleFileName(NULL, localAppData, MAX_PATH)) { -#if defined(WIN32_APP) +#ifdef WIN32_APP MessageBox(NULL, TEXT("Unable to get application path!"), TEXT("I2Pd: error"), MB_ICONERROR | MB_OK); #else fprintf(stderr, "Error: Unable to get application path!"); @@ -70,7 +70,7 @@ namespace fs { { if(SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0, localAppData) != S_OK) { -#if defined(WIN32_APP) +#ifdef WIN32_APP MessageBox(NULL, TEXT("Unable to get AppData path!"), TEXT("I2Pd: error"), MB_ICONERROR | MB_OK); #else fprintf(stderr, "Error: Unable to get AppData path!"); diff --git a/libi2pd/Timestamp.cpp b/libi2pd/Timestamp.cpp index 45684333..0490350e 100644 --- a/libi2pd/Timestamp.cpp +++ b/libi2pd/Timestamp.cpp @@ -19,7 +19,7 @@ #include "I2PEndian.h" #include "Timestamp.h" -#ifdef WIN32 +#ifdef _WIN32 #ifndef _WIN64 #define _USE_32BIT_TIME_T #endif diff --git a/libi2pd/util.cpp b/libi2pd/util.cpp index 2cc101c7..24814ad3 100644 --- a/libi2pd/util.cpp +++ b/libi2pd/util.cpp @@ -13,7 +13,7 @@ #include "util.h" #include "Log.h" -#ifdef WIN32 +#ifdef _WIN32 #include #include #include @@ -56,7 +56,7 @@ int inet_pton_xp(int af, const char *src, void *dst) } return 0; } -#else /* !WIN32 => UNIX */ +#else /* !_WIN32 => UNIX */ #include #include #endif @@ -109,7 +109,7 @@ namespace util namespace net { -#ifdef WIN32 +#ifdef _WIN32 bool IsWindowsXPorLater() { static bool isRequested = false; @@ -333,13 +333,13 @@ namespace net return mtu; } -#endif // WIN32 +#endif // _WIN32 int GetMTU(const boost::asio::ip::address& localAddress) { int fallback = localAddress.is_v6 () ? 1280 : 620; // fallback MTU -#ifdef WIN32 +#ifdef _WIN32 return GetMTUWindows(localAddress, fallback); #else return GetMTUUnix(localAddress, fallback); @@ -349,7 +349,7 @@ namespace net const boost::asio::ip::address GetInterfaceAddress(const std::string & ifname, bool ipv6) { -#ifdef WIN32 +#ifdef _WIN32 LogPrint(eLogError, "NetIface: cannot get address by interface name, not implemented on WIN32"); if(ipv6) return boost::asio::ip::address::from_string("::1"); diff --git a/qt/i2pd_qt/i2pd.rc b/qt/i2pd_qt/i2pd.rc index bebdf1d6..d31e591e 100644 --- a/qt/i2pd_qt/i2pd.rc +++ b/qt/i2pd_qt/i2pd.rc @@ -17,7 +17,7 @@ BEGIN VALUE "FileDescription", "I2Pd Qt" VALUE "FileVersion", I2PD_VERSION VALUE "InternalName", "i2pd-qt" - VALUE "LegalCopyright", "Copyright (C) 2013-2018, The PurpleI2P Project" + VALUE "LegalCopyright", "Copyright (C) 2013-2020, The PurpleI2P Project" VALUE "LegalTrademarks1", "Distributed under the BSD 3-Clause software license, see the accompanying file COPYING or https://opensource.org/licenses/BSD-3-Clause." VALUE "OriginalFilename", "i2pd_qt.exe" VALUE "ProductName", "i2pd-qt"