diff options
author | Mike Frysinger <vapier@gentoo.org> | 2022-01-28 13:17:46 +0300 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2022-02-02 02:15:51 +0300 |
commit | 041dd7ff265a15096f995396c0005cea19336819 (patch) | |
tree | a110b6a1c73f00e9626e6ad8c30c3f07773b92d4 /newlib/libc/machine | |
parent | 38755463e5b302a53eb282930f4871726a2b834f (diff) |
newlib: add AC_CACHE_CHECK sugar around preprocessor checks
This isn't strictly necessary, but it makes for much clearer logs as
to what the target is doing, and provides cache vars for anyone who
wants to force the test a different way, and it lets the build cache
its own results when rerunning config.status.
Diffstat (limited to 'newlib/libc/machine')
-rw-r--r-- | newlib/libc/machine/nds32/acinclude.m4 | 7 | ||||
-rw-r--r-- | newlib/libc/machine/sh/acinclude.m4 | 7 | ||||
-rw-r--r-- | newlib/libc/machine/spu/acinclude.m4 | 9 |
3 files changed, 12 insertions, 11 deletions
diff --git a/newlib/libc/machine/nds32/acinclude.m4 b/newlib/libc/machine/nds32/acinclude.m4 index 35c2afe99..ae8ea5d91 100644 --- a/newlib/libc/machine/nds32/acinclude.m4 +++ b/newlib/libc/machine/nds32/acinclude.m4 @@ -1,10 +1,11 @@ if test "${machine_dir}" = "nds32"; then dnl Use builtin macro to detect if this is for "AndeStar ISA V3m". - AC_PREPROC_IFELSE([AC_LANG_PROGRAM( + AC_CACHE_CHECK([for nds32 V3M ISA], newlib_cv_nds32_isa_v3m, [dnl + AC_PREPROC_IFELSE([AC_LANG_PROGRAM( [[#ifdef __NDS32_ISA_V3M__ # error "This is nds32_isa_v3m." #endif -]])], [is_nds32_isa_v3m="no"], [is_nds32_isa_v3m="yes"]) +]])], [newlib_cv_nds32_isa_v3m="no"], [newlib_cv_nds32_isa_v3m="yes"])]) fi -AM_CONDITIONAL(IS_NDS32_ISA_V3M, test "$is_nds32_isa_v3m" = "yes") +AM_CONDITIONAL(IS_NDS32_ISA_V3M, test "$newlib_cv_nds32_isa_v3m" = "yes") diff --git a/newlib/libc/machine/sh/acinclude.m4 b/newlib/libc/machine/sh/acinclude.m4 index 60af7b1f1..66ec3b4e1 100644 --- a/newlib/libc/machine/sh/acinclude.m4 +++ b/newlib/libc/machine/sh/acinclude.m4 @@ -1,9 +1,10 @@ if test "${machine_dir}" = "sh"; then - AC_PREPROC_IFELSE([AC_LANG_PROGRAM( + AC_CACHE_CHECK([for SH5 (64-bit)], newlib_cv_sh64, [dnl + AC_PREPROC_IFELSE([AC_LANG_PROGRAM( [[#if !defined(__SH5__) # error "not SH5" #endif -]])], [have_sh64=yes], [have_sh64=no]) +]])], [newlib_cv_sh64=yes], [newlib_cv_sh64=no])]) fi -AM_CONDITIONAL(SH64, [test "$have_sh64" = yes]) +AM_CONDITIONAL(SH64, [test "$newlib_cv_sh64" = yes]) diff --git a/newlib/libc/machine/spu/acinclude.m4 b/newlib/libc/machine/spu/acinclude.m4 index 4e5fb363c..bca70e309 100644 --- a/newlib/libc/machine/spu/acinclude.m4 +++ b/newlib/libc/machine/spu/acinclude.m4 @@ -1,10 +1,9 @@ if test "${machine_dir}" = "spu"; then - AC_MSG_CHECKING([whether the compiler supports __ea]) - AC_PREPROC_IFELSE([AC_LANG_PROGRAM( + AC_CACHE_CHECK([whether the compiler supports __ea], newlib_cv_spu_compiler_has_ea, [dnl + AC_PREPROC_IFELSE([AC_LANG_PROGRAM( [[#if !defined (__EA32__) && !defined (__EA64__) # error "__ea not supported" #endif -]])], [spu_compiler_has_ea=yes], [spu_compiler_has_ea=no]) - AC_MSG_RESULT($spu_compiler_has_ea) +]])], [newlib_cv_spu_compiler_has_ea=yes], [newlib_cv_spu_compiler_has_ea=no])]) fi -AM_CONDITIONAL(HAVE_SPU_EA, test x${spu_compiler_has_ea} != xno) +AM_CONDITIONAL(HAVE_SPU_EA, test "$newlib_cv_spu_compiler_has_ea" = yes) |