]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
better -M tests
authorAndrew Tridgell <tridge@samba.org>
Wed, 24 Apr 2002 12:07:37 +0000 (14:07 +0200)
committerAndrew Tridgell <tridge@samba.org>
Wed, 24 Apr 2002 12:07:37 +0000 (14:07 +0200)
ccache.c
ccache.h
stats.c

index 695a61482918f65c4cbc1c211ac0a756e5f52aaf..4ce6894623fe1c0ee451d5b447ecd1a7a482e2f7 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -507,6 +507,22 @@ static void process_args(int argc, char **argv)
                        failed();
                }
 
+               /* cope with -MD, -MM, -MMD before the code below chucks them */
+               if (strcmp(argv[i], "-MD") == 0 ||
+                   strcmp(argv[i], "-MM") == 0 ||
+                   strcmp(argv[i], "-MMD") == 0) {
+                       args_add(stripped_args, argv[i]);
+                       continue;
+               }
+
+               /* check for bad options */
+               if (strncmp(argv[i], "-M", 2) == 0) {
+                       cc_log("argument %s is unsupported\n", argv[i]);
+                       stats_update(STATS_UNSUPPORTED);
+                       failed();
+                       continue;
+               }
+
                /* we must have -c */
                if (strcmp(argv[i], "-c") == 0) {
                        args_add(stripped_args, argv[i]);
index 7d47e21412599de98db002b04299b881d5e1aad2..acd111311c00bc72a0d9643203c9be8ef5f8cbc3 100644 (file)
--- a/ccache.h
+++ b/ccache.h
@@ -49,6 +49,7 @@ enum stats {
        STATS_NOINPUT,
        STATS_MULTIPLE,
        STATS_CONFTEST,
+       STATS_UNSUPPORTED,
 
        STATS_END
 };
diff --git a/stats.c b/stats.c
index 8092f98fcc6b244cce89740d010db3fe16993253..25860fbb50f393128e155376191f98d4dea3a9dd 100644 (file)
--- a/stats.c
+++ b/stats.c
@@ -51,6 +51,7 @@ static struct {
        { STATS_ARGS,         "bad compiler arguments         ", NULL, 0 },
        { STATS_NOTC,         "not a C/C++ file               ", NULL, 0 },
        { STATS_CONFTEST,     "autoconf compile/link          ", NULL, 0 },
+       { STATS_UNSUPPORTED,  "unsupported compiler option    ", NULL, 0 },
        { STATS_DEVICE,       "output to a non-regular file   ", NULL, 0 },
        { STATS_NOINPUT,      "no input file                  ", NULL, 0 },
        { STATS_NUMFILES,     "files in cache                 ", NULL, FLAG_NOZERO|FLAG_ALWAYS },