Skip to content

Commit 25bf88f

Browse files
committed
Enable openssl on full version - support https protocol
Closes #6
1 parent b2d0ba9 commit 25bf88f

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

build_scripts/build_ffmpeg.sh

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,13 @@ fi
140140
# echo "Using existing `pwd`/libvpx-${LIBVPX_VERSION}"
141141
# fi
142142

143+
# Download lib openssl prebuilt
144+
OPENSSL_PREBUILT_FOLDER="$(pwd)/openssl-prebuilt"
145+
if [ ! -d $OPENSSL_PREBUILT_FOLDER/android ]; then
146+
curl -LO "https://github.com/leenjewel/openssl_for_ios_and_android/releases/download/openssl-1.0.2k/openssl.1.0.2k_for_android_ios.zip"
147+
mkdir -p $OPENSSL_PREBUILT_FOLDER && unzip -q "openssl.1.0.2k_for_android_ios.zip" -d $OPENSSL_PREBUILT_FOLDER
148+
fi
149+
143150

144151
function build_one
145152
{
@@ -157,12 +164,18 @@ then
157164
SYSROOT=$NATIVE_SYSROOT
158165
HOST=
159166
CROSS_PREFIX=
167+
if [ "$(uname)" == "Darwin" ]; then
168+
brew install openssl
169+
else
170+
sudo apt-get install libssl-dev
171+
fi
160172
elif [ $ARCH == "arm" ]
161173
then
162174
SYSROOT=$ARM_SYSROOT
163175
HOST=arm-linux-androideabi
164176
CROSS_PREFIX=$ARM_PREBUILT/bin/$HOST-
165177
OPTIMIZE_CFLAGS="$OPTIMIZE_CFLAGS -Dlog2\(x\)=\(log\(x\)/log\(2\)\) -Dlog2f\(x\)=\(logf\(x\)/log\(2\)\)"
178+
166179
#added by alexvas
167180
elif [ $ARCH == "arm64" ]
168181
then
@@ -179,7 +192,6 @@ then
179192
SYSROOT=$X86_SYSROOT
180193
HOST=i686-linux-android
181194
CROSS_PREFIX=$X86_PREBUILT/bin/$HOST-
182-
183195
# elif [ $ARCH == "mips" ]
184196
# then
185197
# SYSROOT=$MIPS_SYSROOT
@@ -348,6 +360,7 @@ fi
348360
--enable-libvorbis \
349361
--enable-libfdk-aac \
350362
--enable-bsf=aac_adtstoasc \
363+
--enable-openssl \
351364
\
352365
--disable-doc \
353366
$ADDITIONAL_CONFIGURE_FLAG
@@ -409,25 +422,29 @@ cp $PREFIX/bin/ffmpeg $DESTINATION_FOLDER/lite/
409422
popd
410423
}
411424

425+
if [ $TARGET == 'arm-v7n' ]; then
412426
#arm v7n
413427
CPU=armv7-a
414428
ARCH=arm
415429
OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=neon -marm -mtune=cortex-a8 -march=$CPU -Os -O3"
416-
ADDITIONAL_CONFIGURE_FLAG=--enable-neon
430+
ADDITIONAL_CONFIGURE_FLAG="--enable-neon "
431+
cp -a $OPENSSL_PREBUILT_FOLDER/android/openssl-armeabi-v7a/. $PREFIX
417432
build_one
418433
elif [ $TARGET == 'arm64-v8a' ]; then
419434
#arm64-v8a
420435
CPU=armv8-a
421436
ARCH=arm64
422437
OPTIMIZE_CFLAGS="-march=$CPU -Os -O3"
423438
ADDITIONAL_CONFIGURE_FLAG=
439+
cp -a $OPENSSL_PREBUILT_FOLDER/android/openssl-arm64-v8a/. $PREFIX
424440
build_one
425441
elif [ $TARGET == 'x86_64' ]; then
426442
#x86_64
427443
CPU=x86-64
428444
ARCH=x86_64
429445
OPTIMIZE_CFLAGS="-fomit-frame-pointer -march=$CPU -Os -O3"
430446
ADDITIONAL_CONFIGURE_FLAG=
447+
cp -a $OPENSSL_PREBUILT_FOLDER/android/openssl-x86_64/. $PREFIX
431448
build_one
432449
elif [ $TARGET == 'i686' ]; then
433450
#x86
@@ -436,20 +453,23 @@ elif [ $TARGET == 'i686' ]; then
436453
OPTIMIZE_CFLAGS="-fomit-frame-pointer -march=$CPU -Os -O3"
437454
# disable asm to fix
438455
ADDITIONAL_CONFIGURE_FLAG=' --disable-asm '
456+
cp -a $OPENSSL_PREBUILT_FOLDER/android/openssl-x86/. $PREFIX
439457
build_one
440458
elif [ $TARGET == 'armv7-a' ]; then
441459
# armv7-a
442460
CPU=armv7-a
443461
ARCH=arm
444462
OPTIMIZE_CFLAGS="-mfloat-abi=softfp -marm -march=$CPU -Os -O3 "
445463
ADDITIONAL_CONFIGURE_FLAG=
464+
cp -a $OPENSSL_PREBUILT_FOLDER/android/openssl-armeabi-v7a/. $PREFIX
446465
build_one
447466
elif [ $TARGET == 'arm' ]; then
448467
#arm
449468
CPU=armv5te
450469
ARCH=arm
451470
OPTIMIZE_CFLAGS="-march=$CPU -Os -O3 "
452471
ADDITIONAL_CONFIGURE_FLAG=
472+
cp -a $OPENSSL_PREBUILT_FOLDER/android/openssl-armeabi/. $PREFIX
453473
build_one
454474
elif [ $TARGET == 'native' ]; then
455475
# host = current machine

0 commit comments

Comments
 (0)