diff --git a/scripts/config/zconf.l b/scripts/config/zconf.l
index 3aef45983aa1f1cc979ad2298ac7de0492cb1dfd..1dd765817a78e7da5701dd04d096737895f145ad 100644
--- a/scripts/config/zconf.l
+++ b/scripts/config/zconf.l
@@ -343,6 +343,7 @@ void zconf_nextfile(const char *name)
 	glob_t gl;
 	int err;
 	int i;
+	char path[PATH_MAX], *p;
 
 	err = glob(name, GLOB_ERR | GLOB_MARK, NULL, &gl);
 
@@ -352,6 +353,15 @@ void zconf_nextfile(const char *name)
 		gl.gl_pathc = 0;
 	}
 
+	if (err == GLOB_NOMATCH) {
+		p = strdup(current_file->name);
+		if (p) {
+			snprintf(path, sizeof(path), "%s/%s", dirname(p), name);
+			err = glob(path, GLOB_ERR | GLOB_MARK, NULL, &gl);
+			free(p);
+		}
+	}
+
 	if (err) {
 		const char *reason = "unknown error";
 
diff --git a/scripts/config/zconf.lex.c_shipped b/scripts/config/zconf.lex.c_shipped
index 766549fbfed1dd56f8c4b119002e9718ed2dc2fd..c938b2fae6966b34530e8b1a3cbe00c1b0a46ace 100644
--- a/scripts/config/zconf.lex.c_shipped
+++ b/scripts/config/zconf.lex.c_shipped
@@ -2399,6 +2399,7 @@ void zconf_nextfile(const char *name)
 	glob_t gl;
 	int err;
 	int i;
+	char path[PATH_MAX], *p;
 
 	err = glob(name, GLOB_ERR | GLOB_MARK, NULL, &gl);
 
@@ -2408,6 +2409,16 @@ void zconf_nextfile(const char *name)
 		gl.gl_pathc = 0;
 	}
 
+	if (err == GLOB_NOMATCH) {
+		p = strdup(current_file->name);
+		if (p) {
+			snprintf(path, sizeof(path), "%s/%s", dirname(p), name);
+			fprintf(stderr, "TRY:%s\n", path);
+			err = glob(path, GLOB_ERR | GLOB_MARK, NULL, &gl);
+			free(p);
+		}
+	}
+
 	if (err) {
 		const char *reason = "unknown error";