From: Mathias De Maré Date: Mon, 19 Sep 2016 08:38:13 +0000 (+0200) Subject: Convert argument to '--sysroot' option to relative path X-Git-Tag: v3.4~95 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fe42d6f7b739e8d42811bf46bcccfafa728847a2;p=thirdparty%2Fccache.git Convert argument to '--sysroot' option to relative path Previously, only the argument to '--sysroot=' was converted. This changeset adds support for '--sysroot'. --- diff --git a/ccache.c b/ccache.c index 8ffadccc1..76139b935 100644 --- a/ccache.c +++ b/ccache.c @@ -2407,6 +2407,21 @@ cc_process_args(struct args *args, struct args **preprocessor_args, free(option); continue; } + // Alternate form of specifying sysroot without = + if (str_eq(argv[i], "--sysroot")) { + if (i == argc-1) { + cc_log("Missing argument to %s", argv[i]); + stats_update(STATS_ARGS); + result = false; + goto out; + } + args_add(stripped_args, argv[i]); + char *relpath = make_relative_path(x_strdup(argv[i+1])); + args_add(stripped_args, relpath); + i++; + free(relpath); + continue; + } if (str_startswith(argv[i], "-Wp,")) { if (str_eq(argv[i], "-Wp,-P") || strstr(argv[i], ",-P,")