Add CCACHE_STRIPC option to remove an unwarranted warning when using ccache with the Solaris Workshop C++ compiler
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10996 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
b1e7bbd831
commit
a648bb7f38
2 changed files with 21 additions and 1 deletions
|
|
@ -68,6 +68,9 @@ char *stats_file = NULL;
|
||||||
/* can we safely use the unification hashing backend? */
|
/* can we safely use the unification hashing backend? */
|
||||||
static int enable_unify;
|
static int enable_unify;
|
||||||
|
|
||||||
|
/* should we strip -c when running the preprocessor only? */
|
||||||
|
static int strip_c_option;
|
||||||
|
|
||||||
/* customisation for using the SWIG compiler */
|
/* customisation for using the SWIG compiler */
|
||||||
static int swig;
|
static int swig;
|
||||||
|
|
||||||
|
|
@ -230,6 +233,10 @@ static void to_cache(ARGS *args)
|
||||||
x_asprintf(&tmp_stderr, "%s/tmp.stderr.%s", temp_dir, tmp_string());
|
x_asprintf(&tmp_stderr, "%s/tmp.stderr.%s", temp_dir, tmp_string());
|
||||||
x_asprintf(&tmp_outfiles, "%s/tmp.outfiles.%s", temp_dir, tmp_string());
|
x_asprintf(&tmp_outfiles, "%s/tmp.outfiles.%s", temp_dir, tmp_string());
|
||||||
|
|
||||||
|
if (strip_c_option) {
|
||||||
|
args_add(stripped_args, "-c");
|
||||||
|
}
|
||||||
|
|
||||||
if (output_file) {
|
if (output_file) {
|
||||||
args_add(args, "-o");
|
args_add(args, "-o");
|
||||||
args_add(args, output_file);
|
args_add(args, output_file);
|
||||||
|
|
@ -859,7 +866,9 @@ static void process_args(int argc, char **argv)
|
||||||
|
|
||||||
/* we must have -c */
|
/* we must have -c */
|
||||||
if (strcmp(argv[i], "-c") == 0) {
|
if (strcmp(argv[i], "-c") == 0) {
|
||||||
args_add(stripped_args, argv[i]);
|
if (!strip_c_option) {
|
||||||
|
args_add(stripped_args, argv[i]);
|
||||||
|
}
|
||||||
found_c_opt = 1;
|
found_c_opt = 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -1126,6 +1135,10 @@ static void ccache(int argc, char *argv[])
|
||||||
failed();
|
failed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getenv("CCACHE_STRIPC")) {
|
||||||
|
strip_c_option = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (getenv("CCACHE_UNIFY")) {
|
if (getenv("CCACHE_UNIFY")) {
|
||||||
enable_unify = 1;
|
enable_unify = 1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -261,6 +261,13 @@ systems like this you can use the CCACHE_EXTENSION option to override
|
||||||
the default. On HP-UX set this environment variable to "i" if you use
|
the default. On HP-UX set this environment variable to "i" if you use
|
||||||
the aCC compiler.
|
the aCC compiler.
|
||||||
|
|
||||||
|
dit(bf(CCACHE_STRIPC)) If you set the environment variable
|
||||||
|
CCACHE_STRIPC then ccache will strip the -c option when invoking
|
||||||
|
the preprocessor. This option is primarily for the Sun Workshop
|
||||||
|
C++ compiler as without this option an unwarranted warning is displayed:
|
||||||
|
CC: Warning: "-E" redefines product from "object" to "source (stdout)"
|
||||||
|
when -E and -c is used together.
|
||||||
|
|
||||||
dit(bf(CCACHE_SWIG)) When using SWIG as the compiler and it does not
|
dit(bf(CCACHE_SWIG)) When using SWIG as the compiler and it does not
|
||||||
have 'swig' in the executable name, then the CCACHE_SWIG environment
|
have 'swig' in the executable name, then the CCACHE_SWIG environment
|
||||||
variable needs to be set in order for ccache to work correctly with
|
variable needs to be set in order for ccache to work correctly with
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue