Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cmake Build #2

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Copyright (C) 2021-2022 QuasarApp.
# Distributed under the lgplv3 software license, see the accompanying
# Copyright (C) 2021-2023 QuasarApp.
# Distributed under the GPLv3 software license, see the accompanying
# Everyone is permitted to copy and distribute verbatim copies
# of this license document, but changing it is not allowed.
#
Expand Down
81 changes: 81 additions & 0 deletions makeSLLLinux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#!/bin/bash
#export ANDROID_NDK_ROOT=/some/where/android-ndk-10d

OPENSSL_TAG=openssl-3.0.9
OPENSSL_LIB_PREFIX=_3.so



export ANDROID_NDK_ROOT="$HOME/AndroidSDK/ndk/25.2.9519653"
export ANDROID_SDK_ROOT="$HOME/AndroidSDK"
export JAVA_HOME="/usr"
export ANDROID_HOME="$HOME/AndroidSDK"
export ANDROID_API_VERSION="26"
export ANDROID_NDK_HOME=$ANDROID_NDK_ROOT


BASE_DIR=$(dirname "$(readlink -f "$0")")
BASE_PATH=$PATH

cd $BASE_DIR

if [ -d "$BASE_DIR/openssl" ]; then

echo "opens ssl alredy cloned"
else
git clone https://github.com/openssl/openssl.git
fi

cd openssl
OLD_PWD=$PWD

git fetch
git clean -xdf
git checkout .
git submodule foreach --recursive git clean -xdf
git submodule foreach --recursive git checkout .
git checkout $OPENSSL_TAG
git submodule update --init --recursive

export PATH=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin:$BASE_PATH

GENERAL_OPTIONS="-no-tests -no-ui-console -no-ssl3 -no-comp -no-engine"

function build_for ()
{
cd $BASE_DIR/openssl

PLATFORM=$1
echo "#####BUILD FOR $PLATFORM#####"

export SSL_PREFIX_DIR=$BASE_DIR/$PLATFORM

git clean -xdf
git submodule foreach --recursive git clean -xdf
rm -rdf $SSL_PREFIX_DIR

echo "./Configure $GENERAL_OPTIONS $PLATFORM -D__ANDROID_API__=$ANDROID_API_VERSION --prefix=${SSL_PREFIX_DIR} --openssldir=${SSL_PREFIX_DIR}"
./Configure $GENERAL_OPTIONS $PLATFORM -D__ANDROID_API__=$ANDROID_API_VERSION --prefix=${SSL_PREFIX_DIR} --openssldir=${SSL_PREFIX_DIR}

echo "make -j$nproc "
make -j$nproc build_libs
make install_sw

cd $SSL_PREFIX_DIR/lib
ln -s libcrypto.so libcrypto_android.so
ln -s libssl.so libssl_android.so

unset SSL_PREFIX_DIR
}

# Arm 64 build
build_for android-arm64

# Arm 32 build
build_for android-arm

# Amd 64 build
build_for android-x86_64

# Amd 64 build
build_for android-x86