diff options
author | Jack Howarth <howarth@bromo.med.uc.edu> | 2010-08-17 13:22:28 +0000 |
---|---|---|
committer | Iain Sandoe <iains@gcc.gnu.org> | 2010-08-17 13:22:28 +0000 |
commit | 2642f659a685886012ce45f1e04b82232878fc5a (patch) | |
tree | bab5c0bd0898b585bfbdc2cef1cac677a2b6ad2f /gcc/gcc.c | |
parent | a85615d28a72fcc16591d60d82f623feb3df7442 (diff) | |
download | gcc-2642f659a685886012ce45f1e04b82232878fc5a.zip gcc-2642f659a685886012ce45f1e04b82232878fc5a.tar.gz gcc-2642f659a685886012ce45f1e04b82232878fc5a.tar.bz2 |
gcc.c (spec_function): Add remove-outfile.
2010-08-17 Jack Howarth <howarth@bromo.med.uc.edu>
* gcc.c (spec_function): Add remove-outfile.
(remove_outfile_spec_function): New function.
* config/darwin.h (LINK_SPEC): Add removal of
-ldl, -lm and -lpthread.
* invoke.texi (replace-outfile): Document.
From-SVN: r163305
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r-- | gcc/gcc.c | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -317,6 +317,7 @@ static const char *getenv_spec_function (int, const char **); static const char *if_exists_spec_function (int, const char **); static const char *if_exists_else_spec_function (int, const char **); static const char *replace_outfile_spec_function (int, const char **); +static const char *remove_outfile_spec_function (int, const char **); static const char *version_compare_spec_function (int, const char **); static const char *include_spec_function (int, const char **); static const char *find_file_spec_function (int, const char **); @@ -1615,6 +1616,7 @@ static const struct spec_function static_spec_functions[] = { "if-exists", if_exists_spec_function }, { "if-exists-else", if_exists_else_spec_function }, { "replace-outfile", replace_outfile_spec_function }, + { "remove-outfile", remove_outfile_spec_function }, { "version-compare", version_compare_spec_function }, { "include", include_spec_function }, { "find-file", find_file_spec_function }, @@ -8274,6 +8276,27 @@ replace_outfile_spec_function (int argc, const char **argv) return NULL; } +/* remove-outfile built-in spec function. + * + * This looks for the first argument in the outfiles array's name and + * removes it. */ + +static const char * +remove_outfile_spec_function (int argc, const char **argv) +{ + int i; + /* Must have exactly one argument. */ + if (argc != 1) + abort (); + + for (i = 0; i < n_infiles; i++) + { + if (outfiles[i] && !strcmp (outfiles[i], argv[0])) + outfiles[i] = NULL; + } + return NULL; +} + /* Given two version numbers, compares the two numbers. A version number must match the regular expression ([1-9][0-9]*|0)(\.([1-9][0-9]*|0))* |