update configure.sh

This commit is contained in:
neiviv-ui 2021-06-22 22:13:26 +02:00
parent b44c7bbfa0
commit 91aa9b4dee
1 changed files with 12 additions and 8 deletions

View File

@ -126,13 +126,17 @@ cd build
echo "$TAG Configuring binutils..."
if command -v termux-setup-storage >/dev/null 2>&1; then
# Since the __ANDROID_API__ flag is hardcoded as 24 in clang, and <stdio.h>
# doesn't prototype some functions when this flag is too low, fixes it's
# version by checking system's properties so as to prevent from missing prototypes
# of existing functions such as fgets_unlocked (only if API >= 28)
# See the following issues :
# * https://github.com/termux/termux-packages/issues/6176
# * https://github.com/termux/termux-packages/issues/2469
run_quietly giteapc-configure.log \
../binutils-$VERSION/configure --prefix="$PREFIX" --target=sh3eb-elf --with-multilib-list=m3,m4-nofpu --program-prefix=sh-elf- --enable-libssp --enable-lto CFLAGS="-D__ANDROID_API__=$(getprop ro.build.version.sdk) -g -O2" CXXFLAGS="-D__ANDROID_API__=$(getprop ro.build.version.sdk) -g -O2"
else
run_quietly giteapc-configure.log \
../binutils-$VERSION/configure --prefix="$PREFIX" --target=sh3eb-elf --with-multilib-list=m3,m4-nofpu --program-prefix=sh-elf- --enable-libssp --enable-lto
export CFLAGS="-D__ANDROID_API__=$(getprop ro.build.version.sdk) -g -O2" \
CXXFLAGS="-D__ANDROID_API__=$(getprop ro.build.version.sdk) -g -O2"
fi
run_quietly giteapc-configure.log \
../binutils-$VERSION/configure --prefix="$PREFIX" --target=sh3eb-elf --with-multilib-list=m3,m4-nofpu --program-prefix=sh-elf- --enable-libssp --enable-lto