fix(i2p): Windows interface macro conflict + macOS OpenSSL path

Windows: MinGW's rpcndr.h #defines 'interface' as 'struct' (COM
support). i2pd's I2CP.h uses it as a parameter name, causing
parse errors. Add #undef interface before i2pd includes.

macOS: i2pd Makefile.homebrew hardcodes openssl@3.5 but Homebrew
installs openssl@3. build-libi2pd.sh now detects the actual path
and passes SSLROOT=<path> to make, which overrides the Makefile
assignment.
This commit is contained in:
Krystie
2026-06-28 15:37:57 -07:00
parent ba3d7a766a
commit 7e359c0f21
2 changed files with 26 additions and 1 deletions
+18 -1
View File
@@ -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=<detected> 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:"
+8
View File
@@ -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"