wmperry(a)aventail.com (William M. Perry) writes:
 Jan Vroonhof <vroonhof(a)math.ethz.ch> writes:
 
 > wmperry(a)aventail.com (William M. Perry) writes:
 > 
 > > GCC_VERSION=`some magic here`
 > > 
 > > dnl Search for GCC specific build problems we know about
 > > if test "$GCC" = "yes"; then
 > > case `uname -s`:`uname -m`:$GCC_VERSION in
 > 
 > If this could be made into a real patch than this is approved and
 > retroactively recommended for every XEmacs known to man.
 
 Unfortunately, I don't have the time to hack on it right now... have to get
 back to real work and housebreaking the new puppy. :) 
I made it into real patch. PROBLEMS file is not exactly
clear about what version is OK and what version is not.
Does egcs 1.0 means from egcs-1.0 to egcs-1.0.3a?
Also, I don't have access to systems other than Solaris 2.6
(sparc), Debian GNU/Linux potato (i686) and RedHat Linux 5.2
(sparc), so I cannot test on other platforms. egcs test is
not tested yet because I don't have egcs here.
Could someone please test this patch before I send it to
xemacs-patches? You need to run autoconf after applying this
patch. Thanks.
Index: configure.in
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/configure.in,v
retrieving revision 1.111.2.51
diff -u -r1.111.2.51 configure.in
--- configure.in	1999/11/28 18:15:39	1.111.2.51
+++ configure.in	1999/12/03 11:36:10
@@ -1809,6 +1809,64 @@
   fi
 fi
 
+dnl Search for GCC specific build problems we know about
+if test "$GCC" = "yes"; then
+GCC_VERSION=`gcc --version`
+case `uname -s`:`uname -m`:$GCC_VERSION in
+	dnl egcs 2.90.21 (egcs-1.00 release)
+	dnl egcs 2.90.29 (egcs-1.0.3 release)
+    *:sun4*:2.8.1|*:sun4*:egcs-2.90.*)
+        dnl Don't use -O2 with gcc 2.8.1 and egcs 1.0 under SPARC architectures
+        dnl without also using `-fno-schedule-insns'.
+        case "$CFLAGS" in
+            *-O2*)
+                case "$CFLAGS" in
+                    *-fno-schedule-insns*) ;;
+                    *)
+                        AC_MSG_WARN(Don't use -O2 with gcc 2.8.1 and egcs 1.0 under
SPARC architectures)
+                        AC_MSG_WARN(without also using -fno-schedule-insns.)
+                        AC_MSG_ERROR(Aborting due to known problem)
+                        ;;
+                esac
+                ;;
+        esac
+        ;;
+	dnl egcs-2.91.57 (egcs-1.1 release)
+	dnl egcs-2.91.66 (egcs-1.1.2 release)
+    Linux:alpha:egcs-2.91.*)
+        AC_MSG_WARN(There have been reports of egcs-1.1 not compiling XEmacs correctly
on)
+        AC_MSG_WARN(Alpha Linux.  There have also been reports that egcs-1.0.3a is O.K.)
+        AC_MSG_ERROR(Aborting due to known problem)
+        ;;
+    *:i*86*:2.7.2*)
+	case "$GCC_VERSION" in
+	    2.7.2)
+		case "$CFLAGS" in
+        	    *-O2*)
+                	case "$CFLAGS" in
+	                    *-fno-strength-reduce*) ;;
+        	            *)
+                	        AC_MSG_WARN(Don't use -O2 with gcc 2.7.2 under Intel/XXX
without also using)
+	                        AC_MSG_WARN(-fno-strength-reduce.)
+        	                AC_MSG_ERROR(Aborting due to known problem)
+	                        ;;
+	                esac
+	                ;;
+		esac
+		;;
+	esac
+        case "$CFLAGS" in
+	 *-fno-caller-saves*) ;;
+	 *)
+	    AC_MSG_WARN(Don't use -O2 with gcc 2.7.2 under Intel/XXX without also using)
+	    AC_MSG_WARN(-fno-caller-saves.)
+            AC_MSG_ERROR(Aborting due to known problem)
+	    ;;
+        esac
+	;;
+esac
+fi
+
 dnl Inform compiler that certain flags are meant for the linker
 dnl XE_PROTECT_LINKER_FLAGS(shell_var)
 define([XE_PROTECT_LINKER_FLAGS], [
-- 
Yoshiki Hayashi