qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori@us.ibm.com>
To: qemu-devel@nongnu.org
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	Paul Brook <paul@codesourcery.com>
Subject: [Qemu-devel] [PATCH] Don't require GCC3 unless necessary (v2)
Date: Wed, 21 May 2008 16:21:28 -0500	[thread overview]
Message-ID: <1211404888-29146-1-git-send-email-aliguori@us.ibm.com> (raw)

Now that i386, x86_64, and arm are converted to TCG, we should not insist on
requiring GCC3 unless we're building a target that still requires dyngen.

If we're using some targets that do require GCC3 and some that don't, always
use GCC3 to ensure a consistent build.

Since v1, there was a small typo in the gcc3minver fix.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

diff --git a/Makefile b/Makefile
index 5bf9bbd..6505f0e 100644
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,11 @@ LIBS+=$(AIOLIBS)
 
 all: $(TOOLS) $(DOCS) recurse-all 
 
-subdir-%: dyngen$(EXESUF) libqemu_common.a
+ifeq ($(CONFIG_DYNGEN), yes)
+SUBDIR_DEP=dyngen$(EXESUF)
+endif
+
+subdir-%: $(SUBDIR_DEP) libqemu_common.a
 	$(MAKE) -C $(subst subdir-,,$@) all
 
 recurse-all: $(patsubst %,subdir-%, $(TARGET_DIRS))
diff --git a/configure b/configure
index 6b84f20..3fa2316 100755
--- a/configure
+++ b/configure
@@ -461,6 +461,37 @@ if test "$mingw32" = "yes" ; then
     oss="no"
 fi
 
+# If --target-list isn't specified, we need dyngen
+if [ "$target_list" == "" ]; then
+    dyngen="yes"
+else
+    dyngen="no"
+fi
+
+# Check if any targets require dyngen
+for target in $target_list; do
+    target_cpu=`echo $target | cut -d '-' -f 1`
+    [ "$target_cpu" = "alpha" ] && dyngen="yes"
+    [ "$target_cpu" = "m68k" ] && dyngen="yes"
+    [ "$target_cpu" = "mips" ] && dyngen="yes"
+    [ "$target_cpu" = "mipsel" ] && dyngen="yes"
+    [ "$target_cpu" = "mipsn32" ] && dyngen="yes"
+    [ "$target_cpu" = "mipsn32el" ] && dyngen="yes"
+    [ "$target_cpu" = "mips64" ] && dyngen="yes"
+    [ "$target_cpu" = "mips64el" ] && dyngen="yes"
+    [ "$target_cpu" = "ppc" ] && dyngen="yes"
+    [ "$target_cpu" = "ppcemb" ] && dyngen="yes"
+    [ "$target_cpu" = "ppc64" ] && dyngen="yes"
+    [ "$target_cpu" = "ppc64abi32" ] && dyngen="yes"
+    [ "$target_cpu" = "sh4" ] && dyngen="yes"
+    [ "$target_cpu" = "she4eb" ] && dyngen="yes"
+done
+
+# If no targets require dyngen, use default CC instead of gcc3
+if [ "$dyngen" = "no" ]; then
+    check_gcc="no"
+fi
+
 # Check for gcc4, error if pre-gcc4
 if test "$check_gcc" = "yes" ; then
     cat > $TMPC <<EOF
@@ -885,6 +916,7 @@ echo "CFLAGS=$CFLAGS" >> $config_mak
 echo "LDFLAGS=$LDFLAGS" >> $config_mak
 echo "EXESUF=$EXESUF" >> $config_mak
 echo "AIOLIBS=$AIOLIBS" >> $config_mak
+echo "CONFIG_DYNGEN=$dyngen" >> $config_mak
 case "$cpu" in
   i386)
     echo "ARCH=i386" >> $config_mak
@@ -1200,11 +1232,12 @@ case "$target_cpu" in
       echo "#define USE_KQEMU 1" >> $config_h
     fi
     gcc3minver=`$cc --version 2> /dev/null| fgrep "(GCC) 3." | awk '{ print $3 }' | cut -f2 -d.`
-    if test -n "$gcc3minver" -a $gcc3minver -gt 3
-    then
-      echo "HAVE_GT_GCC_3_3=true" >> $config_mak
-    else
-      echo "HAVE_GT_GCC_3_3=false" >> $config_mak
+    if test -n "$gcc3minver" ; then
+	if test "$gcc3minver" -gt 3 ; then
+	    echo "HAVE_GT_GCC_3_3=true" >> $config_mak
+	else
+	    echo "HAVE_GT_GCC_3_3=false" >> $config_mak
+	fi
     fi
   ;;
   x86_64)

             reply	other threads:[~2008-05-21 21:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-21 21:21 Anthony Liguori [this message]
2008-05-22 13:20 ` [Qemu-devel] [PATCH] Don't require GCC3 unless necessary (v2) Paul Brook
2008-05-22 16:22   ` Anthony Liguori
2008-05-22 16:31     ` Paul Brook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1211404888-29146-1-git-send-email-aliguori@us.ibm.com \
    --to=aliguori@us.ibm.com \
    --cc=paul@codesourcery.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).