public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] configure: cache result of "sys/sdt.h" header check
@ 2022-03-14 17:38 David Seifert
  2022-03-24 13:26 ` David Seifert
  0 siblings, 1 reply; 3+ messages in thread
From: David Seifert @ 2022-03-14 17:38 UTC (permalink / raw)
  To: gcc-patches; +Cc: David Seifert

Use AC_CACHE_CHECK to store the result of the header check for
systemtap's "sys/sdt.h", which is similar in spirit to libstdc++'s
AC_CACHE_CHECK(..., glibcxx_cv_sys_sdt_h).

gcc/
        * configure.ac: Add AC_CACHE_CHECK(..., gcc_cv_sys_sdt_h).
        * configure: Regenerate.
---
 gcc/configure    | 20 +++++++++++++++-----
 gcc/configure.ac | 16 +++++++++-------
 2 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/gcc/configure b/gcc/configure
index 14b19c8fe0c..1dfc5cc7344 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -31389,15 +31389,25 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5
 $as_echo_n "checking sys/sdt.h in the target C library... " >&6; }
-have_sys_sdt_h=no
-if test -f $target_header_dir/sys/sdt.h; then
-  have_sys_sdt_h=yes
+if ${gcc_cv_sys_sdt_h+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  gcc_cv_sys_sdt_h=no
+  if test -f $target_header_dir/sys/sdt.h; then
+    gcc_cv_sys_sdt_h=yes
+  fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_sys_sdt_h" >&5
+$as_echo "$gcc_cv_sys_sdt_h" >&6; }
+if test x$gcc_cv_sys_sdt_h = xyes; then :
+
 
 $as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
 
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5
-$as_echo "$have_sys_sdt_h" >&6; }
 
 # Check if TFmode long double should be used by default or not.
 # Some glibc targets used DFmode long double, but with glibc 2.4
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 90cad309762..c86ce5e0a9b 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -6904,14 +6904,16 @@ AC_SUBST([enable_default_ssp])
 
 # Test for <sys/sdt.h> on the target.
 GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H])
-AC_MSG_CHECKING(sys/sdt.h in the target C library)
-have_sys_sdt_h=no
-if test -f $target_header_dir/sys/sdt.h; then
-  have_sys_sdt_h=yes
-  AC_DEFINE(HAVE_SYS_SDT_H, 1,
+AC_CACHE_CHECK([sys/sdt.h in the target C library], [gcc_cv_sys_sdt_h], [
+  gcc_cv_sys_sdt_h=no
+  if test -f $target_header_dir/sys/sdt.h; then
+    gcc_cv_sys_sdt_h=yes
+  fi
+])
+AS_IF([test x$gcc_cv_sys_sdt_h = xyes], [
+  AC_DEFINE([HAVE_SYS_SDT_H], [1],
             [Define if your target C library provides sys/sdt.h])
-fi
-AC_MSG_RESULT($have_sys_sdt_h)
+])
 
 # Check if TFmode long double should be used by default or not.
 # Some glibc targets used DFmode long double, but with glibc 2.4
-- 
2.35.1


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

* Re: [PATCH] configure: cache result of "sys/sdt.h" header check
  2022-03-14 17:38 [PATCH] configure: cache result of "sys/sdt.h" header check David Seifert
@ 2022-03-24 13:26 ` David Seifert
  2022-05-24 14:48   ` Eric Gallager
  0 siblings, 1 reply; 3+ messages in thread
From: David Seifert @ 2022-03-24 13:26 UTC (permalink / raw)
  To: gcc-patches; +Cc: jakub

On Mon, 2022-03-14 at 18:38 +0100, David Seifert wrote:
> Use AC_CACHE_CHECK to store the result of the header check for
> systemtap's "sys/sdt.h", which is similar in spirit to libstdc++'s
> AC_CACHE_CHECK(..., glibcxx_cv_sys_sdt_h).
> 
> gcc/
>         * configure.ac: Add AC_CACHE_CHECK(..., gcc_cv_sys_sdt_h).
>         * configure: Regenerate.
> ---
>  gcc/configure    | 20 +++++++++++++++-----
>  gcc/configure.ac | 16 +++++++++-------
>  2 files changed, 24 insertions(+), 12 deletions(-)
> 
> diff --git a/gcc/configure b/gcc/configure
> index 14b19c8fe0c..1dfc5cc7344 100755
> --- a/gcc/configure
> +++ b/gcc/configure
> @@ -31389,15 +31389,25 @@ fi
>  
>  { $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the
> target C library" >&5
>  $as_echo_n "checking sys/sdt.h in the target C library... " >&6; }
> -have_sys_sdt_h=no
> -if test -f $target_header_dir/sys/sdt.h; then
> -  have_sys_sdt_h=yes
> +if ${gcc_cv_sys_sdt_h+:} false; then :
> +  $as_echo_n "(cached) " >&6
> +else
> +
> +  gcc_cv_sys_sdt_h=no
> +  if test -f $target_header_dir/sys/sdt.h; then
> +    gcc_cv_sys_sdt_h=yes
> +  fi
> +
> +fi
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_sys_sdt_h"
> >&5
> +$as_echo "$gcc_cv_sys_sdt_h" >&6; }
> +if test x$gcc_cv_sys_sdt_h = xyes; then :
> +
>  
>  $as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
>  
> +
>  fi
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5
> -$as_echo "$have_sys_sdt_h" >&6; }
>  
>  # Check if TFmode long double should be used by default or not.
>  # Some glibc targets used DFmode long double, but with glibc 2.4
> diff --git a/gcc/configure.ac b/gcc/configure.ac
> index 90cad309762..c86ce5e0a9b 100644
> --- a/gcc/configure.ac
> +++ b/gcc/configure.ac
> @@ -6904,14 +6904,16 @@ AC_SUBST([enable_default_ssp])
>  
>  # Test for <sys/sdt.h> on the target.
>  GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H])
> -AC_MSG_CHECKING(sys/sdt.h in the target C library)
> -have_sys_sdt_h=no
> -if test -f $target_header_dir/sys/sdt.h; then
> -  have_sys_sdt_h=yes
> -  AC_DEFINE(HAVE_SYS_SDT_H, 1,
> +AC_CACHE_CHECK([sys/sdt.h in the target C library],
> [gcc_cv_sys_sdt_h], [
> +  gcc_cv_sys_sdt_h=no
> +  if test -f $target_header_dir/sys/sdt.h; then
> +    gcc_cv_sys_sdt_h=yes
> +  fi
> +])
> +AS_IF([test x$gcc_cv_sys_sdt_h = xyes], [
> +  AC_DEFINE([HAVE_SYS_SDT_H], [1],
>              [Define if your target C library provides sys/sdt.h])
> -fi
> -AC_MSG_RESULT($have_sys_sdt_h)
> +])
>  
>  # Check if TFmode long double should be used by default or not.
>  # Some glibc targets used DFmode long double, but with glibc 2.4

Ping, I think we agreed making this a cache variable is fine (which is
how libstdc++ also does it).


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

* Re: [PATCH] configure: cache result of "sys/sdt.h" header check
  2022-03-24 13:26 ` David Seifert
@ 2022-05-24 14:48   ` Eric Gallager
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Gallager @ 2022-05-24 14:48 UTC (permalink / raw)
  To: David Seifert; +Cc: gcc-patches, Jakub Jelinek

On Thu, Mar 24, 2022 at 9:27 AM David Seifert via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> On Mon, 2022-03-14 at 18:38 +0100, David Seifert wrote:
> > Use AC_CACHE_CHECK to store the result of the header check for
> > systemtap's "sys/sdt.h", which is similar in spirit to libstdc++'s
> > AC_CACHE_CHECK(..., glibcxx_cv_sys_sdt_h).
> >
> > gcc/
> >         * configure.ac: Add AC_CACHE_CHECK(..., gcc_cv_sys_sdt_h).
> >         * configure: Regenerate.
> > ---
> >  gcc/configure    | 20 +++++++++++++++-----
> >  gcc/configure.ac | 16 +++++++++-------
> >  2 files changed, 24 insertions(+), 12 deletions(-)
> >
> > diff --git a/gcc/configure b/gcc/configure
> > index 14b19c8fe0c..1dfc5cc7344 100755
> > --- a/gcc/configure
> > +++ b/gcc/configure
> > @@ -31389,15 +31389,25 @@ fi
> >
> >  { $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the
> > target C library" >&5
> >  $as_echo_n "checking sys/sdt.h in the target C library... " >&6; }
> > -have_sys_sdt_h=no
> > -if test -f $target_header_dir/sys/sdt.h; then
> > -  have_sys_sdt_h=yes
> > +if ${gcc_cv_sys_sdt_h+:} false; then :
> > +  $as_echo_n "(cached) " >&6
> > +else
> > +
> > +  gcc_cv_sys_sdt_h=no
> > +  if test -f $target_header_dir/sys/sdt.h; then
> > +    gcc_cv_sys_sdt_h=yes
> > +  fi
> > +
> > +fi
> > +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_sys_sdt_h"
> > >&5
> > +$as_echo "$gcc_cv_sys_sdt_h" >&6; }
> > +if test x$gcc_cv_sys_sdt_h = xyes; then :
> > +
> >
> >  $as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
> >
> > +
> >  fi
> > -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5
> > -$as_echo "$have_sys_sdt_h" >&6; }
> >
> >  # Check if TFmode long double should be used by default or not.
> >  # Some glibc targets used DFmode long double, but with glibc 2.4
> > diff --git a/gcc/configure.ac b/gcc/configure.ac
> > index 90cad309762..c86ce5e0a9b 100644
> > --- a/gcc/configure.ac
> > +++ b/gcc/configure.ac
> > @@ -6904,14 +6904,16 @@ AC_SUBST([enable_default_ssp])
> >
> >  # Test for <sys/sdt.h> on the target.
> >  GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H])
> > -AC_MSG_CHECKING(sys/sdt.h in the target C library)
> > -have_sys_sdt_h=no
> > -if test -f $target_header_dir/sys/sdt.h; then
> > -  have_sys_sdt_h=yes
> > -  AC_DEFINE(HAVE_SYS_SDT_H, 1,
> > +AC_CACHE_CHECK([sys/sdt.h in the target C library],
> > [gcc_cv_sys_sdt_h], [
> > +  gcc_cv_sys_sdt_h=no
> > +  if test -f $target_header_dir/sys/sdt.h; then
> > +    gcc_cv_sys_sdt_h=yes
> > +  fi
> > +])
> > +AS_IF([test x$gcc_cv_sys_sdt_h = xyes], [
> > +  AC_DEFINE([HAVE_SYS_SDT_H], [1],
> >              [Define if your target C library provides sys/sdt.h])
> > -fi
> > -AC_MSG_RESULT($have_sys_sdt_h)
> > +])
> >
> >  # Check if TFmode long double should be used by default or not.
> >  # Some glibc targets used DFmode long double, but with glibc 2.4
>
> Ping, I think we agreed making this a cache variable is fine (which is
> how libstdc++ also does it).
>

So wait does this supersede the one adding a configure flag for it?
i.e.: https://gcc.gnu.org/pipermail/gcc-patches/2022-March/591704.html

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

end of thread, other threads:[~2022-05-24 14:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-14 17:38 [PATCH] configure: cache result of "sys/sdt.h" header check David Seifert
2022-03-24 13:26 ` David Seifert
2022-05-24 14:48   ` Eric Gallager

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).