diff mbox

[3/9] Print out progress when checking compiler flags

Message ID 1333363816-1691-4-git-send-email-berrange@redhat.com
State New
Headers show

Commit Message

Daniel P. Berrangé April 2, 2012, 10:50 a.m. UTC
From: "Daniel P. Berrange" <berrange@redhat.com>

Normal practice for autoconf style scripts is to print out
progress. The QEMU configure script is getting increasingly
slow & has no progress feedback. Print out the progress of
checking each compiler flag

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 configure |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Comments

Peter Maydell April 2, 2012, 1:56 p.m. UTC | #1
On 2 April 2012 11:50, Daniel P. Berrange <berrange@redhat.com> wrote:
> From: "Daniel P. Berrange" <berrange@redhat.com>
>
> Normal practice for autoconf style scripts is to print out
> progress. The QEMU configure script is getting increasingly
> slow & has no progress feedback. Print out the progress of
> checking each compiler flag
>
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
>  configure |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/configure b/configure
> index 64ab4dc..44b28c8 100755
> --- a/configure
> +++ b/configure
> @@ -1170,8 +1170,12 @@ int main(void) { return 0; }
>  EOF
>  warning_flags=
>  for flag in $gcc_flags; do
> +    echo -n "checking if $cc supports $flag... "
>     if compile_prog "-Werror $warning_flags $flag" "" ; then
>        warning_flags="$warning_flags $flag"
> +       echo "yes"
> +    else
> +       echo "no"
>     fi
>  done
>  QEMU_CFLAGS="$QEMU_CFLAGS $warning_flags"

If we're going to do this we should do it consistently,
ie add messages for all tests, not just this one.
(Bonus points for also adding messages to config.log so you
can see which test compiles correspond to which feature tests.)

(Also, "echo -n" isn't portable; we use printf where we don't
want the trailing newline.)

-- PMM
Daniel P. Berrangé April 2, 2012, 2 p.m. UTC | #2
On Mon, Apr 02, 2012 at 02:56:17PM +0100, Peter Maydell wrote:
> On 2 April 2012 11:50, Daniel P. Berrange <berrange@redhat.com> wrote:
> > From: "Daniel P. Berrange" <berrange@redhat.com>
> >
> > Normal practice for autoconf style scripts is to print out
> > progress. The QEMU configure script is getting increasingly
> > slow & has no progress feedback. Print out the progress of
> > checking each compiler flag
> >
> > Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> > ---
> >  configure |    4 ++++
> >  1 files changed, 4 insertions(+), 0 deletions(-)
> >
> > diff --git a/configure b/configure
> > index 64ab4dc..44b28c8 100755
> > --- a/configure
> > +++ b/configure
> > @@ -1170,8 +1170,12 @@ int main(void) { return 0; }
> >  EOF
> >  warning_flags=
> >  for flag in $gcc_flags; do
> > +    echo -n "checking if $cc supports $flag... "
> >     if compile_prog "-Werror $warning_flags $flag" "" ; then
> >        warning_flags="$warning_flags $flag"
> > +       echo "yes"
> > +    else
> > +       echo "no"
> >     fi
> >  done
> >  QEMU_CFLAGS="$QEMU_CFLAGS $warning_flags"
> 
> If we're going to do this we should do it consistently,
> ie add messages for all tests, not just this one.
> (Bonus points for also adding messages to config.log so you
> can see which test compiles correspond to which feature tests.)

I did wonder about doing that. If people are generally for the idea of
adding progress messages throughout configure, then I'll make some time
to work on that.

Don't want to spend all the effort if such a patch is going to get rejected
though...

Any further opinions for/against ?

Regards,
Daniel
Stefan Weil April 2, 2012, 4:31 p.m. UTC | #3
Am 02.04.2012 12:50, schrieb Daniel P. Berrange:
> From: "Daniel P. Berrange"<berrange@redhat.com>
>
> Normal practice for autoconf style scripts is to print out
> progress. The QEMU configure script is getting increasingly
> slow&  has no progress feedback. Print out the progress of
> checking each compiler flag
>
> Signed-off-by: Daniel P. Berrange<berrange@redhat.com>
> ---
>   configure |    4 ++++
>   1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/configure b/configure
> index 64ab4dc..44b28c8 100755
> --- a/configure
> +++ b/configure
> @@ -1170,8 +1170,12 @@ int main(void) { return 0; }
>   EOF
>   warning_flags=
>   for flag in $gcc_flags; do
> +    echo -n "checking if $cc supports $flag... "
>       if compile_prog "-Werror $warning_flags $flag" "" ; then
>   	warning_flags="$warning_flags $flag"
> +	echo "yes"
> +    else
> +	echo "no"
>       fi
>   done
>   QEMU_CFLAGS="$QEMU_CFLAGS $warning_flags"

This is not needed if we check all flags in a single step
(see my comment to patch 1/9).

IMHO, configure should not print progress feedback by default.
diff mbox

Patch

diff --git a/configure b/configure
index 64ab4dc..44b28c8 100755
--- a/configure
+++ b/configure
@@ -1170,8 +1170,12 @@  int main(void) { return 0; }
 EOF
 warning_flags=
 for flag in $gcc_flags; do
+    echo -n "checking if $cc supports $flag... "
     if compile_prog "-Werror $warning_flags $flag" "" ; then
 	warning_flags="$warning_flags $flag"
+	echo "yes"
+    else
+	echo "no"
     fi
 done
 QEMU_CFLAGS="$QEMU_CFLAGS $warning_flags"