More Android/Termux adjustments

This commit is contained in:
Thomas Pöchtrager 2020-10-14 09:24:50 +02:00
parent 45d2f7ec2e
commit 9d7f6c2461
7 changed files with 26 additions and 25 deletions

View File

@ -101,11 +101,14 @@ if [ $ARM_SUPPORTED -eq 1 ]; then
get_sources \ get_sources \
https://github.com/tpoechtrager/ldid.git master https://github.com/tpoechtrager/ldid.git master
pushd $CURRENT_BUILD_PROJECT_NAME &>/dev/null if [ $f_res -eq 1 ]; then
echo "" pushd $CURRENT_BUILD_PROJECT_NAME &>/dev/null
make -j $JOBS echo ""
$MAKE install -j$JOBS INSTALLPREFIX=$TARGET_DIR make -j $JOBS
popd &>/dev/null $MAKE install -j$JOBS INSTALLPREFIX=$TARGET_DIR
popd &>/dev/null
build_success
fi
fi fi
## Apple TAPI Library ## ## Apple TAPI Library ##
@ -198,15 +201,6 @@ else
mv -f *OSX*$SDK_VERSION*sdk* $SDK_DIR mv -f *OSX*$SDK_VERSION*sdk* $SDK_DIR
fi fi
## Android/Termux is broken
if [ $OPERATING_SYSTEM == "Android" ]; then
pushd $SDK_DIR/MacOSX$SDK_VERSION.sdk &>/dev/null
mkdir -p data/data/com.termux/files/usr
create_symlink $PWD/usr/include data/data/com.termux/files/usr
popd &>/dev/null
fi
## Fix broken SDKs ## ## Fix broken SDKs ##
pushd $SDK_DIR/MacOSX$SDK_VERSION.sdk &>/dev/null pushd $SDK_DIR/MacOSX$SDK_VERSION.sdk &>/dev/null

View File

@ -62,11 +62,11 @@ fi
function warn_if_installed() function warn_if_installed()
{ {
set +e set +e
which $1 &>/dev/null && \ command -v $1 &>/dev/null && \
{ {
echo "" echo ""
echo "It is highly recommended to uninstall previous $2 versions first:" echo "It is highly recommended to uninstall previous $2 versions first:"
echo "-> $(which $1 2>/dev/null)" echo "-> $(command -v $1 2>/dev/null)"
echo "" echo ""
} }
set -e set -e

View File

@ -6,7 +6,7 @@
export LC_ALL=C export LC_ALL=C
which gnutar &>/dev/null command -v gnutar &>/dev/null
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
TAR=gnutar TAR=gnutar
@ -16,7 +16,7 @@ fi
if [ -z "$SDK_COMPRESSOR" ]; then if [ -z "$SDK_COMPRESSOR" ]; then
which xz &>/dev/null command -v xz &>/dev/null
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
SDK_COMPRESSOR=xz SDK_COMPRESSOR=xz

View File

@ -47,7 +47,7 @@ verbosePlaceHolder()
require() require()
{ {
set +e set +e
which $1 &>/dev/null command -v $1 &>/dev/null
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
errorMsg "$1 is required" errorMsg "$1 is required"
exit 1 exit 1
@ -188,7 +188,7 @@ function download()
filename=$(basename $1) filename=$(basename $1)
fi fi
if which curl &>/dev/null; then if command -v curl &>/dev/null; then
## cURL ## ## cURL ##
local curl_opts="-L -C - " local curl_opts="-L -C - "
if [ -z "$VERBOSE" ]; then if [ -z "$VERBOSE" ]; then
@ -198,7 +198,7 @@ function download()
curl_opts+="-o $filename " curl_opts+="-o $filename "
fi fi
curl $curl_opts $uri curl $curl_opts $uri
elif which wget &>/dev/null; then elif command -v wget &>/dev/null; then
## wget ## ## wget ##
local wget_opts="-c -O $filename " local wget_opts="-c -O $filename "
local output=$(wget --no-config 2>&1) local output=$(wget --no-config 2>&1)

View File

@ -3,7 +3,7 @@
pushd "${0%/*}" &>/dev/null pushd "${0%/*}" &>/dev/null
OSXCROSS_CONF="../target/bin/osxcross-conf" OSXCROSS_CONF="../target/bin/osxcross-conf"
[ -f $OSXCROSS_CONF ] || { OSXCROSS_CONF=$(which osxcross-conf 2>/dev/null) || exit 1; } [ -f $OSXCROSS_CONF ] || { OSXCROSS_CONF=$(command -v osxcross-conf 2>/dev/null) || exit 1; }
$OSXCROSS_CONF || exit 1 $OSXCROSS_CONF || exit 1

View File

@ -53,7 +53,7 @@ fi
function require() function require()
{ {
if ! which $1 &>/dev/null; then if ! command -v $1 &>/dev/null; then
echo "Required dependency '$1' is not installed" 1>&2 echo "Required dependency '$1' is not installed" 1>&2
exit 1 exit 1
fi fi
@ -400,11 +400,11 @@ function download()
local uri=$1 local uri=$1
local filename=$(basename $1) local filename=$(basename $1)
if which curl &>/dev/null; then if command -v curl &>/dev/null; then
## cURL ## ## cURL ##
local curl_opts="-L -C - " local curl_opts="-L -C - "
curl $curl_opts -o $filename $uri curl $curl_opts -o $filename $uri
elif which wget &>/dev/null; then elif command -v wget &>/dev/null; then
## wget ## ## wget ##
local wget_opts="-c " local wget_opts="-c "
local output=$(wget --no-config 2>&1) local output=$(wget --no-config 2>&1)

View File

@ -864,6 +864,13 @@ bool Target::setup() {
} }
} }
#ifdef __ANDROID__
// Workaround for Termux
std::string LDSysRoot = "-Wl,-syslibroot,";
LDSysRoot += SDKPath;
fargs.push_back(LDSysRoot);
#endif
if (isClang()) { if (isClang()) {
if (clangversion >= ClangVersion(3, 8)) { if (clangversion >= ClangVersion(3, 8)) {
// //