diff --git a/ChangeLog b/ChangeLog
index 90a002a3a00b1be82fe565dcfea0a5fbb38a219d..c406deca4241ce467b671ab76ddf930b0bd6a103 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -113,6 +113,7 @@ CVS code -
 	  Change the openfilestruct structure accordingly in order to
 	  handle this. (DLR)
 	- Convert some ints with predefined boundaries to enums. (DLR)
+	- Include config.h only if HAVE_CONFIG_H. (Jordi)
 - cut.c:
   cut_marked_segment()
 	- Respect concatenate_cut, as we need to use it if we do a
diff --git a/src/color.c b/src/color.c
index 3b60b6cf941028a43e89ab156212eba263ac1a69..fc87958cb6464f586d7004072928a1e55f718039 100644
--- a/src/color.c
+++ b/src/color.c
@@ -19,7 +19,9 @@
  *                                                                        *
  **************************************************************************/
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 
 #include <stdlib.h>
 #include <string.h>
diff --git a/src/cut.c b/src/cut.c
index 573d209b6c5e2c31cd00005fdc50eb8943c67812..3a7a8ab2e3051e5f839917100e247f9ed1cc2c8c 100644
--- a/src/cut.c
+++ b/src/cut.c
@@ -19,7 +19,9 @@
  *                                                                        *
  **************************************************************************/
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 
 #include <stdlib.h>
 #include <string.h>
diff --git a/src/files.c b/src/files.c
index ed37ac3c3cb26fc817c3cefe38f40add6bd0810d..7a32388a899410e3d327202a2a7cb1769a2f5f74 100644
--- a/src/files.c
+++ b/src/files.c
@@ -19,7 +19,9 @@
  *                                                                        *
  **************************************************************************/
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 
 #include <stdlib.h>
 #include <string.h>
diff --git a/src/global.c b/src/global.c
index 194138414fdfaf3323249e54a1cdb1e6b3fc0bc9..580d2e35d713f5d9523b9d8ae811c466a7369ab5 100644
--- a/src/global.c
+++ b/src/global.c
@@ -19,7 +19,9 @@
  *                                                                        *
  **************************************************************************/
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 
 #include <stdlib.h>
 #include <assert.h>
diff --git a/src/move.c b/src/move.c
index c3130984c65b510e73dd239c4ab53e4fb2dee14c..82b5abbe741c1934393bf36f926ae28bf62abb44 100644
--- a/src/move.c
+++ b/src/move.c
@@ -19,7 +19,9 @@
  *                                                                        *
  **************************************************************************/
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 
 #include <stdlib.h>
 #include <string.h>
diff --git a/src/nano.c b/src/nano.c
index 2289b2eb3b9a1ba4474a59244aa098365e31a468..01f78d640d919339277a35395bf16834fc107fbf 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -19,7 +19,9 @@
  *                                                                        *
  **************************************************************************/
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/src/rcfile.c b/src/rcfile.c
index f513010590e52d3c2674bda27224b56ccf40cd37..8f1780cb400dec0c21f2713c569f15aa31ff538f 100644
--- a/src/rcfile.c
+++ b/src/rcfile.c
@@ -19,7 +19,9 @@
  *                                                                        *
  **************************************************************************/
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 
 #include <stdlib.h>
 #include <stdarg.h>
diff --git a/src/search.c b/src/search.c
index 8cfa0de88fa5fc929d3610005b9ce3957008ef8a..e9ab3887c0841315b2957cab77c292c25be1d3b3 100644
--- a/src/search.c
+++ b/src/search.c
@@ -19,7 +19,9 @@
  *                                                                        *
  **************************************************************************/
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 
 #include <stdlib.h>
 #include <string.h>
diff --git a/src/utils.c b/src/utils.c
index 22b852e8be802563a95a501a34117fca41223698..7b5c104509ada6e3cfef2adc0c08e712f0b45a17 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -19,7 +19,9 @@
  *                                                                        *
  **************************************************************************/
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 
 #include <stdlib.h>
 #include <string.h>
diff --git a/src/winio.c b/src/winio.c
index ee55a6e42a52feebd234765c975160c2bbecb160..7c8be1445e8e7eae102a541449dc943d2d02ee79 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -19,7 +19,9 @@
  *                                                                        *
  **************************************************************************/
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 
 #include <stdarg.h>
 #include <string.h>