Skip to content

Commit 71dc662

Browse files
committed
openssl enable threads and rm no-deprecated option
1 parent ba4bc9c commit 71dc662

File tree

2 files changed

+46
-29
lines changed

2 files changed

+46
-29
lines changed

do-compile/android/openssl.sh

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,38 +20,46 @@
2020
# https://github.com/openssl/openssl/blob/master/NOTES-ANDROID.md
2121
# https://github.com/xbmc/xbmc/pull/25092/commits/494a452cd65abe1447771874cc79ed967015d944
2222

23+
# no-deprecated, fix ffmepg compile error:
24+
# libavformat/tls_openssl.c:56:16: error: use of undeclared identifier 'CRYPTO_LOCK'; did you mean 'CRYPTO_free'?
25+
# if (mode & CRYPTO_LOCK)
26+
# ^~~~~~~~~~~
27+
# CRYPTO_free
28+
2329
set -e
2430

2531
THIS_DIR=$(DIRNAME=$(dirname "$0"); cd "$DIRNAME"; pwd)
2632
cd "$THIS_DIR"
2733

2834
case $_MR_ARCH in
2935
armv7a)
30-
target=android-arm
36+
os=android-arm
3137
;;
3238
x86)
33-
target=android-x86
39+
os=android-x86
3440
;;
3541
x86_64)
36-
target=android-x86_64
42+
os=android-x86_64
3743
;;
3844
arm64)
39-
target=android-arm64
45+
os=android-arm64
4046
;;
4147
*)
4248
echo "unknown architecture $_MR_ARCH";
4349
exit 1
4450
;;
4551
esac
4652

47-
# prepare build config
48-
CFG_FLAGS="no-threads enable-tls1_3 no-comp no-zlib no-zlib-dynamic no-deprecated \
49-
no-shared no-filenames no-engine no-dynamic-engine no-static-engine \
50-
no-dso no-err no-ui-console no-stdio no-tests \
53+
CFG_FLAGS="no-shared no-engine no-dynamic-engine no-static-engine \
54+
no-dso no-ui-console no-tests \
5155
--prefix=$MR_BUILD_PREFIX \
5256
--openssldir=$MR_BUILD_PREFIX \
5357
-U__ANDROID_API__ -D__ANDROID_API__=$MR_ANDROID_API \
54-
$target"
58+
$os"
59+
60+
if [[ "$MR_DEBUG" != "debug" ]]; then
61+
CFG_FLAGS="$CFG_FLAGS --release"
62+
fi
5563

5664
# -arch $MR_ARCH
5765
C_FLAGS="$MR_DEFAULT_CFLAGS"

do-compile/apple/openssl.sh

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,31 @@ set -e
2424
THIS_DIR=$(DIRNAME=$(dirname "$0"); cd "$DIRNAME"; pwd)
2525
cd "$THIS_DIR"
2626

27-
# prepare build config
28-
CFG_FLAGS="--prefix=$MR_BUILD_PREFIX --openssldir=$MR_BUILD_PREFIX no-shared no-hw no-engine no-asm"
29-
3027
if [ "$MR_ARCH" = "x86_64" ]; then
31-
CFG_FLAGS="$CFG_FLAGS darwin64-x86_64-cc enable-ec_nistp_64_gcc_128"
28+
compiler="darwin64-x86_64-cc"
3229
elif [ "$MR_ARCH" = "arm64" ]; then
33-
CFG_FLAGS="$CFG_FLAGS darwin64-arm64-cc enable-ec_nistp_64_gcc_128"
30+
compiler="darwin64-arm64-cc"
3431
else
3532
echo "unknown architecture $FF_ARCH";
3633
exit 1
3734
fi
3835

39-
CFLAGS="$MR_DEFAULT_CFLAGS"
36+
# no-hw no-asm
37+
38+
CFG_FLAGS="no-shared no-engine no-dynamic-engine no-static-engine \
39+
no-dso no-ui-console no-tests \
40+
--prefix=$MR_BUILD_PREFIX \
41+
--openssldir=$MR_BUILD_PREFIX \
42+
enable-ec_nistp_64_gcc_128"
43+
44+
if [[ "$MR_DEBUG" != "debug" ]]; then
45+
CFG_FLAGS="$CFG_FLAGS --release"
46+
fi
47+
48+
CFG_FLAGS="$CFG_FLAGS $compiler"
49+
50+
# -arch $MR_ARCH
51+
C_FLAGS="$MR_DEFAULT_CFLAGS"
4052

4153
# for cross compile
4254
if [[ $(uname -m) != "$MR_ARCH" || "$MR_FORCE_CROSS" ]];then
@@ -45,31 +57,28 @@ if [[ $(uname -m) != "$MR_ARCH" || "$MR_FORCE_CROSS" ]];then
4557
CFLAGS="$CFLAGS -isysroot $MR_SYS_ROOT"
4658
fi
4759

48-
#----------------------
49-
echo "----------------------"
50-
echo "[*] configurate $LIB_NAME"
51-
echo "----------------------"
52-
5360
cd $MR_BUILD_SOURCE
5461
if [ -f "./Makefile" ]; then
5562
echo 'reuse configure'
63+
echo "----------------------"
64+
echo "[*] reuse configurate"
5665
else
57-
echo
58-
echo "CC: $MR_CC"
59-
echo "CFLAGS: $CFLAGS"
66+
echo "----------------------"
67+
echo "[*] configurate"
68+
echo "C_FLAGS: $C_FLAGS"
6069
echo "Openssl CFG: $CFG_FLAGS"
61-
echo
62-
./Configure $CFG_FLAGS \
63-
CC="$MR_CC" \
64-
CFLAGS="$CFLAGS" \
65-
CXXFLAG="$CFLAGS"
70+
echo "----------------------"
71+
72+
export C_FLAGS="$C_FLAGS"
73+
export CXXFLAG="$C_FLAGS"
74+
export CC="$MR_CC"
75+
./Configure $CFG_FLAGS
6676
fi
6777

6878
#----------------------
6979
echo "----------------------"
7080
echo "[*] compile $LIB_NAME"
7181
echo "----------------------"
72-
set +e
7382

7483
make build_libs -j$MR_HOST_NPROC >/dev/null
7584
make install_dev >/dev/null

0 commit comments

Comments
 (0)