|
@@ -74,7 +74,8 @@ int main(int argc, char **argv)
|
|
char *relbasedir, *absbasedir;
|
|
char *relbasedir, *absbasedir;
|
|
char *progpath = argv[0];
|
|
char *progpath = argv[0];
|
|
char *basename;
|
|
char *basename;
|
|
- int ret, i, count = 0;
|
|
|
|
|
|
+ char *env_debug;
|
|
|
|
+ int ret, i, count = 0, debug;
|
|
|
|
|
|
/* Calculate the relative paths */
|
|
/* Calculate the relative paths */
|
|
basename = strrchr(progpath, '/');
|
|
basename = strrchr(progpath, '/');
|
|
@@ -157,13 +158,21 @@ int main(int argc, char **argv)
|
|
/* finish with NULL termination */
|
|
/* finish with NULL termination */
|
|
*cur = NULL;
|
|
*cur = NULL;
|
|
|
|
|
|
- if (getenv("BR_DEBUG_WRAPPER")) {
|
|
|
|
- fprintf(stderr, "Executing");
|
|
|
|
-
|
|
|
|
- for (i = 0; args[i]; i++)
|
|
|
|
- fprintf(stderr, " %s", args[i]);
|
|
|
|
-
|
|
|
|
- fprintf(stderr, "\n");
|
|
|
|
|
|
+ /* Debug the wrapper to see actual arguments passed to
|
|
|
|
+ * the compiler:
|
|
|
|
+ * unset, empty, or 0: do not trace
|
|
|
|
+ * set to 1 : trace all arguments on a single line
|
|
|
|
+ * set to 2 : trace one argument per line
|
|
|
|
+ */
|
|
|
|
+ if ((env_debug = getenv("BR_DEBUG_WRAPPER"))) {
|
|
|
|
+ debug = atoi(env_debug);
|
|
|
|
+ if (debug > 0) {
|
|
|
|
+ fprintf(stderr, "Toolchain wrapper executing:");
|
|
|
|
+ for (i = 0; args[i]; i++)
|
|
|
|
+ fprintf(stderr, "%s'%s'",
|
|
|
|
+ (debug == 2)?"\n ":" ", args[i]);
|
|
|
|
+ fprintf(stderr, "\n");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
if (execv(path, args))
|
|
if (execv(path, args))
|