Yoshiki Hayashi <t90553(a)mail.ecc.u-tokyo.ac.jp> writes:
> 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)
Here is version that checks the CC the user specified, is slightly
more verbose and also checks for -O3
It works for me.
Index: configure.in
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs-20/configure.in,v
retrieving revision 1.135
diff -u -u -r1.135 configure.in
--- configure.in 1999/11/02 04:17:06 1.135
+++ configure.in 1999/12/06 18:49:47
@@ -1032,7 +1032,7 @@
alpha*-*-* ) machine=alpha ;;
vax-*-* ) machine=vax ;;
mips-dec-* ) machine=pmax ;;
- mips-sgi-* ) machine=iris4d ;;
+ mips-sgi-* ) machine=iris6d ;;
mips*-linux ) machine=mips ;;
romp-ibm-* ) machine=ibmrt ;;
rs6000-ibm-aix* ) machine=ibmrs6000 ;;
@@ -1347,13 +1347,13 @@
m68*-sgi-iris3.5* ) machine=irist opsys=iris3-5 ;;
m68*-sgi-iris3.6* | m68*-sgi-iris*) machine=irist opsys=iris3-6 ;;
dnl Iris 4D
- mips-sgi-irix3.* ) opsys=irix3-3 ;;
- mips-sgi-irix4.* ) opsys=irix4-0 ;;
+ mips-sgi-irix3.* ) opsys=irix3-3 machine=iris4d ;;
+ mips-sgi-irix4.* ) opsys=irix4-0 machine=iris4d ;;
mips-sgi-irix6* ) opsys=irix6-0 ;;
- mips-sgi-irix5.1* ) opsys=irix5-1 ;;
- mips-sgi-irix5.2* ) opsys=irix5-2 ;;
- mips-sgi-irix5.* ) opsys=irix5-3 ;;
- mips-sgi-irix* ) opsys=irix5-0 ;;
+ mips-sgi-irix5.1* ) opsys=irix5-1 machine=iris4d ;;
+ mips-sgi-irix5.2* ) opsys=irix5-2 machine=iris4d ;;
+ mips-sgi-irix5.* ) opsys=irix5-3 machine=iris4d ;;
+ mips-sgi-irix* ) opsys=irix6-0 machine=iris4d ;;
dnl SONY machines
*-sony-newsos[[34]]* | *-sony-news[[34]]* ) opsys=bsd4-3 ;;
@@ -1791,6 +1791,70 @@
CFLAGS="-O" ;dnl The only POSIX-approved flag
fi
fi
+
+dnl Search for GCC specific build problems we know about
+if test "$GCC" = "yes"; then
+AC_MSG_CHECKING(for buggy gcc versions)
+GCC_VERSION=`$CC --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*|*-O3*)
+ case "$CFLAGS" in
+ *-fno-schedule-insns*) ;;
+ *)
+ AC_MSG_RESULT(Yes)
+ 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_RESULT(Yes)
+ 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*|*-O3*)
+ case "$CFLAGS" in
+ *-fno-strength-reduce*) ;;
+ *)
+ AC_MSG_RESULT(Yes)
+ 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_RESULT(Yes)
+ 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
+AC_MSG_RESULT(No)
dnl Inform compiler that certain flags are meant for the linker
dnl XE_PROTECT_LINKER_FLAGS(shell_var)