diff options
Diffstat (limited to 'scripts/basic')
-rw-r--r-- | scripts/basic/docproc.c | 13 | ||||
-rw-r--r-- | scripts/basic/fixdep.c | 5 |
2 files changed, 12 insertions, 6 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; #define NOFUNCTION "-nofunction" #define NODOCSECTIONS "-no-doc-sections" -char *srctree; +static char *srctree, *kernsrctree; void usage (void) { @@ -77,7 +77,8 @@ void usage (void) fprintf(stderr, "Input is read from file.tmpl. Output is sent to stdout\n"); fprintf(stderr, "doc: frontend when generating kernel documentation\n"); fprintf(stderr, "depend: generate list of files referenced within file\n"); - fprintf(stderr, "Environment variable SRCTREE: absolute path to kernel source tree.\n"); + fprintf(stderr, "Environment variable SRCTREE: absolute path to sources.\n"); + fprintf(stderr, " KBUILD_SRC: absolute path to kernel source tree.\n"); } /* @@ -96,8 +97,8 @@ void exec_kernel_doc(char **svec) exit(1); case 0: memset(real_filename, 0, sizeof(real_filename)); - strncat(real_filename, srctree, PATH_MAX); - strncat(real_filename, KERNELDOCPATH KERNELDOC, + strncat(real_filename, kernsrctree, PATH_MAX); + strncat(real_filename, "/" KERNELDOCPATH KERNELDOC, PATH_MAX - strlen(real_filename)); execvp(real_filename, svec); fprintf(stderr, "exec "); @@ -178,6 +179,7 @@ void find_export_symbols(char * filename) char real_filename[PATH_MAX + 1]; memset(real_filename, 0, sizeof(real_filename)); strncat(real_filename, srctree, PATH_MAX); + strncat(real_filename, "/", PATH_MAX - strlen(real_filename)); strncat(real_filename, filename, PATH_MAX - strlen(real_filename)); sym = add_new_file(filename); @@ -382,6 +384,9 @@ int main(int argc, char *argv[]) srctree = getenv("SRCTREE"); if (!srctree) srctree = getcwd(NULL, 0); + kernsrctree = getenv("KBUILD_SRC"); + if (!kernsrctree) + kernsrctree = srctree; if (argc != 3) { usage(); exit(1); diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index 8912c0f5460b..72c15205bb2b 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c @@ -373,10 +373,11 @@ void print_deps(void) void traps(void) { static char test[] __attribute__((aligned(sizeof(int)))) = "CONF"; + int *p = (int *)test; - if (*(int *)test != INT_CONF) { + if (*p != INT_CONF) { fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianess? %#x\n", - *(int *)test); + *p); exit(2); } } |