Commit d8e696f8 authored by Andreas Gruenbacher's avatar Andreas Gruenbacher Committed by Linus Torvalds

[PATCH] Replace hard-coded MODVERDIR in modpost

When building external modules, MODVERDIR is relative to the external
module instead of in the kernel source tree.  Use the MODVERDIR environment
variable instead of the hard-coded path in modpost.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 471d53bb
...@@ -416,7 +416,8 @@ static int get_version(const char *modname, char sum[]) ...@@ -416,7 +416,8 @@ static int get_version(const char *modname, char sum[])
struct md4_ctx md; struct md4_ctx md;
char *sources, *end, *fname; char *sources, *end, *fname;
const char *basename; const char *basename;
char filelist[sizeof(".tmp_versions/%s.mod") + strlen(modname)]; char filelist[strlen(getenv("MODVERDIR")) + strlen("/") +
strlen(modname) - strlen(".o") + strlen(".mod") + 1 ];
/* Source files for module are in .tmp_versions/modname.mod, /* Source files for module are in .tmp_versions/modname.mod,
after the first line. */ after the first line. */
...@@ -424,9 +425,8 @@ static int get_version(const char *modname, char sum[]) ...@@ -424,9 +425,8 @@ static int get_version(const char *modname, char sum[])
basename = strrchr(modname, '/') + 1; basename = strrchr(modname, '/') + 1;
else else
basename = modname; basename = modname;
sprintf(filelist, ".tmp_versions/%s", basename); sprintf(filelist, "%s/%.*s.mod", getenv("MODVERDIR"),
/* Truncate .o, add .mod */ (int) strlen(basename) - 2, basename);
strcpy(filelist + strlen(filelist)-2, ".mod");
file = grab_file(filelist, &len); file = grab_file(filelist, &len);
if (!file) { if (!file) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment