Skip to content

Commit

Permalink
feat(build_tools): support native openssl
Browse files Browse the repository at this point in the history
Signed-off-by: pingkai <pingkai010@gmail.com>
  • Loading branch information
pingkai committed Feb 24, 2020
1 parent cbc39bf commit a0e6e16
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 4 deletions.
5 changes: 4 additions & 1 deletion build_tools/build_curl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,16 @@ function build_curl(){
export CFLAGS="-arch $2 -fembed-bitcode --sysroot=$SYSROOT -isysroot $SYSROOT -miphoneos-version-min=$DEPLOYMENT_TARGET"
export LDFLAGS="-arch $2 --sysroot=$SYSROOT"
export CC=clang
if [[ "${CURL_SSL_USE_NATIVE}" == "TRUE" ]];then
if [[ "${SSL_USE_NATIVE}" == "TRUE" ]];then
ssl_opt="--with-darwinssl"
fi
elif [ "$1" == "win32" ];then
cross_compile_set_platform_win32 $2
elif [ "$1" == "Darwin" ];then
LIBSDEPEND="LIBS=-lresolv"
if [[ "${SSL_USE_NATIVE}" == "TRUE" ]];then
ssl_opt="--with-darwinssl"
fi
print_warning "native build for $1"
elif [ "$1" == "Linux" ];then
LIBSDEPEND="LIBS=-lresolv"
Expand Down
7 changes: 6 additions & 1 deletion build_tools/build_ffmpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,17 @@ function build_ffmpeg(){
elif [ "$1" == "iOS" ]
then
ffmpeg_cross_compile_set_iOS $2
if [[ "${SSL_USE_NATIVE}" != "TRUE" ]];then
fmpeg_config_add_user "--disable-securetransport"
fi
elif [ "$1" == "win32" ];then
ffmpeg_cross_compile_set_win32 $2
elif [ "$1" == "Darwin" ];then
print_warning "native build for $1"
local native_build=yes
ffmpeg_config_add_user "--disable-securetransport"
if [[ "${SSL_USE_NATIVE}" != "TRUE" ]];then
ffmpeg_config_add_user "--disable-securetransport"
fi
ffmpeg_config_add_extra_cflags "-fno-stack-check"
elif [ "$1" == "Linux" ];then
local native_build=yes
Expand Down
2 changes: 1 addition & 1 deletion build_tools/build_iOS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function create_cmake_config(){
# echo "find_library(COREVIDEO CoreVideo)" >> $CONFIG_FILE
# echo "find_library(COREFOUNDATION CoreFoundation)" >> $CONFIG_FILE
echo -n "set(SRC_LIBRARIES ${SRC_LIBRARIES}" >> $CONFIG_FILE
if [[ "${CURL_SSL_USE_NATIVE}" == "TRUE" ]];then
if [[ "${SSL_USE_NATIVE}" == "TRUE" ]];then
echo -n ' ${SECURITY}' >> $CONFIG_FILE
fi
echo -n ' ${AUDIO_TOOL_BOX}' >> $CONFIG_FILE
Expand Down
4 changes: 4 additions & 0 deletions build_tools/build_native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@ function create_cmake_config(){
echo "find_library(COREMEDIA CoreMedia)" >> $CONFIG_FILE
echo "find_library(COREVIDEO CoreVideo)" >> $CONFIG_FILE
echo "find_library(COREFOUNDATION CoreFoundation)" >> $CONFIG_FILE
echo "find_library(SECURITY Security)" >> $CONFIG_FILE
echo -n "set(SRC_LIBRARIES ${SRC_LIBRARIES}" >> $CONFIG_FILE
echo -n ' ${AUDIO_TOOL_BOX}' >> $CONFIG_FILE
echo -n ' ${VIDEO_TOOL_BOX}' >> $CONFIG_FILE
echo -n ' ${COREMEDIA}' >> $CONFIG_FILE
echo -n ' ${COREVIDEO}' >> $CONFIG_FILE
echo -n ' ${COREFOUNDATION}' >> $CONFIG_FILE
if [[ "${SSL_USE_NATIVE}" == "TRUE" ]];then
echo -n ' ${SECURITY}' >> $CONFIG_FILE
fi
echo ")" >> $CONFIG_FILE
echo "set(SRC_LIBRARIES_DIR ${SRC_LIBRARIES_DIR})" >>$CONFIG_FILE
}
Expand Down
9 changes: 8 additions & 1 deletion build_tools/common_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,14 @@ function build_static_lib(){
print_warning "cares source not found"
fi

if [ -d "${OPEN_SSL_SOURCE_DIR}" ];then
local build_openssl="true"
if [ "$1" == "iOS" ] || [ "$1" == "Darwin" ];then
if [ ${SSL_USE_NATIVE} == "TRUE" ];then
build_openssl="false"
fi
fi

if [ -d "${OPEN_SSL_SOURCE_DIR}" ] && [ "${build_openssl}" == "true" ];then
if [ "${OPENSSL_VERSION_111}" == "True" ];then
build_openssl_111 $1 ${arch}
else
Expand Down

0 comments on commit a0e6e16

Please sign in to comment.