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 \
https://github.com/tpoechtrager/ldid.git master
pushd $CURRENT_BUILD_PROJECT_NAME &>/dev/null
echo ""
make -j $JOBS
$MAKE install -j$JOBS INSTALLPREFIX=$TARGET_DIR
popd &>/dev/null
if [ $f_res -eq 1 ]; then
pushd $CURRENT_BUILD_PROJECT_NAME &>/dev/null
echo ""
make -j $JOBS
$MAKE install -j$JOBS INSTALLPREFIX=$TARGET_DIR
popd &>/dev/null
build_success
fi
fi
## Apple TAPI Library ##
@ -198,15 +201,6 @@ else
mv -f *OSX*$SDK_VERSION*sdk* $SDK_DIR
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 ##
pushd $SDK_DIR/MacOSX$SDK_VERSION.sdk &>/dev/null

View File

@ -62,11 +62,11 @@ fi
function warn_if_installed()
{
set +e
which $1 &>/dev/null && \
command -v $1 &>/dev/null && \
{
echo ""
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 ""
}
set -e

View File

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

View File

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

View File

@ -3,7 +3,7 @@
pushd "${0%/*}" &>/dev/null
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

View File

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