From 066745db631d88adb7ee320fefdaf45db534c330 Mon Sep 17 00:00:00 2001 From: Owen Rafferty Date: Mon, 28 Mar 2022 16:16:14 -0500 Subject: [PATCH] attempt to fix GNU fortran detection, fix definition printing --- c_check | 8 +++++--- f_check | 5 +---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/c_check b/c_check index 687255cbe..9a4460e30 100755 --- a/c_check +++ b/c_check @@ -274,6 +274,8 @@ if [ "$architecture" != "$hostarch" ]; then fi [ "$os" != "$hostos" ] && cross=1 +[ "$os" = "Android" ] && [ "$hostos" = "Linux" ] && [ -n "$TERMUX_APP_PID" ] \ + && cross=0 [ "$USE_OPENMP" != 1 ] && openmp='' @@ -285,7 +287,7 @@ link="$($compiler_name $flags -c ctest2.c -o ctest2.o 2>&1 && $compiler_name $fl link="$(echo "$link" | sed 's/\-Y[[:space:]]P\,/\-Y/g')" -flags="$(echo "$link" | tr '[[:space:],\n]' ' ')" +flags="$(echo "$link" | tr '[:space:],\n' ' ')" # Strip trailing quotes old_flags="$flags" @@ -362,8 +364,8 @@ compiler="$(echo "$compiler" | tr '[:lower:]' '[:upper:]' )" [ "$binformat" = "bin32" ] && printf "#define __32BIT__\t1\n" [ "$binformat" = "bin64" ] && printf "#define __64BIT__\t1\n" [ -n "$need_fu" ] && printf "#define FUNDERSCORE\t%s\n" "$need_fu" - [ "$have_msa" -eq 1 ] && printf "#define HAVE_MSA\t1\n" - [ "$c11_atomics" -eq 1 ] && printf "#define HAVE_C11\t1\n" + ! [ "$have_msa" -eq 1 ] || printf "#define HAVE_MSA\t1\n" + ! [ "$c11_atomics" -eq 1 ] || printf "#define HAVE_C11\t1\n" } >> "$config" diff --git a/f_check b/f_check index 588206786..efd1931eb 100755 --- a/f_check +++ b/f_check @@ -84,13 +84,10 @@ else ;; *GNU*|*GCC*) - v="${data##*\(GNU\) }" + v="${data##*GCC: *\) }" v="${v%%\"*}" major="${v%%.*}" - # Uncomment both for checks using minor - #minor="${v#*.}" - #minor="${v%.*}" if [ "$major" -ge 4 ]; then vendor=GFORTRAN