aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2004-10-18 18:12:33 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-10-18 18:12:33 -0700
commitd8e696f88aec55081e9a607b0b9b055710e63a15 (patch)
treeaeb9de3cf5eb68415d99c5c792fd154253219382 /scripts
parent471d53bbb4ab79e7c1f065808922c41f614a9d65 (diff)
downloadhistory-d8e696f88aec55081e9a607b0b9b055710e63a15.tar.gz
[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: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mod/sumversion.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/mod/sumversion.c b/scripts/mod/sumversion.c
index 86ea6a34d7919c..bf07479c86309e 100644
--- a/scripts/mod/sumversion.c
+++ b/scripts/mod/sumversion.c
@@ -416,7 +416,8 @@ static int get_version(const char *modname, char sum[])
struct md4_ctx md;
char *sources, *end, *fname;
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,
after the first line. */
@@ -424,9 +425,8 @@ static int get_version(const char *modname, char sum[])
basename = strrchr(modname, '/') + 1;
else
basename = modname;
- sprintf(filelist, ".tmp_versions/%s", basename);
- /* Truncate .o, add .mod */
- strcpy(filelist + strlen(filelist)-2, ".mod");
+ sprintf(filelist, "%s/%.*s.mod", getenv("MODVERDIR"),
+ (int) strlen(basename) - 2, basename);
file = grab_file(filelist, &len);
if (!file) {