diff options
author | Mike Frysinger <vapier@gentoo.org> | 2022-01-28 05:17:46 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2022-02-01 18:15:51 -0500 |
commit | 041dd7ff265a15096f995396c0005cea19336819 (patch) | |
tree | a110b6a1c73f00e9626e6ad8c30c3f07773b92d4 /newlib/libm | |
parent | 38755463e5b302a53eb282930f4871726a2b834f (diff) | |
download | newlib-041dd7ff265a15096f995396c0005cea19336819.zip newlib-041dd7ff265a15096f995396c0005cea19336819.tar.gz newlib-041dd7ff265a15096f995396c0005cea19336819.tar.bz2 |
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/libm')
-rwxr-xr-x | newlib/libm/configure | 32 | ||||
-rw-r--r-- | newlib/libm/machine/nds32/acinclude.m4 | 14 |
2 files changed, 32 insertions, 14 deletions
diff --git a/newlib/libm/configure b/newlib/libm/configure index fb7f415..d9b3cff 100755 --- a/newlib/libm/configure +++ b/newlib/libm/configure @@ -12120,7 +12120,12 @@ fi if test "${libm_machine_dir}" = "nds32"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nds32 FPU SP extension" >&5 +$as_echo_n "checking for nds32 FPU SP extension... " >&6; } +if ${newlib_cv_nds32_fpu_sp+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if (__NDS32_EXT_FPU_SP__) # error "Has nds32 FPU SP extension support" @@ -12135,13 +12140,21 @@ main () } _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : - has_nds32_fpu_sp="no" + newlib_cv_nds32_fpu_sp="no" else - has_nds32_fpu_sp="yes" + newlib_cv_nds32_fpu_sp="yes" fi rm -f conftest.err conftest.i conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $newlib_cv_nds32_fpu_sp" >&5 +$as_echo "$newlib_cv_nds32_fpu_sp" >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nds32 FPU DP extension" >&5 +$as_echo_n "checking for nds32 FPU DP extension... " >&6; } +if ${newlib_cv_nds32_fpu_dp+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if (__NDS32_EXT_FPU_DP__) # error "Has nds32 FPU DP extension support" @@ -12156,14 +12169,17 @@ main () } _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : - has_nds32_fpu_dp="no" + newlib_cv_nds32_fpu_dp="no" else - has_nds32_fpu_dp="yes" + newlib_cv_nds32_fpu_dp="yes" fi rm -f conftest.err conftest.i conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $newlib_cv_nds32_fpu_dp" >&5 +$as_echo "$newlib_cv_nds32_fpu_dp" >&6; } +fi - if test "$has_nds32_fpu_sp" = "yes"; then + if test "$newlib_cv_nds32_fpu_sp" = "yes"; then HAS_NDS32_FPU_SP_TRUE= HAS_NDS32_FPU_SP_FALSE='#' else @@ -12171,7 +12187,7 @@ else HAS_NDS32_FPU_SP_FALSE= fi - if test "$has_nds32_fpu_dp" = "yes"; then + if test "$newlib_cv_nds32_fpu_dp" = "yes"; then HAS_NDS32_FPU_DP_TRUE= HAS_NDS32_FPU_DP_FALSE='#' else diff --git a/newlib/libm/machine/nds32/acinclude.m4 b/newlib/libm/machine/nds32/acinclude.m4 index 6363df8..781fa91 100644 --- a/newlib/libm/machine/nds32/acinclude.m4 +++ b/newlib/libm/machine/nds32/acinclude.m4 @@ -1,17 +1,19 @@ if test "${libm_machine_dir}" = "nds32"; then dnl Use builtin macro to detect if FPU extension support is on. - AC_PREPROC_IFELSE([AC_LANG_PROGRAM( + AC_CACHE_CHECK([for nds32 FPU SP extension], newlib_cv_nds32_fpu_sp, [dnl + AC_PREPROC_IFELSE([AC_LANG_PROGRAM( [[#if (__NDS32_EXT_FPU_SP__) # error "Has nds32 FPU SP extension support" #endif -]])], [has_nds32_fpu_sp="no"], [has_nds32_fpu_sp="yes"]) +]])], [newlib_cv_nds32_fpu_sp="no"], [newlib_cv_nds32_fpu_sp="yes"])]) - AC_PREPROC_IFELSE([AC_LANG_PROGRAM( + AC_CACHE_CHECK([for nds32 FPU DP extension], newlib_cv_nds32_fpu_dp, [dnl + AC_PREPROC_IFELSE([AC_LANG_PROGRAM( [[#if (__NDS32_EXT_FPU_DP__) # error "Has nds32 FPU DP extension support" #endif -]])], [has_nds32_fpu_dp="no"], [has_nds32_fpu_dp="yes"]) +]])], [newlib_cv_nds32_fpu_dp="no"], [newlib_cv_nds32_fpu_dp="yes"])]) fi -AM_CONDITIONAL(HAS_NDS32_FPU_SP, test "$has_nds32_fpu_sp" = "yes") -AM_CONDITIONAL(HAS_NDS32_FPU_DP, test "$has_nds32_fpu_dp" = "yes") +AM_CONDITIONAL(HAS_NDS32_FPU_SP, test "$newlib_cv_nds32_fpu_sp" = "yes") +AM_CONDITIONAL(HAS_NDS32_FPU_DP, test "$newlib_cv_nds32_fpu_dp" = "yes") |