Skip to content

Commit

Permalink
Merge branch 'openssl' of https://github.com/PurpleI2P/i2pd into openssl
Browse files Browse the repository at this point in the history
  • Loading branch information
orignal committed Sep 28, 2023
2 parents 1e6edf0 + 0cf656c commit bb3ae8f
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ else ifneq (, $(findstring linux, $(SYS))$(findstring gnu, $(SYS)))
else ifneq (, $(findstring freebsd, $(SYS))$(findstring openbsd, $(SYS)))
DAEMON_SRC += $(DAEMON_SRC_DIR)/UnixDaemon.cpp
include Makefile.bsd
else ifneq (, $(findstring haiku, $(SYS)))
DAEMON_SRC += $(DAEMON_SRC_DIR)/UnixDaemon.cpp
include Makefile.haiku
else # not supported
$(error Not supported platform)
endif
Expand Down
10 changes: 10 additions & 0 deletions Makefile.haiku
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CXX = g++
CXXFLAGS := -Wall -std=c++11
INCFLAGS = -I/system/develop/headers
DEFINES = -D_DEFAULT_SOURCE -D_GNU_SOURCE
LDLIBS = -lbe -lbsd -lnetwork -lz -lcrypto -lssl -lboost_system -lboost_date_time -lboost_filesystem -lboost_program_options -lpthread

ifeq ($(USE_UPNP),yes)
DEFINES += -DUSE_UPNP
LDLIBS += -lminiupnpc
endif
4 changes: 4 additions & 0 deletions build/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ if(APPLE)
add_definitions(-DMAC_OSX)
endif()

if(HAIKU)
add_definitions(-D_DEFAULT_SOURCE -D_GNU_SOURCE)
endif()

if(MSVC)
add_definitions(-DWINVER=0x0600)
add_definitions(-D_WIN32_WINNT=0x0600)
Expand Down
8 changes: 8 additions & 0 deletions libi2pd/FS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,14 @@ namespace fs {
dataDir = (home != NULL && strlen(home) > 0) ? home : "";
dataDir += "/Library/Application Support/" + appName;
return;
#elif defined(__HAIKU__)
char *home = getenv("HOME");
if (home != NULL && strlen(home) > 0) {
dataDir = std::string(home) + "/config/settings/" + appName;
} else {
dataDir = "/tmp/" + appName;
}
return;
#else /* other unix */
#if defined(ANDROID)
const char * ext = getenv("EXTERNAL_STORAGE");
Expand Down
2 changes: 1 addition & 1 deletion libi2pd/I2PEndian.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#if defined(__FreeBSD__) || defined(__NetBSD__)
#include <sys/endian.h>

#elif defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__GLIBC__)
#elif defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__GLIBC__) || defined(__HAIKU__)
#include <endian.h>

#elif defined(__APPLE__) && defined(__MACH__)
Expand Down
11 changes: 11 additions & 0 deletions libi2pd/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@
# include <AvailabilityMacros.h>
#endif

#if defined(__HAIKU__)
#include <gnu/pthread.h>
#include <posix/pthread.h>
#include <posix/sys/sockio.h>
#include <posix/sys/ioctl.h>
#ifndef _DEFAULT_SOURCE
#define _DEFAULT_SOURCE
#include <bsd/ifaddrs.h>
#endif
#endif

#ifdef _WIN32
#include <stdlib.h>
#include <string.h>
Expand Down

0 comments on commit bb3ae8f

Please sign in to comment.