All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Hervé Poussineau" <hpoussin@reactos.org>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] Check for gcc3 only if compiling dyngen targets
Date: Fri, 22 Aug 2008 19:45:44 +0200	[thread overview]
Message-ID: <48AEFB48.3090606@reactos.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 298 bytes --]

Hi,

If no configured target needs dyngen, gcc3.x is not required. Currently,
you have to explicitly pass --disable-gcc-check flag to allow compilation.

Attached patch removes gcc check if no selected target needs dyngen.
I had to move gcc4 detection later in the configure script

Hervé

[-- Attachment #2: configure.diff --]
[-- Type: text/plain, Size: 4313 bytes --]

Index: configure
===================================================================
--- configure	(revision 5030)
+++ configure	(working copy)
@@ -468,40 +468,6 @@
     oss="no"
 fi
 
-# Check for gcc4, error if pre-gcc4
-if test "$check_gcc" = "yes" ; then
-    cat > $TMPC <<EOF
-#if __GNUC__ < 4
-#error gcc3
-#endif
-int main(){return 0;}
-EOF
-    if "$cc" $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
-	echo "WARNING: \"$cc\" looks like gcc 4.x"
-	found_compat_cc="no"
-	if test "$gcc3_search" = "yes" ; then
-	    echo "Looking for gcc 3.x"
-	    for compat_cc in $gcc3_list ; do
-		if "$cross_prefix$compat_cc" --version 2> /dev/null | fgrep '(GCC) 3.' > /dev/null 2>&1 ; then
-		    echo "Found \"$compat_cc\""
-		    cc="$cross_prefix$compat_cc"
-		    found_compat_cc="yes"
-		    break
-		fi
-	    done
-	    if test "$found_compat_cc" = "no" ; then
-		echo "gcc 3.x not found!"
-	    fi
-	fi
-	if test "$found_compat_cc" = "no" ; then
-	    echo "QEMU is known to have problems when compiled with gcc 4.x"
-	    echo "It is recommended that you use gcc 3.x to build QEMU"
-	    echo "To use this compiler anyway, configure with --disable-gcc-check"
-	    exit 1;
-	fi
-    fi
-fi
-
 #
 # Solaris specific configure tool chain decisions
 #
@@ -1305,6 +1271,7 @@
 bflt="no"
 elfload32="no"
 target_nptl="no"
+requires_gcc3="no"
 interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
 
@@ -1341,6 +1308,7 @@
     echo "#define TARGET_ARCH \"alpha\"" >> $config_h
     echo "#define TARGET_ALPHA 1" >> $config_h
     echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
+    requires_gcc3="yes"
   ;;
   arm|armeb)
     echo "TARGET_ARCH=arm" >> $config_mak
@@ -1385,6 +1353,7 @@
     echo "#define TARGET_ARCH \"ppc\"" >> $config_h
     echo "#define TARGET_PPC 1" >> $config_h
     echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
+    requires_gcc3="yes"
   ;;
   ppcemb)
     echo "TARGET_ARCH=ppcemb" >> $config_mak
@@ -1394,6 +1363,7 @@
     echo "#define TARGET_PPC 1" >> $config_h
     echo "#define TARGET_PPCEMB 1" >> $config_h
     echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
+    requires_gcc3="yes"
   ;;
   ppc64)
     echo "TARGET_ARCH=ppc64" >> $config_mak
@@ -1403,6 +1373,7 @@
     echo "#define TARGET_PPC 1" >> $config_h
     echo "#define TARGET_PPC64 1" >> $config_h
     echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
+    requires_gcc3="yes"
   ;;
   ppc64abi32)
     echo "TARGET_ARCH=ppc64" >> $config_mak
@@ -1414,6 +1385,7 @@
     echo "#define TARGET_PPC64 1" >> $config_h
     echo "#define TARGET_ABI32 1" >> $config_h
     echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
+    requires_gcc3="yes"
   ;;
   sh4|sh4eb)
     echo "TARGET_ARCH=sh4" >> $config_mak
@@ -1422,6 +1394,7 @@
     echo "#define TARGET_SH4 1" >> $config_h
     echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
     bflt="yes"
+    requires_gcc3="yes"
   ;;
   sparc)
     echo "TARGET_ARCH=sparc" >> $config_mak
@@ -1503,6 +1476,44 @@
 
 done # for target in $targets
 
+if test "$requires_gcc3" = "no" ; then
+  check_gcc="no"
+fi
+
+# Check for gcc4, error if pre-gcc4
+if test "$check_gcc" = "yes" ; then
+    cat > $TMPC <<EOF
+#if __GNUC__ < 4
+#error gcc3
+#endif
+int main(){return 0;}
+EOF
+    if "$cc" $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
+	echo "WARNING: \"$cc\" looks like gcc 4.x"
+	found_compat_cc="no"
+	if test "$gcc3_search" = "yes" ; then
+	    echo "Looking for gcc 3.x"
+	    for compat_cc in $gcc3_list ; do
+		if "$cross_prefix$compat_cc" --version 2> /dev/null | fgrep '(GCC) 3.' > /dev/null 2>&1 ; then
+		    echo "Found \"$compat_cc\""
+		    cc="$cross_prefix$compat_cc"
+		    found_compat_cc="yes"
+		    break
+		fi
+	    done
+	    if test "$found_compat_cc" = "no" ; then
+		echo "gcc 3.x not found!"
+	    fi
+	fi
+	if test "$found_compat_cc" = "no" ; then
+	    echo "QEMU is known to have problems when compiled with gcc 4.x"
+	    echo "It is recommended that you use gcc 3.x to build QEMU"
+	    echo "To use this compiler anyway, configure with --disable-gcc-check"
+	    exit 1;
+	fi
+    fi
+fi
+
 # build tree in object directory if source path is different from current one
 if test "$source_path_used" = "yes" ; then
     DIRS="tests tests/cris slirp audio"

             reply	other threads:[~2008-08-22 17:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-22 17:45 Hervé Poussineau [this message]
2008-08-22 18:01 ` [Qemu-devel] [PATCH] Check for gcc3 only if compiling dyngen targets Anthony Liguori

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=48AEFB48.3090606@reactos.org \
    --to=hpoussin@reactos.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.