Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] sim: use AC_REQUIRE with AC_PROG_CC
@ 2011-07-11 23:32 Mike Frysinger
  2011-10-17 17:01 ` Joel Brobecker
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Frysinger @ 2011-07-11 23:32 UTC (permalink / raw)
  To: gdb-patches; +Cc: toolchain-devel

The autoconf guys point out that our usage of AC_PROG_CC in the
SIM_AC_COMMON does not jive with their intended use.
	http://www.gnu.org/software/autoconf/manual/autoconf.html#Expanded-Before-Required

So utilize AC_REQUIRE to make the warnings go away and generate
the correct code with different autoconf versions.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

2011-07-11  Mike Frysinger  <vapier@gentoo.org>

	* aclocal.m4 (SIM_AC_COMMON): Call AC_REQUIRE on AC_PROG_CC.
	Delete direct call to AC_PROG_CC.
---
 sim/common/aclocal.m4 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sim/common/aclocal.m4 b/sim/common/aclocal.m4
index 264cced..3ed5efd 100644
--- a/sim/common/aclocal.m4
+++ b/sim/common/aclocal.m4
@@ -24,11 +24,11 @@ sinclude([../../config/zlib.m4])
 
 AC_DEFUN([SIM_AC_COMMON],
 [
+AC_REQUIRE([AC_PROG_CC])
 # autoconf.info says this should be called right after AC_INIT.
 AC_CONFIG_HEADER(ifelse([$1],,config.h,[$1]):config.in)
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
-AC_PROG_CC
 AC_PROG_INSTALL
 
 # Put a plausible default for CC_FOR_BUILD in Makefile.
-- 
1.7.6


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

* Re: [PATCH] sim: use AC_REQUIRE with AC_PROG_CC
  2011-07-11 23:32 [PATCH] sim: use AC_REQUIRE with AC_PROG_CC Mike Frysinger
@ 2011-10-17 17:01 ` Joel Brobecker
  2011-10-17 17:17   ` Mike Frysinger
  0 siblings, 1 reply; 5+ messages in thread
From: Joel Brobecker @ 2011-10-17 17:01 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb-patches, toolchain-devel

> 2011-07-11  Mike Frysinger  <vapier@gentoo.org>
> 
> 	* aclocal.m4 (SIM_AC_COMMON): Call AC_REQUIRE on AC_PROG_CC.
> 	Delete direct call to AC_PROG_CC.

Looks, OK, except why did you move the call up?

Looking at the autoconf documentation, AC_CONFIG_HEADER does not need
to be called right after AC_INIT, it is only customary. So if there is
a reason for us to change the location of the use of AC_PROG_CC, we
probably want to fix the comment as well.

> ---
>  sim/common/aclocal.m4 |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/sim/common/aclocal.m4 b/sim/common/aclocal.m4
> index 264cced..3ed5efd 100644
> --- a/sim/common/aclocal.m4
> +++ b/sim/common/aclocal.m4
> @@ -24,11 +24,11 @@ sinclude([../../config/zlib.m4])
>  
>  AC_DEFUN([SIM_AC_COMMON],
>  [
> +AC_REQUIRE([AC_PROG_CC])
>  # autoconf.info says this should be called right after AC_INIT.
>  AC_CONFIG_HEADER(ifelse([$1],,config.h,[$1]):config.in)
>  AC_CANONICAL_SYSTEM
>  AC_ARG_PROGRAM
> -AC_PROG_CC
>  AC_PROG_INSTALL
>  
>  # Put a plausible default for CC_FOR_BUILD in Makefile.
> -- 
> 1.7.6

-- 
Joel


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

* Re: [PATCH] sim: use AC_REQUIRE with AC_PROG_CC
  2011-10-17 17:01 ` Joel Brobecker
@ 2011-10-17 17:17   ` Mike Frysinger
  2011-10-17 18:23     ` Joel Brobecker
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Frysinger @ 2011-10-17 17:17 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches, toolchain-devel

On Monday 17 October 2011 12:57:24 Joel Brobecker wrote:
> > 2011-07-11  Mike Frysinger  <vapier@gentoo.org>
> > 
> > 	* aclocal.m4 (SIM_AC_COMMON): Call AC_REQUIRE on AC_PROG_CC.
> > 	Delete direct call to AC_PROG_CC.
> 
> Looks, OK, except why did you move the call up?
> 
> Looking at the autoconf documentation, AC_CONFIG_HEADER does not need
> to be called right after AC_INIT, it is only customary. So if there is
> a reason for us to change the location of the use of AC_PROG_CC, we
> probably want to fix the comment as well.

i don't think there is a requirement for the AC_REQUIRE to be where it is; 
i'll have to double check.  the reason i moved it is that the convention i've 
seen when reading other GNU projects is to put unconditional AC_REQUIRE calls 
at the top of m4 defines.  SIM_AC_COMMON is probably a bit of a special case 
though due to it mostly being the normal configure.ac file.

i can move it back if you like (and i verify that it works fine).
-mike


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

* Re: [PATCH] sim: use AC_REQUIRE with AC_PROG_CC
  2011-10-17 17:17   ` Mike Frysinger
@ 2011-10-17 18:23     ` Joel Brobecker
  0 siblings, 0 replies; 5+ messages in thread
From: Joel Brobecker @ 2011-10-17 18:23 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb-patches, toolchain-devel

> i don't think there is a requirement for the AC_REQUIRE to be where it is; 
> i'll have to double check.  the reason i moved it is that the convention i've 
> seen when reading other GNU projects is to put unconditional AC_REQUIRE calls 
> at the top of m4 defines.  SIM_AC_COMMON is probably a bit of a special case 
> though due to it mostly being the normal configure.ac file.
> 
> i can move it back if you like (and i verify that it works fine).

Nah, that's Ok. The comment right after is what prompted the question,
and it is a bit misleading. I'd just remove it (as a follow up patch)
I think, it doesn't bring anything anyway.

-- 
Joel


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

* Re: [PATCH] sim: use AC_REQUIRE with AC_PROG_CC
       [not found] <1310418640-32168-1-git-send-email-vapier__8759.03008641235$1310418652$gmane$org@gentoo.org>
@ 2011-07-12 19:48 ` Tom Tromey
  0 siblings, 0 replies; 5+ messages in thread
From: Tom Tromey @ 2011-07-12 19:48 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb-patches, toolchain-devel

>>>>> "Mike" == Mike Frysinger <vapier@gentoo.org> writes:

Mike> 2011-07-11  Mike Frysinger  <vapier@gentoo.org>
Mike> 	* aclocal.m4 (SIM_AC_COMMON): Call AC_REQUIRE on AC_PROG_CC.
Mike> 	Delete direct call to AC_PROG_CC.

Ok.

Tom


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

end of thread, other threads:[~2011-10-17 17:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-11 23:32 [PATCH] sim: use AC_REQUIRE with AC_PROG_CC Mike Frysinger
2011-10-17 17:01 ` Joel Brobecker
2011-10-17 17:17   ` Mike Frysinger
2011-10-17 18:23     ` Joel Brobecker
     [not found] <1310418640-32168-1-git-send-email-vapier__8759.03008641235$1310418652$gmane$org@gentoo.org>
2011-07-12 19:48 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox