glibc/sysdeps/csky/preconfigure.ac

63 lines
1.9 KiB
Plaintext
Raw Permalink Normal View History

GLIBC_PROVIDES[]dnl See aclocal.m4 in the top level source directory.
# Local preconfigure fragment for sysdeps/csky
case "$machine" in
csky*)
abi=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null |
sed -n 's/^#define __CSKYABI__ \(.*\)/\1/p'`
soft_float=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null |
sed -n 's/^#define __CSKY_SOFT_FLOAT__ \(.*\)/\1/p'`
hard_float_abi=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null |
sed -n 's/^#define __CSKY_HARD_FLOAT_ABI__ \(.*\)/\1/p'`
case "$abi" in
1)
AC_MSG_ERROR([glibc does not support abiv1 yet], [1])
;;
2)
machine=abiv2
;;
*)
AC_MSG_ERROR([Unknown abi], [1])
;;
esac
# This check is for compatibility with GCC versions earlier than 11.
# The older versions of C-SKY GCC do not support the '-mfloat-abi=softfp' option
# and never define the '__CSKY_HARD_FLOAT_ABI__'.
# Therefore, if a check for '-mfloat-abi=softfp' is added as the expression
# 'defined(__CSKY_HARD_FLOAT__) && !defined(__CSKY_HARD_FLOAT_ABI__)'
# which is correct for newer versions of GCC will not work for those older versions.
# Since no expression compatible with all versions of GCC exists,
# a check for the '-mfloat-abi=softfp' option is added.
if AC_TRY_COMMAND(${CC-cc} -S -mfloat-abi=softfp /dev/null 1>&AS_MESSAGE_LOG_FD); then
soft_float_abi_support=1
else
soft_float_abi_support=0
fi
if test -n "$soft_float"; then
with_fp_cond=0
with_hard_float_abi=0
else
with_fp_cond=1
if test -n "$soft_float_abi_support"; then
if test -n "$hard_float_abi"; then
with_hard_float_abi=1
else
with_hard_float_abi=0
fi
else
with_hard_float_abi=1
fi
fi
base_machine=csky
machine=csky/$machine
AC_DEFINE_UNQUOTED([CSKYABI], [$abi])
AC_DEFINE_UNQUOTED([CSKY_HARD_FLOAT], [$with_fp_cond])
AC_DEFINE_UNQUOTED([CSKY_HARD_FLOAT_ABI], [$with_hard_float_abi])
;;
esac