public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] newlib: update nds32 configure checks
@ 2022-01-23  1:39 Mike Frysinger
  2022-01-23  5:25 ` [PATCH] newlib: update preprocessor " Mike Frysinger
  2022-01-24 16:39 ` [PATCH] newlib: update nds32 " Corinna Vinschen
  0 siblings, 2 replies; 4+ messages in thread
From: Mike Frysinger @ 2022-01-23  1:39 UTC (permalink / raw)
  To: newlib

This subdir doesn't link any code, so there's no need to require
AC_NO_EXECUTABLES, and no other dir uses this either.  Punt it.

The two tests in here are using compile tests to look for some
preprocessor defines, but we don't need to compile the code,
just preprocess it.  So switch to AC_PREPROC_IFELSE.
---
 newlib/libm/machine/nds32/Makefile.in  |   1 +
 newlib/libm/machine/nds32/configure    | 266 +++++++++++++++++--------
 newlib/libm/machine/nds32/configure.ac |   5 +-
 3 files changed, 186 insertions(+), 86 deletions(-)
 mode change 100644 => 100755 newlib/libm/machine/nds32/configure

diff --git a/newlib/libm/machine/nds32/configure.ac b/newlib/libm/machine/nds32/configure.ac
index 7d49c9ae20bf..d4c5f49a2625 100644
--- a/newlib/libm/machine/nds32/configure.ac
+++ b/newlib/libm/machine/nds32/configure.ac
@@ -11,8 +11,7 @@ NEWLIB_CONFIGURE(../../..)
 
 
 dnl Use builtin macro to detect if FPU extension support is on.
-AC_NO_EXECUTABLES
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
 [[#if (__NDS32_EXT_FPU_SP__)
 warning: Has nds32 FPU SP extension support
 #endif
@@ -21,7 +20,7 @@ warning: Has nds32 FPU SP extension support
 		  [has_nds32_fpu_sp="yes"])
 AM_CONDITIONAL(HAS_NDS32_FPU_SP, test "$has_nds32_fpu_sp" = "yes")
 
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
 [[#if (__NDS32_EXT_FPU_DP__)
 warning: Has nds32 FPU DP extension support
 #endif
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] newlib: update preprocessor configure checks
  2022-01-23  1:39 [PATCH] newlib: update nds32 configure checks Mike Frysinger
@ 2022-01-23  5:25 ` Mike Frysinger
  2022-01-24 16:39   ` Corinna Vinschen
  2022-01-24 16:39 ` [PATCH] newlib: update nds32 " Corinna Vinschen
  1 sibling, 1 reply; 4+ messages in thread
From: Mike Frysinger @ 2022-01-23  5:25 UTC (permalink / raw)
  To: newlib

The nds32 & spu dirs are using compile tests to look for some
preprocessor defines, but we don't need to compile the code,
just preprocess it.  So switch to AC_PREPROC_IFELSE.

The sh dir is using a preprocessor test via grep, but let's
switch it to AC_PREPROC_IFELSE too to be consistent.

This should allow us to drop the uncommon AC_NO_EXECUTABLES call.
---
 newlib/libc/machine/nds32/Makefile.in  |    1 +
 newlib/libc/machine/nds32/configure    |  264 +++--
 newlib/libc/machine/nds32/configure.ac |    9 +-
 newlib/libc/machine/sh/Makefile.in     |    2 -
 newlib/libc/machine/sh/configure       |  232 +----
 newlib/libc/machine/sh/configure.ac    |   10 +-
 newlib/libc/machine/spu/Makefile.in    |    6 +
 newlib/libc/machine/spu/aclocal.m4     |   64 ++
 newlib/libc/machine/spu/configure      | 1318 +++++++++++++++++++++---
 newlib/libc/machine/spu/configure.ac   |   15 +-
 newlib/libm/machine/nds32/Makefile.in  |    1 +
 newlib/libm/machine/nds32/configure    |  270 +++--
 newlib/libm/machine/nds32/configure.ac |   17 +-
 13 files changed, 1656 insertions(+), 553 deletions(-)
 mode change 100644 => 100755 newlib/libm/machine/nds32/configure

diff --git a/newlib/libc/machine/nds32/configure.ac b/newlib/libc/machine/nds32/configure.ac
index f22358945c1f..de3d328491e7 100644
--- a/newlib/libc/machine/nds32/configure.ac
+++ b/newlib/libc/machine/nds32/configure.ac
@@ -10,14 +10,11 @@ AC_CONFIG_AUX_DIR(../../../..)
 NEWLIB_CONFIGURE(../../..)
 
 dnl Use builtin macro to detect if this is for "AndeStar ISA V3m".
-AC_NO_EXECUTABLES
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
 [[#ifdef __NDS32_ISA_V3M__
-warning: This is nds32_isa_v3m.
+# error "This is nds32_isa_v3m."
 #endif
-]])],
-		  [is_nds32_isa_v3m="no"],
-		  [is_nds32_isa_v3m="yes"])
+]])], [is_nds32_isa_v3m="no"], [is_nds32_isa_v3m="yes"])
 AM_CONDITIONAL(IS_NDS32_ISA_V3M, test "$is_nds32_isa_v3m" = "yes")
 
 
diff --git a/newlib/libc/machine/sh/configure.ac b/newlib/libc/machine/sh/configure.ac
index c7dd78926d3f..838bef0d7087 100644
--- a/newlib/libc/machine/sh/configure.ac
+++ b/newlib/libc/machine/sh/configure.ac
@@ -7,15 +7,13 @@ AC_CONFIG_SRCDIR([asm.h])
 dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. 
 AC_CONFIG_AUX_DIR(../../../..)
 
-AC_NO_EXECUTABLES
-
 NEWLIB_CONFIGURE(../../..)
 
-AC_EGREP_CPP([sh5], [
-#if __SH5__
-  sh5
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
+[[#if !defined(__SH5__)
+# error "not SH5"
 #endif
-], [have_sh64=yes], [have_sh64=no])
+]])], [have_sh64=yes], [have_sh64=no])
 AM_CONDITIONAL(SH64, [test $have_sh64 = yes])
 
 AC_CONFIG_FILES([Makefile])
diff --git a/newlib/libc/machine/spu/configure.ac b/newlib/libc/machine/spu/configure.ac
index 5567df048bb5..a6d19a7c67d0 100644
--- a/newlib/libc/machine/spu/configure.ac
+++ b/newlib/libc/machine/spu/configure.ac
@@ -10,18 +10,11 @@ AC_CONFIG_AUX_DIR(../../../..)
 NEWLIB_CONFIGURE(../../..)
 
 AC_MSG_CHECKING([whether the compiler supports __ea])
-dnl We do not use AC_COMPILE_IFELSE to support building newlib with
-dnl a cross-compiler that is not (yet) able to link executables
-cat > conftest.c <<EOF
-#if defined (__EA32__) || defined (__EA64__)
-  yes;
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
+[[#if !defined (__EA32__) && !defined (__EA64__)
+# error "__ea not supported"
 #endif
-EOF
-if AC_TRY_COMMAND(${CC-cc} -E conftest.c) | egrep yes >/dev/null 2>&1; then
-  spu_compiler_has_ea=yes
-else
-  spu_compiler_has_ea=no
-fi
+]])], [spu_compiler_has_ea=yes], [spu_compiler_has_ea=no])
 AM_CONDITIONAL(HAVE_SPU_EA, test x${spu_compiler_has_ea} != xno)
 AC_MSG_RESULT($spu_compiler_has_ea)
 
diff --git a/newlib/libm/machine/nds32/configure.ac b/newlib/libm/machine/nds32/configure.ac
index 7d49c9ae20bf..e3589a0729ea 100644
--- a/newlib/libm/machine/nds32/configure.ac
+++ b/newlib/libm/machine/nds32/configure.ac
@@ -11,23 +11,18 @@ NEWLIB_CONFIGURE(../../..)
 
 
 dnl Use builtin macro to detect if FPU extension support is on.
-AC_NO_EXECUTABLES
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
 [[#if (__NDS32_EXT_FPU_SP__)
-warning: Has nds32 FPU SP extension support
+# error "Has nds32 FPU SP extension support"
 #endif
-]])],
-                  [has_nds32_fpu_sp="no"],
-		  [has_nds32_fpu_sp="yes"])
+]])], [has_nds32_fpu_sp="no"], [has_nds32_fpu_sp="yes"])
 AM_CONDITIONAL(HAS_NDS32_FPU_SP, test "$has_nds32_fpu_sp" = "yes")
 
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
 [[#if (__NDS32_EXT_FPU_DP__)
-warning: Has nds32 FPU DP extension support
+# error "Has nds32 FPU DP extension support"
 #endif
-]])],
-                  [has_nds32_fpu_dp="no"],
-		  [has_nds32_fpu_dp="yes"])
+]])], [has_nds32_fpu_dp="no"], [has_nds32_fpu_dp="yes"])
 AM_CONDITIONAL(HAS_NDS32_FPU_DP, test "$has_nds32_fpu_dp" = "yes")
 
 AC_CONFIG_FILES([Makefile])
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] newlib: update nds32 configure checks
  2022-01-23  1:39 [PATCH] newlib: update nds32 configure checks Mike Frysinger
  2022-01-23  5:25 ` [PATCH] newlib: update preprocessor " Mike Frysinger
@ 2022-01-24 16:39 ` Corinna Vinschen
  1 sibling, 0 replies; 4+ messages in thread
From: Corinna Vinschen @ 2022-01-24 16:39 UTC (permalink / raw)
  To: newlib

On Jan 22 20:39, Mike Frysinger wrote:
> This subdir doesn't link any code, so there's no need to require
> AC_NO_EXECUTABLES, and no other dir uses this either.  Punt it.
> 
> The two tests in here are using compile tests to look for some
> preprocessor defines, but we don't need to compile the code,
> just preprocess it.  So switch to AC_PREPROC_IFELSE.
> ---
>  newlib/libm/machine/nds32/Makefile.in  |   1 +
>  newlib/libm/machine/nds32/configure    | 266 +++++++++++++++++--------
>  newlib/libm/machine/nds32/configure.ac |   5 +-
>  3 files changed, 186 insertions(+), 86 deletions(-)
>  mode change 100644 => 100755 newlib/libm/machine/nds32/configure

LGTM

Thanks,
Corinna


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] newlib: update preprocessor configure checks
  2022-01-23  5:25 ` [PATCH] newlib: update preprocessor " Mike Frysinger
@ 2022-01-24 16:39   ` Corinna Vinschen
  0 siblings, 0 replies; 4+ messages in thread
From: Corinna Vinschen @ 2022-01-24 16:39 UTC (permalink / raw)
  To: newlib

On Jan 23 00:25, Mike Frysinger wrote:
> The nds32 & spu dirs are using compile tests to look for some
> preprocessor defines, but we don't need to compile the code,
> just preprocess it.  So switch to AC_PREPROC_IFELSE.
> 
> The sh dir is using a preprocessor test via grep, but let's
> switch it to AC_PREPROC_IFELSE too to be consistent.
> 
> This should allow us to drop the uncommon AC_NO_EXECUTABLES call.
> ---
>  newlib/libc/machine/nds32/Makefile.in  |    1 +
>  newlib/libc/machine/nds32/configure    |  264 +++--
>  newlib/libc/machine/nds32/configure.ac |    9 +-
>  newlib/libc/machine/sh/Makefile.in     |    2 -
>  newlib/libc/machine/sh/configure       |  232 +----
>  newlib/libc/machine/sh/configure.ac    |   10 +-
>  newlib/libc/machine/spu/Makefile.in    |    6 +
>  newlib/libc/machine/spu/aclocal.m4     |   64 ++
>  newlib/libc/machine/spu/configure      | 1318 +++++++++++++++++++++---
>  newlib/libc/machine/spu/configure.ac   |   15 +-
>  newlib/libm/machine/nds32/Makefile.in  |    1 +
>  newlib/libm/machine/nds32/configure    |  270 +++--
>  newlib/libm/machine/nds32/configure.ac |   17 +-
>  13 files changed, 1656 insertions(+), 553 deletions(-)
>  mode change 100644 => 100755 newlib/libm/machine/nds32/configure

LGTM


Thanks,
Corinna


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-24 16:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-23  1:39 [PATCH] newlib: update nds32 configure checks Mike Frysinger
2022-01-23  5:25 ` [PATCH] newlib: update preprocessor " Mike Frysinger
2022-01-24 16:39   ` Corinna Vinschen
2022-01-24 16:39 ` [PATCH] newlib: update nds32 " Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).