better -M tests

This commit is contained in:
Andrew Tridgell 2002-04-24 14:07:37 +02:00
parent d53d4da65e
commit ce3a6b06f4
3 changed files with 18 additions and 0 deletions

View File

@ -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]);

View File

@ -49,6 +49,7 @@ enum stats {
STATS_NOINPUT,
STATS_MULTIPLE,
STATS_CONFTEST,
STATS_UNSUPPORTED,
STATS_END
};

View File

@ -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 },