Skip to content
This repository was archived by the owner on Aug 6, 2026. It is now read-only.

Commit f15beaf

Browse files
author
TeleGhost Dev
committed
Fix Android i2pd build: move OpenSSL to robust discovery
1 parent 227866f commit f15beaf

1 file changed

Lines changed: 26 additions & 5 deletions

File tree

‎scripts/build_i2pd_android.sh‎

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,28 @@ for i in "${!ARCHS[@]}"; do
3838
mkdir -p $ARCH_BUILD_DIR
3939

4040
# Locate OpenSSL for this Arch
41-
# Assuming structure: $OPENSSL_ROOT/$ARCH/lib and include
42-
# We used find in workflow, so OPENSSL_ROOT is likely just the parent dir?
43-
# No, passed OPENSSL_ROOT should be the version dir, e.g. openssl_prebuilt/openssl-1.1.1
44-
OPENSSL_INCLUDE="$OPENSSL_ROOT/$ARCH/include"
45-
OPENSSL_LIB="$OPENSSL_ROOT/$ARCH/lib"
41+
echo "--- OpenSSL Discovery for $ARCH ---"
42+
# Find crypto lib for this arch
43+
OPENSSL_CRYPTO_LIB=$(find "$OPENSSL_ROOT" -name "libcrypto.a" | grep "/$ARCH/" | head -n 1)
44+
OPENSSL_SSL_LIB=$(find "$OPENSSL_ROOT" -name "libssl.a" | grep "/$ARCH/" | head -n 1)
45+
# Find include (look for ssl.h)
46+
OPENSSL_INCLUDE_PATH=$(find "$OPENSSL_ROOT" -name "ssl.h" | grep "/$ARCH/" | head -n 1 | sed 's|/openssl/ssl.h||')
47+
48+
if [ -z "$OPENSSL_INCLUDE_PATH" ]; then
49+
# Fallback to first found include if not arch-specific
50+
OPENSSL_INCLUDE_PATH=$(find "$OPENSSL_ROOT" -name "ssl.h" | head -n 1 | sed 's|/openssl/ssl.h||')
51+
fi
52+
53+
if [ -z "$OPENSSL_CRYPTO_LIB" ] || [ -z "$OPENSSL_SSL_LIB" ] || [ -z "$OPENSSL_INCLUDE_PATH" ]; then
54+
echo "Warning: Could not fully locate OpenSSL for $ARCH, using legacy fallback"
55+
OPENSSL_INCLUDE_PATH="$OPENSSL_ROOT/$ARCH/include"
56+
OPENSSL_CRYPTO_LIB="$OPENSSL_ROOT/$ARCH/lib/libcrypto.a"
57+
OPENSSL_SSL_LIB="$OPENSSL_ROOT/$ARCH/lib/libssl.a"
58+
fi
59+
60+
echo " OpenSSL Include: $OPENSSL_INCLUDE_PATH"
61+
echo " OpenSSL Crypto: $OPENSSL_CRYPTO_LIB"
62+
echo " OpenSSL SSL: $OPENSSL_SSL_LIB"
4663

4764
# Locate Boost for this Arch
4865
echo "--- Boost Discovery for $ARCH ---"
@@ -90,7 +107,11 @@ for i in "${!ARCHS[@]}"; do
90107
-DWITH_LIBRARY=ON \
91108
-DWITH_BINARY=OFF \
92109
-DWITH_STATIC=ON \
110+
-DOPENSSL_USE_STATIC_LIBS=ON \
93111
-DOPENSSL_ROOT_DIR="$OPENSSL_ROOT/$ARCH" \
112+
-DOPENSSL_INCLUDE_DIR="$OPENSSL_INCLUDE_PATH" \
113+
-DOPENSSL_CRYPTO_LIBRARY="$OPENSSL_CRYPTO_LIB" \
114+
-DOPENSSL_SSL_LIBRARY="$OPENSSL_SSL_LIB" \
94115
-DBOOST_ROOT="$BOOST_ROOT" \
95116
-DBOOST_INCLUDEDIR="$BOOST_INCLUDE_PATH" \
96117
-DBOOST_LIBRARYDIR="$BOOST_LIB_PATH" \

0 commit comments

Comments
 (0)