diff --git a/ChangeLog b/ChangeLog
index 20bab17fbab5a66bb307d2c66b10aabab61e61ad..ddfbba287e7807aa31bb4fa2ae7207cc711ca0c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-12-10  Ian Lance Taylor  <iant@google.com>
+
+	PR bootstrap/46819
+	* configure.ac: For --disable-libgcj clear libgcj_saved.
+	* configure: Rebuild.
+
 2010-12-10  Tobias Burnus  <burnus@net-b.de>
 
 	PR fortran/46540
diff --git a/configure b/configure
index 4280d9778dae8b2b8efcd57daa8ffd76e62be491..9f036cb418add45038c5c1413fb942e29b47cf80 100755
--- a/configure
+++ b/configure
@@ -3055,6 +3055,9 @@ no)
   # Make sure we get it printed in the list of not supported target libs.
   # Don't disable libffi, though, other languages use it.
   noconfigdirs="$noconfigdirs `echo ${libgcj} | sed -e 's/target-libffi//'`"
+  # Clear libgcj_saved so that even if java is enabled libffi won't be
+  # built.
+  libgcj_saved=
   ;;
 esac
 
diff --git a/configure.ac b/configure.ac
index 03f15dfa8a5817643c6dd979b2ce9359be0c7347..fc268b2a5cefbb79498691108647071177bbbb11 100644
--- a/configure.ac
+++ b/configure.ac
@@ -506,6 +506,9 @@ no)
   # Make sure we get it printed in the list of not supported target libs.
   # Don't disable libffi, though, other languages use it.
   noconfigdirs="$noconfigdirs `echo ${libgcj} | sed -e 's/target-libffi//'`"
+  # Clear libgcj_saved so that even if java is enabled libffi won't be
+  # built.
+  libgcj_saved=
   ;;
 esac