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

Fix a few mac and android glitches #9735

Merged
merged 3 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion scripts/android-build-cjson.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ source $(dirname "${BASH_SOURCE[0]}")/android-build-common.sh

# Run the main program.
common_parse_arguments $@
common_check_requirements
common_update $SCM_URL $SCM_TAG $BUILD_SRC $SCM_HASH

# Prepare the environment
Expand Down
173 changes: 83 additions & 90 deletions scripts/android-build-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ if [ -z $NDK_TARGET ]; then
fi

if [ -z $CMAKE_PROGRAM ]; then
CMAKE_PROGRAM=$(find $ANDROID_SDK/cmake -name cmake $FIND_ARGS)
CMAKE_PROGRAM="cmake-missing"
fi

if [ -z $CCACHE ]; then
CCACHE=$(which ccache)
fi

if [ -z $ANDROID_NDK ]; then
ANDROID_NDK="missing"
ANDROID_NDK="ndk-missing"
fi

if [ -z $ANDROID_SDK ]; then
ANDROID_SDK="missing"
ANDROID_SDK="sdk-missing"
fi

if [ -z $BUILD_DST ]; then
Expand All @@ -55,6 +55,10 @@ if [ -z $SCM_TAG ]; then
SCM_TAG=master
fi

if [ -z $SCM_HASH ]; then
SCM_HASH="missing"
fi

CLEAN_BUILD_DIR=0

function common_help {
Expand Down Expand Up @@ -91,6 +95,80 @@ function common_run {
fi
}

function common_check_requirements {
if [[ ! -d $ANDROID_NDK ]];
then
echo "export ANDROID_NDK to point to your NDK location."
exit 1
fi

if [[ ! -d $ANDROID_SDK ]];
then
echo "export ANDROID_SDK to point to your SDK location."
exit 1
fi
if [[ -z $BUILD_DST ]];
then
echo "Destination directory not valid"
exit 1
fi

if [[ -z $BUILD_SRC ]];
then
echo "Source directory not valid"
exit 1
fi

if [[ -z $SCM_URL ]];
then
echo "Source URL not defined! Define SCM_URL"
exit 1
fi

if [[ -z $SCM_TAG ]];
then
echo "SCM_TAG / BRANCH not defined! Define SCM_TAG"
exit 1
fi

if [[ -z $SCM_HASH ]];
then
echo "SCM_HASH not defined! Define SCM_HASH"
exit 1
fi

if [[ -z $NDK_TARGET ]];
then
echo "Android platform NDK_TARGET not defined"
exit 1
fi

if [ -z $CMAKE_PROGRAM ] || [ "$CMAKE_PROGRAM" == "cmake-missing" ]; then
CMAKE_PROGRAM=$(find $ANDROID_SDK/cmake -name cmake $FIND_ARGS)
if [ -z $CMAKE_PROGRAM ]; then
echo "CMake not found in $ANDROID_SDK, install CMake from the android SDK!"
exit 1
fi
fi

for CMD in make git $CMAKE_PROGRAM
do
if ! type $CMD >/dev/null; then
echo "Command $CMD not found. Install and add it to the PATH."
exit 1
fi
done

if [ "${BUILD_SRC:0:1}" != "/" ];
then
BUILD_SRC=$(pwd)/$BUILD_SRC
fi
if [ "${BUILD_DST:0:1}" != "/" ];
then
BUILD_DST=$(pwd)/$BUILD_DST
fi
}

function common_parse_arguments {
while [[ $# > 0 ]]
do
Expand All @@ -113,7 +191,6 @@ function common_parse_arguments {

--sdk)
ANDROID_SDK="$2"
CMAKE_PROGRAM=$(find $ANDROID_SDK/cmake -name cmake $FIND_ARGS)
shift
;;

Expand Down Expand Up @@ -142,7 +219,7 @@ function common_parse_arguments {
shift
;;

--hash)
--hash)
SCM_HASH="$2"
shift
;;
Expand All @@ -162,92 +239,8 @@ function common_parse_arguments {
esac
shift
done
}

function common_check_requirements {
if [[ ! -d $ANDROID_NDK ]];
then
echo "export ANDROID_NDK to point to your NDK location."
exit 1
fi

if [[ ! -d $ANDROID_SDK ]];
then
echo "export ANDROID_SDK to point to your SDK location."
exit 1
fi
if [[ -z $BUILD_DST ]];
then
echo "Destination directory not valid"
exit 1
fi

if [[ -z $BUILD_SRC ]];
then
echo "Source directory not valid"
exit 1
fi

if [[ -z $SCM_URL ]];
then
echo "Source URL not defined! Define SCM_URL"
exit 1
fi

if [[ -z $SCM_TAG ]];
then
echo "SCM TAG / BRANCH not defined! Define SCM_TAG"
exit 1
fi

if [[ -z $SCM_HASH ]];
then
echo "SCM HASH not defined! Define SCM_HASH"
exit 1
fi

if [[ -z $NDK_TARGET ]];
then
echo "Android platform NDK_TARGET not defined"
exit 1
fi

if [ -x $ANDROID_NDK/ndk-build ]; then
NDK_BUILD=$ANDROID_NDK/ndk-build
else
echo "ndk-build not found in NDK directory $ANDROID_NDK"
echo "assuming ndk-build is in path..."
NDK_BUILD=$(which ndk-build)
if [ -z $NDK_BUILD ]; then
echo "ndk-build not found in $ANDROID_NDK and not in PATH"
exit 1
fi
fi

if [ -z $CMAKE_PROGRAM ]; then
CMAKE_PROGRAM=$(find $ANDROID_SDK/cmake -name cmake $FIND_ARGS)
if [ -z $CMAKE_PROGRAM ]; then
echo "CMake not found in $ANDROID_SDK, install CMake from the android SDK!"
exit 1
fi
fi

for CMD in make git $CMAKE_PROGRAM $NDK_BUILD
do
if ! type $CMD >/dev/null; then
echo "Command $CMD not found. Install and add it to the PATH."
exit 1
fi
done

if [ "${BUILD_SRC:0:1}" != "/" ];
then
BUILD_SRC=$(pwd)/$BUILD_SRC
fi
if [ "${BUILD_DST:0:1}" != "/" ];
then
BUILD_DST=$(pwd)/$BUILD_DST
fi
common_check_requirements
}

function common_update {
Expand Down
1 change: 0 additions & 1 deletion scripts/android-build-ffmpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ function build {

# Run the main program.
common_parse_arguments $@
common_check_requirements
common_update $SCM_URL $SCM_TAG $BUILD_SRC $SCM_HASH

HOST_PKG_CONFIG_PATH=`command -v pkg-config`
Expand Down
1 change: 0 additions & 1 deletion scripts/android-build-openh264.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ function build {

# Run the main program.
common_parse_arguments $@
common_check_requirements
common_update $SCM_URL $SCM_TAG $BUILD_SRC $SCM_HASH


Expand Down
1 change: 0 additions & 1 deletion scripts/android-build-openssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ function build {

# Run the main program.
common_parse_arguments $@
common_check_requirements
common_update $SCM_URL $SCM_TAG $BUILD_SRC $SCM_HASH

ORG_PATH=$PATH
Expand Down
18 changes: 15 additions & 3 deletions scripts/bundle-mac-os.sh
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ do
FINSTPATH=$BUILD/FFmpeg/install/$ARCH
CFLAGS=$FFCFLAGS LDFLAGS=$FFCFLAGS $SRC/FFmpeg/configure --prefix=$FINSTPATH --disable-all \
--enable-shared --disable-static --enable-swscale --disable-asm --disable-libxcb \
--disable-securetransport --disable-xlib
--disable-securetransport --disable-xlib --enable-cross-compile
CFLAGS=$FFCFLAGS LDFLAGS=$FFCFLAGS make -j
CFLAGS=$FFCFLAGS LDFLAGS=$FFCFLAGS make -j install
fix_rpath "$FINSTPATH/lib"
Expand All @@ -247,8 +247,20 @@ do
done

cd $BUILD
cmake -GNinja -Bfreerdp -S"$SCRIPT_PATH/.." $CMAKE_ARGS -DWITH_PLATFORM_SERVER=OFF -DWITH_NEON=OFF -DWITH_SSE=OFF -DWITH_FFMPEG=OFF \
-DWITH_SWSCALE=ON -DWITH_OPUS=ON -DWITH_WEBVIEW=OFF -DWITH_FAAD2=ON -DWITH_FAAC=ON
cmake -GNinja -Bfreerdp -S"$SCRIPT_PATH/.." \
$CMAKE_ARGS \
-DWITH_PLATFORM_SERVER=OFF \
-DWITH_NEON=OFF \
-DWITH_SSE=OFF \
-DWITH_FFMPEG=OFF \
-DWITH_SWSCALE=ON \
-DWITH_OPUS=ON \
-DWITH_WEBVIEW=OFF \
-DWITH_FAAD2=ON \
-DWITH_FAAC=ON \
-DWITH_INTERNAL_RC4=ON \
-DWITH_INTERNAL_MD4=ON \
-DWITH_INTERNAL_MD5=ON
cmake --build freerdp
cmake --install freerdp

Expand Down