diff --git a/src/i2p/build-libi2pd.sh b/src/i2p/build-libi2pd.sh index b7b8fa7..e4c3404 100755 --- a/src/i2p/build-libi2pd.sh +++ b/src/i2p/build-libi2pd.sh @@ -15,11 +15,28 @@ echo "Building libi2pd static libraries from: $I2PD_SRC_DIR" NPROC_VAL="${NPROC:-$(getconf _NPROCESSORS_ONLN 2>/dev/null || echo 4)}" +# Detect the correct OpenSSL formula path on macOS. The i2pd +# Makefile.homebrew hardcodes openssl@3.5 but Homebrew may install +# openssl@3 instead. Command-line make variables override Makefile +# assignments, so passing SSLROOT= fixes the include path. +EXTRA_MAKE_ARGS=() +if [[ "$(uname -s)" == "Darwin" ]]; then + if [[ -d "/opt/homebrew/opt/openssl@3" ]]; then + SSLROOT="/opt/homebrew/opt/openssl@3" + elif [[ -d "/usr/local/opt/openssl@3" ]]; then + SSLROOT="/usr/local/opt/openssl@3" + fi + if [[ -n "${SSLROOT:-}" ]]; then + echo "Detected OpenSSL at: $SSLROOT (overriding Makefile.homebrew)" + EXTRA_MAKE_ARGS+=("SSLROOT=${SSLROOT}") + fi +fi + # i2pd uses a hand-written Makefile system. We build only the static library # targets (libi2pd.a, libi2pdclient.a, libi2pdlang.a), NOT the standalone # i2pd daemon binary, which pulls in HTTPServer/I2PControl deps we don't need # and can OOM on memory-constrained build machines. -make -j"$NPROC_VAL" USE_STATIC=no libi2pd.a libi2pdclient.a libi2pdlang.a +make -j"$NPROC_VAL" USE_STATIC=no "${EXTRA_MAKE_ARGS[@]}" libi2pd.a libi2pdclient.a libi2pdlang.a echo echo "Build finished. Static libraries:" diff --git a/src/i2p/i2p_embedded.cpp b/src/i2p/i2p_embedded.cpp index 8ff3f13..b5656c7 100644 --- a/src/i2p/i2p_embedded.cpp +++ b/src/i2p/i2p_embedded.cpp @@ -371,6 +371,14 @@ CI2PSamSocket* CI2PEmbedded::CreateConnection(const std::string& dest_b32, int p // Embedded mode: i2pd runs in-process via libi2pd / i2p::api // ======================================================================== +#ifdef WIN32 +// MinGW's rpcndr.h (pulled in by winsock2.h/windows.h) #defines +// 'interface' as 'struct' for COM support. i2pd's I2CP.h uses it as a +// parameter name (I2CPServer(const std::string& interface, ...)), +// causing a parse error. Undef before including any i2pd headers. +#undef interface +#endif + // i2pd C++ API #include "Config.h" #include "Log.h"