diff options
Diffstat (limited to 'scripts/basic/docproc.c')
-rw-r--r-- | scripts/basic/docproc.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/scripts/basic/docproc.c b/scripts/basic/docproc.c index 35bdc68b6e66..4c9523ef9c00 100644 --- a/scripts/basic/docproc.c +++ b/scripts/basic/docproc.c | |||
@@ -69,7 +69,7 @@ FILELINE * docsection; | |||
69 | #define NOFUNCTION "-nofunction" | 69 | #define NOFUNCTION "-nofunction" |
70 | #define NODOCSECTIONS "-no-doc-sections" | 70 | #define NODOCSECTIONS "-no-doc-sections" |
71 | 71 | ||
72 | char *srctree; | 72 | static char *srctree, *kernsrctree; |
73 | 73 | ||
74 | void usage (void) | 74 | void usage (void) |
75 | { | 75 | { |
@@ -77,7 +77,8 @@ void usage (void) | |||
77 | fprintf(stderr, "Input is read from file.tmpl. Output is sent to stdout\n"); | 77 | fprintf(stderr, "Input is read from file.tmpl. Output is sent to stdout\n"); |
78 | fprintf(stderr, "doc: frontend when generating kernel documentation\n"); | 78 | fprintf(stderr, "doc: frontend when generating kernel documentation\n"); |
79 | fprintf(stderr, "depend: generate list of files referenced within file\n"); | 79 | fprintf(stderr, "depend: generate list of files referenced within file\n"); |
80 | fprintf(stderr, "Environment variable SRCTREE: absolute path to kernel source tree.\n"); | 80 | fprintf(stderr, "Environment variable SRCTREE: absolute path to sources.\n"); |
81 | fprintf(stderr, " KBUILD_SRC: absolute path to kernel source tree.\n"); | ||
81 | } | 82 | } |
82 | 83 | ||
83 | /* | 84 | /* |
@@ -96,8 +97,8 @@ void exec_kernel_doc(char **svec) | |||
96 | exit(1); | 97 | exit(1); |
97 | case 0: | 98 | case 0: |
98 | memset(real_filename, 0, sizeof(real_filename)); | 99 | memset(real_filename, 0, sizeof(real_filename)); |
99 | strncat(real_filename, srctree, PATH_MAX); | 100 | strncat(real_filename, kernsrctree, PATH_MAX); |
100 | strncat(real_filename, KERNELDOCPATH KERNELDOC, | 101 | strncat(real_filename, "/" KERNELDOCPATH KERNELDOC, |
101 | PATH_MAX - strlen(real_filename)); | 102 | PATH_MAX - strlen(real_filename)); |
102 | execvp(real_filename, svec); | 103 | execvp(real_filename, svec); |
103 | fprintf(stderr, "exec "); | 104 | fprintf(stderr, "exec "); |
@@ -178,6 +179,7 @@ void find_export_symbols(char * filename) | |||
178 | char real_filename[PATH_MAX + 1]; | 179 | char real_filename[PATH_MAX + 1]; |
179 | memset(real_filename, 0, sizeof(real_filename)); | 180 | memset(real_filename, 0, sizeof(real_filename)); |
180 | strncat(real_filename, srctree, PATH_MAX); | 181 | strncat(real_filename, srctree, PATH_MAX); |
182 | strncat(real_filename, "/", PATH_MAX - strlen(real_filename)); | ||
181 | strncat(real_filename, filename, | 183 | strncat(real_filename, filename, |
182 | PATH_MAX - strlen(real_filename)); | 184 | PATH_MAX - strlen(real_filename)); |
183 | sym = add_new_file(filename); | 185 | sym = add_new_file(filename); |
@@ -382,6 +384,9 @@ int main(int argc, char *argv[]) | |||
382 | srctree = getenv("SRCTREE"); | 384 | srctree = getenv("SRCTREE"); |
383 | if (!srctree) | 385 | if (!srctree) |
384 | srctree = getcwd(NULL, 0); | 386 | srctree = getcwd(NULL, 0); |
387 | kernsrctree = getenv("KBUILD_SRC"); | ||
388 | if (!kernsrctree) | ||
389 | kernsrctree = srctree; | ||
385 | if (argc != 3) { | 390 | if (argc != 3) { |
386 | usage(); | 391 | usage(); |
387 | exit(1); | 392 | exit(1); |