diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 59d6a3e9bfe9b5e36a89c4af061080d3fc76750b..c371f8dfe0f626cd0bb6a87fb5848abd8874f636 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,9 @@
+2005-11-27  David Edelsohn  <edelsohn@gnu.org>
+
+	* intrinsics/random.c: Include config.h
+	* io/size_from_kind.c: Include config.h and libgfortran.h
+	* io/io.h: Revert 2005-11-21 change.
+
 2005-11-27  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
 
 	* io/write.c (namelist_write): Correct type in previous
diff --git a/libgfortran/intrinsics/random.c b/libgfortran/intrinsics/random.c
index 463b7e0c17b4f929c8cc44fe5d011673aff428bd..ef7ed760e63a813edc477c3915c6ccf01282d49d 100644
--- a/libgfortran/intrinsics/random.c
+++ b/libgfortran/intrinsics/random.c
@@ -29,6 +29,7 @@ License along with libgfortran; see the file COPYING.  If not,
 write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 Boston, MA 02110-1301, USA.  */
 
+#include "config.h"
 #include "libgfortran.h"
 #include "../io/io.h"
 
diff --git a/libgfortran/io/io.h b/libgfortran/io/io.h
index 48cc2a19ab208914bdffafdad25b19587b499407..004bcef8bf638c5ffc5e79ff663c025eeb25c58a 100644
--- a/libgfortran/io/io.h
+++ b/libgfortran/io/io.h
@@ -37,11 +37,6 @@ Boston, MA 02110-1301, USA.  */
 #define SUPPORTS_WEAK 1
 #endif
 
-#ifdef _AIX
-#undef _LARGE_FILES
-#define _LARGE_FILE_API
-#endif
-
 #include <gthr.h>
 
 #define DEFAULT_TEMPDIR "/tmp"
diff --git a/libgfortran/io/size_from_kind.c b/libgfortran/io/size_from_kind.c
index c4a55dceb5420cc5f336798b0ee1e89b89e5cb88..033b554c61449c4eda4559aa6335ad71136dc8fe 100644
--- a/libgfortran/io/size_from_kind.c
+++ b/libgfortran/io/size_from_kind.c
@@ -31,6 +31,8 @@ Boston, MA 02110-1301, USA.  */
 /* This file contains utility functions for determining the size of a
    variable given its kind. */
 
+#include "config.h"
+#include "libgfortran.h"
 #include "io.h"
 
 size_t