if the target compiler is gcc 10 or better, set COMPILER_COMMON_CFLAGS = $(CFLAGS_COMMON)

This commit is contained in:
Kalamatee 2021-01-17 05:00:29 +00:00 committed by deadwood
parent 45d4ac9d2d
commit beb8cb6547
3 changed files with 42 additions and 0 deletions

View File

@ -311,3 +311,4 @@ NOWARN_BUILTIN_DECLARATION_MISMATCH := @aros_nowarnflags_builtin_declaration
# Toolchain support
COMPILER_SYSROOT := @aros_toolchain_sysroot@
COMPILER_COMMON_CFLAGS := @aros_toolchain_cflags_common@

View File

@ -584,6 +584,7 @@ PACKAGE_URL=
ac_unique_file="../mmakefile"
ac_subst_vars='LTLIBOBJS
LIBOBJS
aros_toolchain_cflags_common
aros_toolchain_sysroot
aros_nowarnflags_builtin_declaration_mismatch
aros_warnflags_builtin_declaration_mismatch
@ -6832,6 +6833,26 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
#
# Now check what we need to use with the toolchain
COMPILER_VERSION=`${CC} --version 2>/dev/null`
IS_LLVM_COMPILER=`echo "$COMPILER_VERSION" | grep -i -c -E 'LLVM|clang'`
if test "$IS_LLVM_COMPILER" -ne "0"; then
IS_GNU_COMPILER=0
fi
if test "$IS_LLVM_COMPILER" -eq "0"; then
IS_GNU_COMPILER=`echo "$COMPILER_VERSION" | grep -i -c -E 'gcc'`
fi
if test "$IS_GNU_COMPILER" -ne "0"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: \"GNU Compiler....\"" >&5
$as_echo "$as_me: \"GNU Compiler....\"" >&6;}
GNU_COMPILER_VERS="`${CC} -dumpversion`"
GCC_VERSION_MAJOR=$(echo $GNU_COMPILER_VERS | cut -d'.' -f1)
GCC_VERSION_MINOR=$(echo $GNU_COMPILER_VERS | cut -d'.' -f2)
GCC_VERSION_PATCH=$(echo $GNU_COMPILER_VERS | cut -d'.' -f3)
if test "$GCC_VERSION_MAJOR" -gt "9" ; then
aros_toolchain_cflags_common="$""(CFLAGS_COMMON)"
fi
fi
cat >$AROS_DEVELOPMENT/include/__testsincdir.h <<_ACEOF
/* Copyright (c) The AROS Dev Team */
#define _TESTINCFOUND
@ -7192,6 +7213,7 @@ rm -f $AROS_DEVELOPMENT/include/__testsincdir.h
# Additional toolchain support ...
ac_config_files="$ac_config_files ${aros_targetcfg_dir}/compiler.cfg:compiler.cfg.in"

View File

@ -1342,6 +1342,24 @@ AC_LANG_PUSH(C)
#
# Now check what we need to use with the toolchain
COMPILER_VERSION=`${CC} --version 2>/dev/null`
IS_LLVM_COMPILER=`echo "$COMPILER_VERSION" | grep -i -c -E 'LLVM|clang'`
if test "$IS_LLVM_COMPILER" -ne "0"; then
IS_GNU_COMPILER=0
fi
if test "$IS_LLVM_COMPILER" -eq "0"; then
IS_GNU_COMPILER=`echo "$COMPILER_VERSION" | grep -i -c -E 'gcc'`
fi
if test "$IS_GNU_COMPILER" -ne "0"; then
GNU_COMPILER_VERS="`${CC} -dumpversion`"
GCC_VERSION_MAJOR=$(echo $GNU_COMPILER_VERS | cut -d'.' -f1)
GCC_VERSION_MINOR=$(echo $GNU_COMPILER_VERS | cut -d'.' -f2)
GCC_VERSION_PATCH=$(echo $GNU_COMPILER_VERS | cut -d'.' -f3)
if test "$GCC_VERSION_MAJOR" -gt "9" ; then
aros_toolchain_cflags_common="$""(CFLAGS_COMMON)"
fi
fi
cat >$AROS_DEVELOPMENT/include/__testsincdir.h <<_ACEOF
/* Copyright (c) The AROS Dev Team */
#define _TESTINCFOUND
@ -1650,6 +1668,7 @@ AC_SUBST(aros_nowarnflags_builtin_declaration_mismatch)
# Additional toolchain support ...
AC_SUBST(aros_toolchain_sysroot)
AC_SUBST(aros_toolchain_cflags_common)
AC_CONFIG_FILES(
${aros_targetcfg_dir}/compiler.cfg:compiler.cfg.in