Index: configure
===================================================================
--- configure	(revision 3237)
+++ configure	(working copy)
@@ -273,7 +273,7 @@
 
 ac_subdirs_all="$ac_subdirs_all osprey/cygnus"
 ac_subdirs_all="$ac_subdirs_all osprey-gcc-4.2.0"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os MACHINE_TYPE BUILD_ABI BUILD_ARCH BUILD_HOST BUILD_TARGET BUILD_OPTIMIZE BUILD_COMPILER BUILD_BOTH LIB_MACHINE_TYPE LIB_BUILD_TARGET LIB_BUILD_ABI LIB_BUILD_ARCH LIB_BUILD_HOST LIB2_MACHINE_TYPE LIB2_BUILD_TARGET LIB2_BUILD_ABI LIB2_BUILD_ARCH LIB2_BUILD_HOST BUILD_MULTILIB COMPILER_TARG_DIR TARG_INFO_NAME LIBLIST subdirs LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os MACHINE_TYPE BUILD_ABI BUILD_ARCH BUILD_HOST BUILD_TARGET BUILD_OPTIMIZE BUILD_COMPILER BUILD_BOTH LIB_MACHINE_TYPE LIB_BUILD_TARGET LIB_BUILD_ABI LIB_BUILD_ARCH LIB_BUILD_HOST LIB2_MACHINE_TYPE LIB2_BUILD_TARGET LIB2_BUILD_ABI LIB2_BUILD_ARCH LIB2_BUILD_HOST BUILD_MULTILIB COMPILER_TARG_DIR TARG_INFO_NAME BUILD_GNU3 LIBLIST subdirs LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -1423,6 +1423,9 @@
 # BUILD_BOTH is (only) used in osprey/Makefile.gsetup.in for setting -fPIC.
 BUILD_BOTH=
 
+# Set BUILD_GNU3 to "YES" to build the GCC 3.3 C/C++ front-end.
+BUILD_GNU3=NO
+
 # Specify the targ_info directory under osprey/common to use.  IA64 uses
 # ipfec_targ_info instead of targ_info.
 TARG_INFO_NAME=targ_info
@@ -1593,10 +1596,16 @@
 
 
 
+
 # List of configurable files to create in object directory.
-                                                                                                                                                                                                                                                                                                                                                                                            ac_config_files="$ac_config_files Makefile osprey/Makefile.gsetup osprey/targdir/libspin/Makefile osprey/targdir/libspin_4_2_0/Makefile osprey/targdir/include/Makefile osprey/targdir/driver/Makefile osprey/targdir/libiberty/Makefile osprey/targdir/targ_info/Makefile osprey/targdir/be/Makefile osprey/targdir/libelf/Makefile osprey/targdir/libelfutil/Makefile osprey/targdir/libdwarf/Makefile osprey/targdir/libunwindP/Makefile osprey/targdir/cg/Makefile osprey/targdir/wopt/Makefile osprey/targdir/ipl/Makefile osprey/targdir/lno/Makefile osprey/targdir/lw_inline/Makefile osprey/targdir/ipa/Makefile osprey/targdir/whirl2c/Makefile osprey/targdir/whirl2f/Makefile osprey/targdir/libcomutil/Makefile osprey/targdir/ir_tools/Makefile osprey/targdir/libcmplrs/Makefile osprey/targdir/wgen/Makefile osprey/targdir/libcif/Makefile osprey/targdir/arith/Makefile osprey/targdir/orc_ict/Makefile osprey/targdir/orc_intel/Makefile osprey/targdir/libkapi/Makefile osprey/targdir/crayf90/Makefile osprey/targdir/crayf90/fe90/Makefile osprey/targdir/crayf90/libf90sgi/Makefile osprey/targdir/crayf90/sgi/Makefile osprey/targdir/gccfe/Makefile osprey/targdir/gccfe/gnu/Makefile osprey/targdir/g++fe/Makefile osprey/targdir/g++fe/gnu/Makefile"
+                                                                                                                                                                                                                                                                                                                                                    ac_config_files="$ac_config_files Makefile osprey/Makefile.gsetup osprey/targdir/libspin/Makefile osprey/targdir/libspin_4_2_0/Makefile osprey/targdir/include/Makefile osprey/targdir/driver/Makefile osprey/targdir/libiberty/Makefile osprey/targdir/targ_info/Makefile osprey/targdir/be/Makefile osprey/targdir/libelf/Makefile osprey/targdir/libelfutil/Makefile osprey/targdir/libdwarf/Makefile osprey/targdir/libunwindP/Makefile osprey/targdir/cg/Makefile osprey/targdir/wopt/Makefile osprey/targdir/ipl/Makefile osprey/targdir/lno/Makefile osprey/targdir/lw_inline/Makefile osprey/targdir/ipa/Makefile osprey/targdir/whirl2c/Makefile osprey/targdir/whirl2f/Makefile osprey/targdir/libcomutil/Makefile osprey/targdir/ir_tools/Makefile osprey/targdir/libcmplrs/Makefile osprey/targdir/wgen/Makefile osprey/targdir/libcif/Makefile osprey/targdir/arith/Makefile osprey/targdir/orc_ict/Makefile osprey/targdir/orc_intel/Makefile osprey/targdir/libkapi/Makefile osprey/targdir/crayf90/Makefile osprey/targdir/crayf90/fe90/Makefile osprey/targdir/crayf90/libf90sgi/Makefile osprey/targdir/crayf90/sgi/Makefile"
 
 
+if test $BUILD_GNU3 = "YES"; then
+                                          ac_config_files="$ac_config_files osprey/targdir/gccfe/Makefile osprey/targdir/gccfe/gnu/Makefile osprey/targdir/g++fe/Makefile osprey/targdir/g++fe/gnu/Makefile"
+
+fi
+
 # The directories created under targdir_lib (and targdir_lib2) also
 # need to be listed in LIBLIST.  This list is used in targdir_lib/Makefile.in
 # to control the order of the library builds.  When adding a directory
@@ -2361,6 +2370,7 @@
 s,@BUILD_MULTILIB@,$BUILD_MULTILIB,;t t
 s,@COMPILER_TARG_DIR@,$COMPILER_TARG_DIR,;t t
 s,@TARG_INFO_NAME@,$TARG_INFO_NAME,;t t
+s,@BUILD_GNU3@,$BUILD_GNU3,;t t
 s,@LIBLIST@,$LIBLIST,;t t
 s,@subdirs@,$subdirs,;t t
 s,@LIBOBJS@,$LIBOBJS,;t t
Index: osprey/driver/OPTIONS
===================================================================
--- osprey/driver/OPTIONS	(revision 3237)
+++ osprey/driver/OPTIONS	(working copy)
@@ -702,15 +702,16 @@
 	"Produce debugging information for use by GDB"
 -ggdb3	toggle(&glevel,3);		ALL	CMP	"-g3"
 	"Produce debugging information for use by GDB"
-#ifdef KEY
+#ifdef BUILD_GNU3
 -gnu3	toggle(&gnu_major_version,3);toggle(&gnu_minor_version,3);	Cc	NONE	""
 	"Use GCC 3.3 C/C++ front-end."
 -gnu4	toggle(&gnu_major_version,4);toggle(&gnu_minor_version,2);	Cc	NONE	""
 	"Use GCC 4.2 C/C++ front-end."
--gnu40	toggle(&gnu_major_version,4);toggle(&gnu_minor_version,0);	Cc	NONE	""
-	"Use GCC 4.0 C/C++ front-end."
 -gnu42	toggle(&gnu_major_version,4);toggle(&gnu_minor_version,2);	Cc	NONE	""
 	"Use GCC 4.2 C/C++ front-end."
+#else
+-gnu42	toggle(&gnu_major_version,4);toggle(&gnu_minor_version,2);	Cc	NONE	""
+	""
 #endif
 -gstabs		warn_ignored(option_name);	ALL	NONE	""
 	""
Index: osprey/driver/phases.c
===================================================================
--- osprey/driver/phases.c	(revision 3237)
+++ osprey/driver/phases.c	(working copy)
@@ -2998,8 +2998,6 @@
   // Select the appropriate GNU 4 front-end.
   if ((gnu_major_version == 4) && !run_build) {
     switch (gnu_minor_version) {
-      case 0:	// Default is 4.0.
-        break;
       case 2:
 	set_phase_name(P_spin_cc1, "cc142");
 	set_phase_name(P_spin_cc1plus, "cc1plus42");
Index: osprey/driver/special_options.c
===================================================================
--- osprey/driver/special_options.c	(revision 3237)
+++ osprey/driver/special_options.c	(working copy)
@@ -164,6 +164,11 @@
 		toggle(&use_ftpp, 0);
 	}
 
+#ifndef BUILD_GNU3
+    // Always use the GCC 4.2 FE.
+    toggle(&gnu_major_version, 4);
+    toggle(&gnu_minor_version, 2);
+#else
 	// Use the system's GCC version to select -gnu3/-gnu4 as the default.
 	// Bug 11426.
 	if (!is_toggled(gnu_major_version)) {
@@ -180,6 +185,8 @@
 	  }
 	}
 #endif
+
+#endif
 #if defined(TARG_NVISA)
 	/* stop after assembly */
 	if (option_was_seen(O_multicore))
Index: osprey/driver/Makefile.gbase
===================================================================
--- osprey/driver/Makefile.gbase	(revision 3237)
+++ osprey/driver/Makefile.gbase	(working copy)
@@ -69,6 +69,9 @@
 LCDEFS += -DLOONGSON
 endif
 
+ifeq ($(BUILD_GNU3), YES)
+LCDEFS += -DBUILD_GNU3
+endif
 
 LCDEFS += -DOPEN64_PRODNAME='"Compiler"'
 
Index: osprey/Makefile.gsetup.in
===================================================================
--- osprey/Makefile.gsetup.in	(revision 3237)
+++ osprey/Makefile.gsetup.in	(working copy)
@@ -129,6 +129,9 @@
 ifndef BUILD_BOTH
      BUILD_BOTH     = @BUILD_BOTH@
 endif
+ifndef BUILD_GNU3
+     BUILD_GNU3     = @BUILD_GNU3@
+endif
 ifndef COMPILER_TARG_DIR
      COMPILER_TARG_DIR = @abs_top_builddir@/osprey/targdir
 endif
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 3237)
+++ Makefile.in	(working copy)
@@ -65,6 +65,7 @@
 TOP_SRCDIR          = @abs_top_srcdir@
 TOP_BUILDDIR        = @abs_top_builddir@
 BUILD_MULTILIB      = @BUILD_MULTILIB@
+BUILD_GNU3          = @BUILD_GNU3@
 
 ifeq ($(MACHINE_TYPE), ia64)
 # ia64
@@ -134,10 +135,13 @@
 		$(NATIVE_BUILD_DIR)/arith
 
 NATIVE_COMPONENTS = $(BASIC_COMPONENTS) $(TARGET_EXTRA_OBJ)  \
-                    $(GNU3_FE_COMPONENTS) $(GNU4_FE_COMPONENTS) \
-                    $(FORT_FE_COMPONENTS) \
-		    $(FIRST_COMPONENTS) 
+                    $(GNU4_FE_COMPONENTS) $(FORT_FE_COMPONENTS) \
+                    $(FIRST_COMPONENTS) 
 
+ifeq ($(BUILD_GNU3), YES)
+NATIVE_COMPONENTS += $(GNU3_FE_COMPONENTS)
+endif
+
 CROSS_COMPONENTS =  $(BASIC_COMPONENTS) $(TARGET_EXTRA_OBJ) \
                     $(FORT_FE_COMPONENTS)
 
@@ -257,13 +261,10 @@
 $(NATIVE_BUILD_DIR)/crayf90/sgi/mfef95 mfef95: libcomutil libcif arith
 	$(MAKE) -C $(NATIVE_BUILD_DIR)/crayf90
 
-.PHONY: libspin phony_targets first
+.PHONY: phony_targets first
 $(NATIVE_BUILD_DIR_LD)/ld/ld-new ld-new:
 	$(MAKE) -C $(NATIVE_BUILD_DIR_LD)
 
-$(NATIVE_BUILD_DIR)/libspin/libgspin.a libspin:
-	$(MAKE) -C $(NATIVE_BUILD_DIR)/libspin
-
 $(NATIVE_BUILD_DIR)/libspin_4_2_0/libgspin42.a libspin42:
 	$(MAKE) -C $(NATIVE_BUILD_DIR)/libspin_4_2_0
 
@@ -279,7 +280,6 @@
 	$(MAKE) first
 	$(MAKE) phony_targets 
 
-first:libspin
 phony_targets: $(PHONY_TARGET)
 cross: NATIVE_BUILD_DIR = osprey/targia32_ia64_nodebug
 cross: NATIVE_BUILD_DIR_LD = osprey/targcygnus_ia32_ia64
@@ -374,7 +374,6 @@
 	$(MAKE) -C $(NATIVE_BUILD_DIR)/crayf90 clobber
 	$(MAKE) -C $(NATIVE_BUILD_DIR)/arith clobber
 	$(MAKE) -C $(NATIVE_BUILD_DIR)/include clobber
-	$(MAKE) -C $(NATIVE_BUILD_DIR)/libspin clobber
 	$(MAKE) -C $(NATIVE_BUILD_DIR)/libspin_4_2_0 clobber
 ifeq ($(MACHINE_TYPE), ia64)
 	$(MAKE) -C $(NATIVE_BUILD_DIR)/orc_ict clobber
@@ -383,7 +382,7 @@
 	$(MAKE) -C $(NATIVE_BUILD_DIR_LD) clean
 	$(MAKE) -C $(GNUFE_BUILD_DIR) clean
 	@for i in libcif libcmplrs libcomutil libcsup libdwarf libelf libelfutil \
-		libiberty libunwindP libspin; do  \
+		libiberty libunwindP; do  \
 		$(MAKE) -C "$(NATIVE_BUILD_DIR)/$${i}" clobber; \
 	done
 
Index: configure.ac
===================================================================
--- configure.ac	(revision 3237)
+++ configure.ac	(working copy)
@@ -101,6 +101,9 @@
 # BUILD_BOTH is (only) used in osprey/Makefile.gsetup.in for setting -fPIC.
 BUILD_BOTH=
 
+# Set BUILD_GNU3 to "YES" to build the GCC 3.3 C/C++ front-end.
+BUILD_GNU3=NO
+
 # Specify the targ_info directory under osprey/common to use.  IA64 uses
 # ipfec_targ_info instead of targ_info.
 TARG_INFO_NAME=targ_info
@@ -266,6 +269,7 @@
 AC_SUBST([BUILD_MULTILIB])
 AC_SUBST([COMPILER_TARG_DIR])
 AC_SUBST([TARG_INFO_NAME])
+AC_SUBST([BUILD_GNU3])
 
 # List of configurable files to create in object directory.
 AC_CONFIG_FILES([
@@ -303,12 +307,17 @@
   osprey/targdir/crayf90/fe90/Makefile
   osprey/targdir/crayf90/libf90sgi/Makefile
   osprey/targdir/crayf90/sgi/Makefile
-  osprey/targdir/gccfe/Makefile
-  osprey/targdir/gccfe/gnu/Makefile
-  osprey/targdir/g++fe/Makefile
-  osprey/targdir/g++fe/gnu/Makefile
 ])
 
+if test $BUILD_GNU3 = "YES"; then
+  AC_CONFIG_FILES([
+    osprey/targdir/gccfe/Makefile
+    osprey/targdir/gccfe/gnu/Makefile
+    osprey/targdir/g++fe/Makefile
+    osprey/targdir/g++fe/gnu/Makefile
+  ])
+fi
+
 # The directories created under targdir_lib (and targdir_lib2) also
 # need to be listed in LIBLIST.  This list is used in targdir_lib/Makefile.in
 # to control the order of the library builds.  When adding a directory
Index: install_compiler.sh
===================================================================
--- install_compiler.sh	(revision 3237)
+++ install_compiler.sh	(working copy)
@@ -238,9 +238,12 @@
 # Install front-end components
 INSTALL_FE () {
 
-    # GNU3 based FE
-    INSTALL_EXEC_SUB ${AREA}/gccfe/gfec  ${PHASEPATH}/gfec
-    INSTALL_EXEC_SUB ${AREA}/g++fe/gfecc ${PHASEPATH}/gfecc
+    # optional GNU 3.3 based FE
+    if [ -f ${AREA}/gccfe/gfec ] ; then 
+      INSTALL_EXEC_SUB ${AREA}/gccfe/gfec  ${PHASEPATH}/gfec
+      INSTALL_EXEC_SUB ${AREA}/g++fe/gfecc ${PHASEPATH}/gfecc
+    fi
+
     # GNU 4.2.0 based FE
     INSTALL_EXEC_SUB ${AREA}/wgen/wgen42 ${PHASEPATH}/wgen42
     LIBEXEC=libexec/gcc/${PHASE_DIR_PREFIX}-redhat-linux/4.2.0
@@ -297,8 +300,8 @@
     (cd ${PHASEPATH}; ln -sf be whirl2f_be) 
 
     INSTALL_EXEC_SUB  ${AREA}/ir_tools/ir_b2a    ${BIN_DIR}/ir_b2a
-    INSTALL_EXEC_SUB  ${AREA}/libspin/gspin      ${BIN_DIR}/gspin
     INSTALL_EXEC_SUB  ${AREA}/libspin_4_2_0/gspin42 ${BIN_DIR}/gspin42
+    (cd ${BIN_DIR}; ln -sf gspin42 gspin)
 
     return 0
 }
