Browse Source

restructure build to separate the 3 main components into 3 subdirectories

libi2pd for core libs

libi2pd_client for i2pd client libs

daemon for i2pd daemon libs
pull/858/head
Jeff Becker 8 years ago
parent
commit
4cc3b7f9fb
  1. 8
      .gitignore
  2. 20
      Makefile
  3. 0
      Win32/DaemonWin32.cpp
  4. 2
      Win32/Resource.rc2
  5. 1
      android/build.xml
  6. 62
      android/jni/Android.mk
  7. 9
      android/jni/Application.mk
  8. 3
      android/jni/DaemonAndroid.cpp
  9. 4
      android/jni/i2pd_android.cpp
  10. 146
      build/CMakeLists.txt
  11. 0
      daemon/Daemon.cpp
  12. 0
      daemon/Daemon.h
  13. 0
      daemon/HTTPServer.cpp
  14. 0
      daemon/HTTPServer.h
  15. 0
      daemon/I2PControl.cpp
  16. 0
      daemon/I2PControl.h
  17. 0
      daemon/UPnP.cpp
  18. 0
      daemon/UPnP.h
  19. 0
      daemon/UnixDaemon.cpp
  20. 0
      daemon/i2pd.cpp
  21. 32
      filelist.mk
  22. 0
      libi2pd/Base.cpp
  23. 0
      libi2pd/Base.h
  24. 0
      libi2pd/BloomFilter.cpp
  25. 0
      libi2pd/BloomFilter.h
  26. 0
      libi2pd/Config.cpp
  27. 0
      libi2pd/Config.h
  28. 0
      libi2pd/Crypto.cpp
  29. 0
      libi2pd/Crypto.h
  30. 0
      libi2pd/Datagram.cpp
  31. 0
      libi2pd/Datagram.h
  32. 0
      libi2pd/Destination.cpp
  33. 0
      libi2pd/Destination.h
  34. 0
      libi2pd/Event.cpp
  35. 0
      libi2pd/Event.h
  36. 0
      libi2pd/FS.cpp
  37. 0
      libi2pd/FS.h
  38. 0
      libi2pd/Family.cpp
  39. 0
      libi2pd/Family.h
  40. 0
      libi2pd/Garlic.cpp
  41. 0
      libi2pd/Garlic.h
  42. 0
      libi2pd/Gost.cpp
  43. 0
      libi2pd/Gost.h
  44. 0
      libi2pd/Gzip.cpp
  45. 0
      libi2pd/Gzip.h
  46. 0
      libi2pd/HTTP.cpp
  47. 0
      libi2pd/HTTP.h
  48. 0
      libi2pd/I2NPProtocol.cpp
  49. 0
      libi2pd/I2NPProtocol.h
  50. 0
      libi2pd/I2PEndian.cpp
  51. 0
      libi2pd/I2PEndian.h
  52. 0
      libi2pd/Identity.cpp
  53. 0
      libi2pd/Identity.h
  54. 0
      libi2pd/LeaseSet.cpp
  55. 0
      libi2pd/LeaseSet.h
  56. 0
      libi2pd/LittleBigEndian.h
  57. 0
      libi2pd/Log.cpp
  58. 0
      libi2pd/Log.h
  59. 0
      libi2pd/NTCPSession.cpp
  60. 0
      libi2pd/NTCPSession.h
  61. 0
      libi2pd/NetDb.cpp
  62. 0
      libi2pd/NetDb.h
  63. 0
      libi2pd/NetDbRequests.cpp
  64. 0
      libi2pd/NetDbRequests.h
  65. 0
      libi2pd/Profiling.cpp
  66. 0
      libi2pd/Profiling.h
  67. 0
      libi2pd/Queue.h
  68. 0
      libi2pd/Reseed.cpp
  69. 0
      libi2pd/Reseed.h
  70. 0
      libi2pd/RouterContext.cpp
  71. 0
      libi2pd/RouterContext.h
  72. 0
      libi2pd/RouterInfo.cpp
  73. 0
      libi2pd/RouterInfo.h
  74. 0
      libi2pd/SSU.cpp
  75. 0
      libi2pd/SSU.h
  76. 0
      libi2pd/SSUData.cpp
  77. 0
      libi2pd/SSUData.h
  78. 0
      libi2pd/SSUSession.cpp
  79. 0
      libi2pd/SSUSession.h
  80. 0
      libi2pd/Signature.cpp
  81. 0
      libi2pd/Signature.h
  82. 0
      libi2pd/Streaming.cpp
  83. 0
      libi2pd/Streaming.h
  84. 0
      libi2pd/Tag.h
  85. 0
      libi2pd/Timestamp.cpp
  86. 0
      libi2pd/Timestamp.h
  87. 0
      libi2pd/TransitTunnel.cpp
  88. 0
      libi2pd/TransitTunnel.h
  89. 0
      libi2pd/TransportSession.h
  90. 0
      libi2pd/Transports.cpp
  91. 0
      libi2pd/Transports.h
  92. 0
      libi2pd/Tunnel.cpp
  93. 0
      libi2pd/Tunnel.h
  94. 0
      libi2pd/TunnelBase.h
  95. 0
      libi2pd/TunnelConfig.h
  96. 0
      libi2pd/TunnelEndpoint.cpp
  97. 0
      libi2pd/TunnelEndpoint.h
  98. 0
      libi2pd/TunnelGateway.cpp
  99. 0
      libi2pd/TunnelGateway.h
  100. 0
      libi2pd/TunnelPool.cpp
  101. Some files were not shown because too many files have changed in this diff Show More

8
.gitignore vendored

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
# i2pd
obj/*.o
*.o
router.info
router.keys
i2p
@ -249,3 +249,9 @@ docs/generated @@ -249,3 +249,9 @@ docs/generated
# gdb files
.gdb_history
# cmake makefile
build/Makefile
# debian stuff
.pc/

20
Makefile

@ -7,6 +7,10 @@ I2PD := i2pd @@ -7,6 +7,10 @@ I2PD := i2pd
GREP := grep
DEPS := obj/make.dep
LIB_SRC_DIR := libi2pd
LIB_CLIENT_SRC_DIR := libi2pd_client
DAEMON_SRC_DIR := daemon
include filelist.mk
USE_AESNI := yes
@ -17,24 +21,23 @@ USE_UPNP := no @@ -17,24 +21,23 @@ USE_UPNP := no
ifeq ($(WEBSOCKETS),1)
NEEDED_CXXFLAGS += -DWITH_EVENTS
DAEMON_SRC += Websocket.cpp
endif
ifeq ($(UNAME),Darwin)
DAEMON_SRC += DaemonLinux.cpp
DAEMON_SRC += $(DAEMON_SRC_DIR)/UnixDaemon.cpp
ifeq ($(HOMEBREW),1)
include Makefile.homebrew
else
include Makefile.osx
endif
else ifeq ($(shell echo $(UNAME) | $(GREP) -Ec '(Free|Open)BSD'),1)
DAEMON_SRC += DaemonLinux.cpp
DAEMON_SRC += $(DAEMON_SRC_DIR)/UnixDaemon.cpp
include Makefile.bsd
else ifeq ($(UNAME),Linux)
DAEMON_SRC += DaemonLinux.cpp
DAEMON_SRC += $(DAEMON_SRC_DIR)/UnixDaemon.cpp
include Makefile.linux
else # win32 mingw
DAEMON_SRC += DaemonWin32.cpp Win32/Win32Service.cpp Win32/Win32App.cpp
else
DAEMON_SRC += Win32/DaemonWin32.cpp Win32/Win32Service.cpp Win32/Win32App.cpp
include Makefile.mingw
endif
@ -42,11 +45,16 @@ ifeq ($(USE_MESHNET),yes) @@ -42,11 +45,16 @@ ifeq ($(USE_MESHNET),yes)
NEEDED_CXXFLAGS += -DMESHNET
endif
NEEDED_CXXFLAGS += -I$(LIB_SRC_DIR) -I$(LIB_CLIENT_SRC_DIR)
all: mk_obj_dir $(ARLIB) $(ARLIB_CLIENT) $(I2PD)
mk_obj_dir:
@mkdir -p obj
@mkdir -p obj/Win32
@mkdir -p obj/$(LIB_SRC_DIR)
@mkdir -p obj/$(LIB_CLIENT_SRC_DIR)
@mkdir -p obj/$(DAEMON_SRC_DIR)
api: mk_obj_dir $(SHLIB) $(ARLIB)
api_client: mk_obj_dir $(SHLIB) $(ARLIB) $(SHLIB_CLIENT) $(ARLIB_CLIENT)

0
DaemonWin32.cpp → Win32/DaemonWin32.cpp

2
Win32/Resource.rc2

@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
#error this file is not editable by Microsoft Visual C++
#endif //APSTUDIO_INVOKED
#include "../version.h"
#include "../src/core/version.h"
/////////////////////////////////////////////////////////////////////////////
//

1
android/build.xml

@ -93,5 +93,4 @@ @@ -93,5 +93,4 @@
-->
<!-- version-tag: 1 -->
<import file="${sdk.dir}/tools/ant/build.xml" />
</project>

62
android/jni/Android.mk

@ -2,7 +2,7 @@ LOCAL_PATH := $(call my-dir) @@ -2,7 +2,7 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := i2pd
LOCAL_CPP_FEATURES := rtti exceptions
LOCAL_C_INCLUDES += $(IFADDRS_PATH) ../..
LOCAL_C_INCLUDES += $(IFADDRS_PATH) $(LIB_SRC_PATH) $(LIB_CLIENT_SRC_PATH) $(DAEMON_SRC_PATH)
LOCAL_STATIC_LIBRARIES := \
boost_system \
boost_date_time \
@ -12,59 +12,13 @@ LOCAL_STATIC_LIBRARIES := \ @@ -12,59 +12,13 @@ LOCAL_STATIC_LIBRARIES := \
miniupnpc
LOCAL_LDLIBS := -lz
LOCAL_SRC_FILES := DaemonAndroid.cpp i2pd_android.cpp \
$(IFADDRS_PATH)/ifaddrs.c \
../../HTTPServer.cpp ../../I2PControl.cpp ../../Daemon.cpp ../../Config.cpp \
../../AddressBook.cpp \
../../api.cpp \
../../Base.cpp \
../../BOB.cpp \
../../ClientContext.cpp \
../../Crypto.cpp \
../../Datagram.cpp \
../../Destination.cpp \
../../Family.cpp \
../../FS.cpp \
../../Garlic.cpp \
../../Gzip.cpp \
../../HTTP.cpp \
../../HTTPProxy.cpp \
../../I2CP.cpp \
../../I2NPProtocol.cpp \
../../I2PEndian.cpp \
../../I2PService.cpp \
../../I2PTunnel.cpp \
../../Identity.cpp \
../../LeaseSet.cpp \
../../Log.cpp \
../../NetDb.cpp \
../../NetDbRequests.cpp \
../../NTCPSession.cpp \
../../Profiling.cpp \
../../Reseed.cpp \
../../RouterContext.cpp \
../../RouterInfo.cpp \
../../SAM.cpp \
../../Signature.cpp \
../../SOCKS.cpp \
../../SSU.cpp \
../../SSUData.cpp \
../../SSUSession.cpp \
../../Streaming.cpp \
../../TransitTunnel.cpp \
../../Transports.cpp \
../../Tunnel.cpp \
../../TunnelEndpoint.cpp \
../../TunnelGateway.cpp \
../../TunnelPool.cpp \
../../Timestamp.cpp \
../../Event.cpp \
../../Gost.cpp \
../../WebSocks.cpp \
../../BloomFilter.cpp \
../../MatchedDestination.cpp \
../../util.cpp \
../../i2pd.cpp ../../UPnP.cpp
LOCAL_SRC_FILES := DaemonAndroid.cpp i2pd_android.cpp $(IFADDRS_PATH)/ifaddrs.c \
$(wildcard $(LIB_SRC_PATH)/*.cpp)\
$(wildcard $(LIB_CLIENT_SRC_PATH)/*.cpp)\
$(DAEMON_SRC_PATH)/Daemon.cpp \
$(DAEMON_SRC_PATH)/UPnP.cpp \
$(DAEMON_SRC_PATH)/HTTPServer.cpp \
$(DAEMON_SRC_PATH)/I2PControl.cpp
include $(BUILD_SHARED_LIBRARY)

9
android/jni/Application.mk

@ -25,8 +25,15 @@ APP_OPTIM := debug @@ -25,8 +25,15 @@ APP_OPTIM := debug
# git clone https://github.com/PurpleI2P/MiniUPnP-for-Android-Prebuilt.git
# git clone https://github.com/PurpleI2P/android-ifaddrs.git
# change to your own
I2PD_LIBS_PATH=/path/to/libraries
I2PD_LIBS_PATH=/tmp/i2pd
BOOST_PATH = $(I2PD_LIBS_PATH)/Boost-for-Android-Prebuilt
OPENSSL_PATH = $(I2PD_LIBS_PATH)/OpenSSL-for-Android-Prebuilt
MINIUPNP_PATH = $(I2PD_LIBS_PATH)/MiniUPnP-for-Android-Prebuilt
IFADDRS_PATH = $(I2PD_LIBS_PATH)/android-ifaddrs
# don't change me
I2PD_SRC_PATH = $(PWD)/..
LIB_SRC_PATH = $(I2PD_SRC_PATH)/libi2pd
LIB_CLIENT_SRC_PATH = $(I2PD_SRC_PATH)/libi2pd_client
DAEMON_SRC_PATH = $(I2PD_SRC_PATH)/daemon

3
android/jni/DaemonAndroid.cpp

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
#include "DaemonAndroid.h"
#include "../../Daemon.h"
#include "Daemon.h"
#include <iostream>
#include <boost/exception/diagnostic_information.hpp>
#include <boost/exception_ptr.hpp>
@ -191,4 +191,3 @@ namespace android @@ -191,4 +191,3 @@ namespace android
}
}
}

4
android/jni/i2pd_android.cpp

@ -3,8 +3,8 @@ @@ -3,8 +3,8 @@
#include <jni.h>
#include "org_purplei2p_i2pd_I2PD_JNI.h"
#include "DaemonAndroid.h"
#include "../../RouterContext.h"
#include "../../Transports.h"
#include "RouterContext.h"
#include "Transports.h"
JNIEXPORT jstring JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_getABICompiledWith
(JNIEnv * env, jclass clazz) {

146
build/CMakeLists.txt

@ -25,44 +25,51 @@ option(WITH_WEBSOCKETS "Build with websocket ui" OFF) @@ -25,44 +25,51 @@ option(WITH_WEBSOCKETS "Build with websocket ui" OFF)
set ( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules" )
set ( CMAKE_SOURCE_DIR ".." )
set(LIBI2PD_SRC_DIR ../libi2pd)
set(LIBI2PD_CLIENT_SRC_DIR ../libi2pd_client)
include_directories(${LIBI2PD_SRC_DIR})
include_directories(${LIBI2PD_CLIENT_SRC_DIR})
set (LIBI2PD_SRC
"${CMAKE_SOURCE_DIR}/BloomFilter.cpp"
"${CMAKE_SOURCE_DIR}/Config.cpp"
"${CMAKE_SOURCE_DIR}/Crypto.cpp"
"${CMAKE_SOURCE_DIR}/Garlic.cpp"
"${CMAKE_SOURCE_DIR}/Gzip.cpp"
"${CMAKE_SOURCE_DIR}/I2NPProtocol.cpp"
"${CMAKE_SOURCE_DIR}/Identity.cpp"
"${CMAKE_SOURCE_DIR}/LeaseSet.cpp"
"${CMAKE_SOURCE_DIR}/FS.cpp"
"${CMAKE_SOURCE_DIR}/Log.cpp"
"${CMAKE_SOURCE_DIR}/NTCPSession.cpp"
"${CMAKE_SOURCE_DIR}/NetDbRequests.cpp"
"${CMAKE_SOURCE_DIR}/NetDb.cpp"
"${CMAKE_SOURCE_DIR}/Profiling.cpp"
"${CMAKE_SOURCE_DIR}/Reseed.cpp"
"${CMAKE_SOURCE_DIR}/RouterContext.cpp"
"${CMAKE_SOURCE_DIR}/RouterInfo.cpp"
"${CMAKE_SOURCE_DIR}/SSU.cpp"
"${CMAKE_SOURCE_DIR}/SSUData.cpp"
"${CMAKE_SOURCE_DIR}/SSUSession.cpp"
"${CMAKE_SOURCE_DIR}/Streaming.cpp"
"${CMAKE_SOURCE_DIR}/Destination.cpp"
"${CMAKE_SOURCE_DIR}/TransitTunnel.cpp"
"${CMAKE_SOURCE_DIR}/Tunnel.cpp"
"${CMAKE_SOURCE_DIR}/TunnelGateway.cpp"
"${CMAKE_SOURCE_DIR}/Transports.cpp"
"${CMAKE_SOURCE_DIR}/TunnelEndpoint.cpp"
"${CMAKE_SOURCE_DIR}/TunnelPool.cpp"
"${CMAKE_SOURCE_DIR}/Base.cpp"
"${CMAKE_SOURCE_DIR}/util.cpp"
"${CMAKE_SOURCE_DIR}/Datagram.cpp"
"${CMAKE_SOURCE_DIR}/Family.cpp"
"${CMAKE_SOURCE_DIR}/Signature.cpp"
"${CMAKE_SOURCE_DIR}/Timestamp.cpp"
"${CMAKE_SOURCE_DIR}/api.cpp"
"${CMAKE_SOURCE_DIR}/Event.cpp"
"${CMAKE_SOURCE_DIR}/Gost.cpp"
"${LIBI2PD_SRC_DIR}/BloomFilter.cpp"
"${LIBI2PD_SRC_DIR}/Config.cpp"
"${LIBI2PD_SRC_DIR}/Crypto.cpp"
"${LIBI2PD_SRC_DIR}/Garlic.cpp"
"${LIBI2PD_SRC_DIR}/Gzip.cpp"
"${LIBI2PD_SRC_DIR}/HTTP.cpp"
"${LIBI2PD_SRC_DIR}/I2NPProtocol.cpp"
"${LIBI2PD_SRC_DIR}/Identity.cpp"
"${LIBI2PD_SRC_DIR}/LeaseSet.cpp"
"${LIBI2PD_SRC_DIR}/FS.cpp"
"${LIBI2PD_SRC_DIR}/Log.cpp"
"${LIBI2PD_SRC_DIR}/NTCPSession.cpp"
"${LIBI2PD_SRC_DIR}/NetDbRequests.cpp"
"${LIBI2PD_SRC_DIR}/NetDb.cpp"
"${LIBI2PD_SRC_DIR}/Profiling.cpp"
"${LIBI2PD_SRC_DIR}/Reseed.cpp"
"${LIBI2PD_SRC_DIR}/RouterContext.cpp"
"${LIBI2PD_SRC_DIR}/RouterInfo.cpp"
"${LIBI2PD_SRC_DIR}/SSU.cpp"
"${LIBI2PD_SRC_DIR}/SSUData.cpp"
"${LIBI2PD_SRC_DIR}/SSUSession.cpp"
"${LIBI2PD_SRC_DIR}/Streaming.cpp"
"${LIBI2PD_SRC_DIR}/Destination.cpp"
"${LIBI2PD_SRC_DIR}/TransitTunnel.cpp"
"${LIBI2PD_SRC_DIR}/Tunnel.cpp"
"${LIBI2PD_SRC_DIR}/TunnelGateway.cpp"
"${LIBI2PD_SRC_DIR}/Transports.cpp"
"${LIBI2PD_SRC_DIR}/TunnelEndpoint.cpp"
"${LIBI2PD_SRC_DIR}/TunnelPool.cpp"
"${LIBI2PD_SRC_DIR}/Base.cpp"
"${LIBI2PD_SRC_DIR}/util.cpp"
"${LIBI2PD_SRC_DIR}/Datagram.cpp"
"${LIBI2PD_SRC_DIR}/Family.cpp"
"${LIBI2PD_SRC_DIR}/Signature.cpp"
"${LIBI2PD_SRC_DIR}/Timestamp.cpp"
"${LIBI2PD_SRC_DIR}/api.cpp"
"${LIBI2PD_SRC_DIR}/Event.cpp"
"${LIBI2PD_SRC_DIR}/Gost.cpp"
)
if (WITH_WEBSOCKETS)
@ -89,31 +96,32 @@ install(TARGETS libi2pd @@ -89,31 +96,32 @@ install(TARGETS libi2pd
# install(EXPORT libi2pd DESTINATION ${CMAKE_INSTALL_LIBDIR})
set (CLIENT_SRC
"${CMAKE_SOURCE_DIR}/AddressBook.cpp"
"${CMAKE_SOURCE_DIR}/BOB.cpp"
"${CMAKE_SOURCE_DIR}/ClientContext.cpp"
"${CMAKE_SOURCE_DIR}/MatchedDestination.cpp"
"${CMAKE_SOURCE_DIR}/I2PTunnel.cpp"
"${CMAKE_SOURCE_DIR}/I2PService.cpp"
"${CMAKE_SOURCE_DIR}/SAM.cpp"
"${CMAKE_SOURCE_DIR}/SOCKS.cpp"
"${CMAKE_SOURCE_DIR}/HTTP.cpp"
"${CMAKE_SOURCE_DIR}/HTTPProxy.cpp"
"${CMAKE_SOURCE_DIR}/I2CP.cpp"
"${CMAKE_SOURCE_DIR}/WebSocks.cpp"
"${LIBI2PD_CLIENT_SRC_DIR}/AddressBook.cpp"
"${LIBI2PD_CLIENT_SRC_DIR}/BOB.cpp"
"${LIBI2PD_CLIENT_SRC_DIR}/ClientContext.cpp"
"${LIBI2PD_CLIENT_SRC_DIR}/MatchedDestination.cpp"
"${LIBI2PD_CLIENT_SRC_DIR}/I2PTunnel.cpp"
"${LIBI2PD_CLIENT_SRC_DIR}/I2PService.cpp"
"${LIBI2PD_CLIENT_SRC_DIR}/SAM.cpp"
"${LIBI2PD_CLIENT_SRC_DIR}/SOCKS.cpp"
"${LIBI2PD_CLIENT_SRC_DIR}/HTTPProxy.cpp"
"${LIBI2PD_CLIENT_SRC_DIR}/I2CP.cpp"
"${LIBI2PD_CLIENT_SRC_DIR}/WebSocks.cpp"
)
if(WITH_WEBSOCKETS)
list (APPEND CLIENT_SRC "${CMAKE_SOURCE_DIR}/Websocket.cpp")
list (APPEND CLIENT_SRC "${LIBI2PD_SRC_DIR}/Websocket.cpp")
endif ()
add_library(i2pdclient ${CLIENT_SRC})
set(DAEMON_SRC_DIR ../daemon)
set (DAEMON_SRC
"${CMAKE_SOURCE_DIR}/Daemon.cpp"
"${CMAKE_SOURCE_DIR}/HTTPServer.cpp"
"${CMAKE_SOURCE_DIR}/I2PControl.cpp"
"${CMAKE_SOURCE_DIR}/i2pd.cpp"
"${CMAKE_SOURCE_DIR}/UPnP.cpp"
"${DAEMON_SRC_DIR}/Daemon.cpp"
"${DAEMON_SRC_DIR}/HTTPServer.cpp"
"${DAEMON_SRC_DIR}/I2PControl.cpp"
"${DAEMON_SRC_DIR}/i2pd.cpp"
"${DAEMON_SRC_DIR}/UPnP.cpp"
)
if (WITH_MESHNET)
@ -178,22 +186,22 @@ endif () @@ -178,22 +186,22 @@ endif ()
# compiler flags customization (by system)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
list (APPEND DAEMON_SRC "${CMAKE_SOURCE_DIR}/DaemonLinux.cpp")
list (APPEND DAEMON_SRC "${DAEMON_SRC_DIR}/UnixDaemon.cpp")
# "'sleep_for' is not a member of 'std::this_thread'" in gcc 4.7/4.8
add_definitions( "-D_GLIBCXX_USE_NANOSLEEP=1" )
elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
list (APPEND DAEMON_SRC "${CMAKE_SOURCE_DIR}/DaemonLinux.cpp")
list (APPEND DAEMON_SRC "${DAEMON_SRC_DIR}/UnixDaemon.cpp")
# "'sleep_for' is not a member of 'std::this_thread'" in gcc 4.7/4.8
add_definitions( "-D_GLIBCXX_USE_NANOSLEEP=1" )
elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
list (APPEND DAEMON_SRC "${CMAKE_SOURCE_DIR}/DaemonLinux.cpp")
list (APPEND DAEMON_SRC "${DAEMON_SRC_DIR}/UnixDaemon.cpp")
elseif (CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
list (APPEND DAEMON_SRC "${CMAKE_SOURCE_DIR}/DaemonLinux.cpp")
list (APPEND DAEMON_SRC "${DAEMON_SRC_DIR}/UnixDaemon.cpp")
elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows" OR MSYS)
list (APPEND DAEMON_SRC "${CMAKE_SOURCE_DIR}/DaemonWin32.cpp")
list (APPEND DAEMON_SRC "${CMAKE_SOURCE_DIR}/Win32/DaemonWin32.cpp")
if (WITH_GUI)
list (APPEND DAEMON_SRC "${CMAKE_SOURCE_DIR}/Win32/Win32App.cpp")
set_source_files_properties("${CMAKE_SOURCE_DIR}/DaemonWin32.cpp"
set_source_files_properties("${CMAKE_SOURCE_DIR}/Win32/DaemonWin32.cpp"
PROPERTIES COMPILE_DEFINITIONS WIN32_APP)
endif ()
list (APPEND DAEMON_SRC "${CMAKE_SOURCE_DIR}/Win32/Win32Service.cpp")
@ -275,7 +283,7 @@ endif () @@ -275,7 +283,7 @@ endif ()
if (WITH_PCH)
include_directories(BEFORE ${CMAKE_BINARY_DIR})
add_library(stdafx STATIC "${CMAKE_SOURCE_DIR}/stdafx.cpp")
add_library(stdafx STATIC "${LIBI2PD_SRC_DIR}/stdafx.cpp")
if(MSVC)
target_compile_options(stdafx PRIVATE /Ycstdafx.h /Zm155)
add_custom_command(TARGET stdafx POST_BUILD
@ -291,10 +299,10 @@ if (WITH_PCH) @@ -291,10 +299,10 @@ if (WITH_PCH)
get_directory_property(DEFS DEFINITIONS)
string(REPLACE " " ";" FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${BTU}} ${DEFS}")
add_custom_command(TARGET stdafx PRE_BUILD
COMMAND ${CMAKE_CXX_COMPILER} ${FLAGS} -c ${CMAKE_CURRENT_SOURCE_DIR}/../stdafx.h -o ${CMAKE_BINARY_DIR}/stdafx.h.gch
COMMAND ${CMAKE_CXX_COMPILER} ${FLAGS} -c ${CMAKE_CURRENT_SOURCE_DIR}/../libi2pd/stdafx.h -o ${CMAKE_BINARY_DIR}/stdafx.h.gch
)
target_compile_options(libi2pd PRIVATE -include stdafx.h)
target_compile_options(i2pdclient PRIVATE -include stdafx.h)
target_compile_options(libi2pd PRIVATE -include libi2pd/stdafx.h)
target_compile_options(i2pdclient PRIVATE -include libi2pd/stdafx.h)
endif()
target_link_libraries(libi2pd stdafx)
endif()
@ -402,7 +410,7 @@ if (WITH_BINARY) @@ -402,7 +410,7 @@ if (WITH_BINARY)
if (MSVC)
target_compile_options("${PROJECT_NAME}" PRIVATE /FIstdafx.h /Yustdafx.h /Zm155 "/Fp${CMAKE_BINARY_DIR}/stdafx.dir/$<CONFIG>/stdafx.pch")
else()
target_compile_options("${PROJECT_NAME}" PRIVATE -include stdafx.h)
target_compile_options("${PROJECT_NAME}" PRIVATE -include src/core/stdafx.h)
endif()
endif()
@ -453,7 +461,7 @@ install(FILES "C:/projects/openssl-$ENV{OPENSSL}/LICENSE" @@ -453,7 +461,7 @@ install(FILES "C:/projects/openssl-$ENV{OPENSSL}/LICENSE"
OPTIONAL # for local builds only!
)
file(GLOB_RECURSE I2PD_SOURCES "../*.cpp" "../build" "../Win32" "../Makefile*")
file(GLOB_RECURSE I2PD_SOURCES "../libi2pd/*.cpp" "../libi2pd_client/*.cpp" "../daemon/*.cpp" "../build" "../Win32" "../Makefile*")
install(FILES ${I2PD_SOURCES} DESTINATION src/ COMPONENT Source)
# install(DIRECTORY ../ DESTINATION src/
# # OPTIONAL
@ -462,7 +470,7 @@ install(FILES ${I2PD_SOURCES} DESTINATION src/ COMPONENT Source) @@ -462,7 +470,7 @@ install(FILES ${I2PD_SOURCES} DESTINATION src/ COMPONENT Source)
# PATTERN "*.cpp"
# )
file(GLOB I2PD_HEADERS "../*.h")
file(GLOB I2PD_HEADERS "../libi2pd/*.h" "../libi2pd_client/*.h" "../daemon/*.h")
install(FILES ${I2PD_HEADERS} DESTINATION src/ COMPONENT Headers)
# install(DIRECTORY ../ DESTINATION src/
# # OPTIONAL
@ -475,7 +483,7 @@ set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Purple I2P, a C++ I2P daemon") @@ -475,7 +483,7 @@ set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Purple I2P, a C++ I2P daemon")
set(CPACK_PACKAGE_VENDOR "Purple I2P")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/../README.md")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/../LICENSE")
file(READ ../version.h version_h)
file(READ ../libi2pd/version.h version_h)
string(REGEX REPLACE ".*I2PD_VERSION_MAJOR ([0-9]+).*" "\\1" CPACK_PACKAGE_VERSION_MAJOR "${version_h}")
string(REGEX REPLACE ".*I2PD_VERSION_MINOR ([0-9]+).*" "\\1" CPACK_PACKAGE_VERSION_MINOR "${version_h}")
string(REGEX REPLACE ".*I2PD_VERSION_MICRO ([0-9]+).*" "\\1" CPACK_PACKAGE_VERSION_MICRO "${version_h}")

0
Daemon.cpp → daemon/Daemon.cpp

0
Daemon.h → daemon/Daemon.h

0
HTTPServer.cpp → daemon/HTTPServer.cpp

0
HTTPServer.h → daemon/HTTPServer.h

0
I2PControl.cpp → daemon/I2PControl.cpp

0
I2PControl.h → daemon/I2PControl.h

0
UPnP.cpp → daemon/UPnP.cpp

0
UPnP.h → daemon/UPnP.h

0
DaemonLinux.cpp → daemon/UnixDaemon.cpp

0
i2pd.cpp → daemon/i2pd.cpp

32
filelist.mk

@ -1,16 +1,22 @@ @@ -1,16 +1,22 @@
LIB_SRC = \
BloomFilter.cpp Gzip.cpp Crypto.cpp Datagram.cpp Garlic.cpp I2NPProtocol.cpp LeaseSet.cpp \
Log.cpp NTCPSession.cpp NetDb.cpp NetDbRequests.cpp Profiling.cpp \
Reseed.cpp RouterContext.cpp RouterInfo.cpp Signature.cpp SSU.cpp \
SSUSession.cpp SSUData.cpp Streaming.cpp Identity.cpp TransitTunnel.cpp \
Transports.cpp Tunnel.cpp TunnelEndpoint.cpp TunnelPool.cpp TunnelGateway.cpp \
Destination.cpp Base.cpp I2PEndian.cpp FS.cpp Config.cpp Family.cpp \
Config.cpp HTTP.cpp Timestamp.cpp util.cpp api.cpp Event.cpp Gost.cpp
#LIB_SRC = \
# BloomFilter.cpp Gzip.cpp Crypto.cpp Datagram.cpp Garlic.cpp I2NPProtocol.cpp LeaseSet.cpp \
# Log.cpp NTCPSession.cpp NetDb.cpp NetDbRequests.cpp Profiling.cpp \
# Reseed.cpp RouterContext.cpp RouterInfo.cpp Signature.cpp SSU.cpp \
# SSUSession.cpp SSUData.cpp Streaming.cpp Identity.cpp TransitTunnel.cpp \
# Transports.cpp Tunnel.cpp TunnelEndpoint.cpp TunnelPool.cpp TunnelGateway.cpp \
# Destination.cpp Base.cpp I2PEndian.cpp FS.cpp Config.cpp Family.cpp \
# Config.cpp HTTP.cpp Timestamp.cpp util.cpp api.cpp Event.cpp Gost.cpp
LIB_CLIENT_SRC = \
AddressBook.cpp BOB.cpp ClientContext.cpp I2PTunnel.cpp I2PService.cpp MatchedDestination.cpp \
SAM.cpp SOCKS.cpp HTTPProxy.cpp I2CP.cpp WebSocks.cpp
LIB_SRC = $(wildcard $(LIB_SRC_DIR)/*.cpp)
#LIB_CLIENT_SRC = \
# AddressBook.cpp BOB.cpp ClientContext.cpp I2PTunnel.cpp I2PService.cpp MatchedDestination.cpp \
# SAM.cpp SOCKS.cpp HTTPProxy.cpp I2CP.cpp WebSocks.cpp
LIB_CLIENT_SRC = $(wildcard $(LIB_CLIENT_SRC_DIR)/*.cpp)
# also: Daemon{Linux,Win32}.cpp will be added later
DAEMON_SRC = \
HTTPServer.cpp I2PControl.cpp UPnP.cpp Daemon.cpp i2pd.cpp
#DAEMON_SRC = \
# HTTPServer.cpp I2PControl.cpp UPnP.cpp Daemon.cpp i2pd.cpp
DAEMON_SRC = $(wildcard $(DAEMON_SRC_DIR)/*.cpp)

0
Base.cpp → libi2pd/Base.cpp

0
Base.h → libi2pd/Base.h

0
BloomFilter.cpp → libi2pd/BloomFilter.cpp

0
BloomFilter.h → libi2pd/BloomFilter.h

0
Config.cpp → libi2pd/Config.cpp

0
Config.h → libi2pd/Config.h

0
Crypto.cpp → libi2pd/Crypto.cpp

0
Crypto.h → libi2pd/Crypto.h

0
Datagram.cpp → libi2pd/Datagram.cpp

0
Datagram.h → libi2pd/Datagram.h

0
Destination.cpp → libi2pd/Destination.cpp

0
Destination.h → libi2pd/Destination.h

0
Event.cpp → libi2pd/Event.cpp

0
Event.h → libi2pd/Event.h

0
FS.cpp → libi2pd/FS.cpp

0
FS.h → libi2pd/FS.h

0
Family.cpp → libi2pd/Family.cpp

0
Family.h → libi2pd/Family.h

0
Garlic.cpp → libi2pd/Garlic.cpp

0
Garlic.h → libi2pd/Garlic.h

0
Gost.cpp → libi2pd/Gost.cpp

0
Gost.h → libi2pd/Gost.h

0
Gzip.cpp → libi2pd/Gzip.cpp

0
Gzip.h → libi2pd/Gzip.h

0
HTTP.cpp → libi2pd/HTTP.cpp

0
HTTP.h → libi2pd/HTTP.h

0
I2NPProtocol.cpp → libi2pd/I2NPProtocol.cpp

0
I2NPProtocol.h → libi2pd/I2NPProtocol.h

0
I2PEndian.cpp → libi2pd/I2PEndian.cpp

0
I2PEndian.h → libi2pd/I2PEndian.h

0
Identity.cpp → libi2pd/Identity.cpp

0
Identity.h → libi2pd/Identity.h

0
LeaseSet.cpp → libi2pd/LeaseSet.cpp

0
LeaseSet.h → libi2pd/LeaseSet.h

0
LittleBigEndian.h → libi2pd/LittleBigEndian.h

0
Log.cpp → libi2pd/Log.cpp

0
Log.h → libi2pd/Log.h

0
NTCPSession.cpp → libi2pd/NTCPSession.cpp

0
NTCPSession.h → libi2pd/NTCPSession.h

0
NetDb.cpp → libi2pd/NetDb.cpp

0
NetDb.h → libi2pd/NetDb.h

0
NetDbRequests.cpp → libi2pd/NetDbRequests.cpp

0
NetDbRequests.h → libi2pd/NetDbRequests.h

0
Profiling.cpp → libi2pd/Profiling.cpp

0
Profiling.h → libi2pd/Profiling.h

0
Queue.h → libi2pd/Queue.h

0
Reseed.cpp → libi2pd/Reseed.cpp

0
Reseed.h → libi2pd/Reseed.h

0
RouterContext.cpp → libi2pd/RouterContext.cpp

0
RouterContext.h → libi2pd/RouterContext.h

0
RouterInfo.cpp → libi2pd/RouterInfo.cpp

0
RouterInfo.h → libi2pd/RouterInfo.h

0
SSU.cpp → libi2pd/SSU.cpp

0
SSU.h → libi2pd/SSU.h

0
SSUData.cpp → libi2pd/SSUData.cpp

0
SSUData.h → libi2pd/SSUData.h

0
SSUSession.cpp → libi2pd/SSUSession.cpp

0
SSUSession.h → libi2pd/SSUSession.h

0
Signature.cpp → libi2pd/Signature.cpp

0
Signature.h → libi2pd/Signature.h

0
Streaming.cpp → libi2pd/Streaming.cpp

0
Streaming.h → libi2pd/Streaming.h

0
Tag.h → libi2pd/Tag.h

0
Timestamp.cpp → libi2pd/Timestamp.cpp

0
Timestamp.h → libi2pd/Timestamp.h

0
TransitTunnel.cpp → libi2pd/TransitTunnel.cpp

0
TransitTunnel.h → libi2pd/TransitTunnel.h

0
TransportSession.h → libi2pd/TransportSession.h

0
Transports.cpp → libi2pd/Transports.cpp

0
Transports.h → libi2pd/Transports.h

0
Tunnel.cpp → libi2pd/Tunnel.cpp

0
Tunnel.h → libi2pd/Tunnel.h

0
TunnelBase.h → libi2pd/TunnelBase.h

0
TunnelConfig.h → libi2pd/TunnelConfig.h

0
TunnelEndpoint.cpp → libi2pd/TunnelEndpoint.cpp

0
TunnelEndpoint.h → libi2pd/TunnelEndpoint.h

0
TunnelGateway.cpp → libi2pd/TunnelGateway.cpp

0
TunnelGateway.h → libi2pd/TunnelGateway.h

0
TunnelPool.cpp → libi2pd/TunnelPool.cpp

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save