Commit 5d7bb90c by Richard Kenner

(unused_prefix_warning): Include machine_suffix if require_machine_suffix.

(warn_B, warn_std, warn_std_ptr): New variables.
(process_commands): Use them and NULL_PTR as WARN arg to add_prefix.

From-SVN: r10846
parent f2cf3e1e
...@@ -1918,8 +1918,12 @@ unused_prefix_warnings (pprefix) ...@@ -1918,8 +1918,12 @@ unused_prefix_warnings (pprefix)
{ {
if (pl->used_flag_ptr != 0 && !*pl->used_flag_ptr) if (pl->used_flag_ptr != 0 && !*pl->used_flag_ptr)
{ {
error ("file path prefix `%s' never used", if (pl->require_machine_suffix && machine_suffix)
pl->prefix); error ("file path prefix `%s%s' never used", pl->prefix,
machine_suffix);
else
error ("file path prefix `%s' never used", pl->prefix);
/* Prevent duplicate warnings. */ /* Prevent duplicate warnings. */
*pl->used_flag_ptr = 1; *pl->used_flag_ptr = 1;
} }
...@@ -2334,6 +2338,15 @@ static int n_infiles; ...@@ -2334,6 +2338,15 @@ static int n_infiles;
static char **outfiles; static char **outfiles;
/* Used to track if none of the -B paths are used. */
static int warn_B;
/* Used to track if standard path isn't used and -b or -V is specified. */
static int warn_std;
/* Gives value to pass as "warn" to add_prefix for standard prefixes. */
static int *warn_std_ptr = NULL_PTR;
/* Create the vector `switches' and its contents. /* Create the vector `switches' and its contents.
Store its length in `n_switches'. */ Store its length in `n_switches'. */
...@@ -2616,6 +2629,8 @@ process_command (argc, argv) ...@@ -2616,6 +2629,8 @@ process_command (argc, argv)
spec_machine = argv[++i]; spec_machine = argv[++i];
else else
spec_machine = p + 1; spec_machine = p + 1;
warn_std_ptr = &warn_std;
break; break;
case 'B': case 'B':
...@@ -2628,10 +2643,10 @@ process_command (argc, argv) ...@@ -2628,10 +2643,10 @@ process_command (argc, argv)
value = argv[++i]; value = argv[++i];
else else
value = p + 1; value = p + 1;
add_prefix (&exec_prefixes, value, 1, 0, temp); add_prefix (&exec_prefixes, value, 1, 0, &warn_B);
add_prefix (&startfile_prefixes, value, 1, 0, temp); add_prefix (&startfile_prefixes, value, 1, 0, &warn_B);
add_prefix (&include_prefixes, concat (value, "include"), add_prefix (&include_prefixes, concat (value, "include"),
1, 0, 0); 1, 0, NULL_PTR);
/* As a kludge, if the arg is "[foo/]stageN/", just add /* As a kludge, if the arg is "[foo/]stageN/", just add
"[foo/]include" to the include prefix. */ "[foo/]include" to the include prefix. */
...@@ -2647,13 +2662,15 @@ process_command (argc, argv) ...@@ -2647,13 +2662,15 @@ process_command (argc, argv)
|| value[len - 1] == DIR_SEPARATOR)) || value[len - 1] == DIR_SEPARATOR))
{ {
if (len == 7) if (len == 7)
add_prefix (&include_prefixes, "include", 1, 0, 0); add_prefix (&include_prefixes, "include",
1, 0, NULL_PTR);
else else
{ {
char *string = xmalloc (len + 1); char *string = xmalloc (len + 1);
strncpy (string, value, len-7); strncpy (string, value, len-7);
strcat (string, "include"); strcat (string, "include");
add_prefix (&include_prefixes, string, 1, 0, 0); add_prefix (&include_prefixes, string,
1, 0, NULL_PTR);
} }
} }
} }
...@@ -2677,6 +2694,7 @@ process_command (argc, argv) ...@@ -2677,6 +2694,7 @@ process_command (argc, argv)
else else
spec_version = p + 1; spec_version = p + 1;
compiler_version = spec_version; compiler_version = spec_version;
warn_std_ptr = &warn_std;
break; break;
case 's': case 's':
...@@ -2720,12 +2738,12 @@ process_command (argc, argv) ...@@ -2720,12 +2738,12 @@ process_command (argc, argv)
/* Use 2 as fourth arg meaning try just the machine as a suffix, /* Use 2 as fourth arg meaning try just the machine as a suffix,
as well as trying the machine and the version. */ as well as trying the machine and the version. */
#ifndef OS2 #ifndef OS2
add_prefix (&exec_prefixes, standard_exec_prefix, 0, 2, NULL_PTR); add_prefix (&exec_prefixes, standard_exec_prefix, 0, 2, warn_std_ptr);
add_prefix (&exec_prefixes, standard_exec_prefix_1, 0, 2, NULL_PTR); add_prefix (&exec_prefixes, standard_exec_prefix_1, 0, 2, warn_std_ptr);
#endif #endif
add_prefix (&startfile_prefixes, standard_exec_prefix, 0, 1, NULL_PTR); add_prefix (&startfile_prefixes, standard_exec_prefix, 0, 1, warn_std_ptr);
add_prefix (&startfile_prefixes, standard_exec_prefix_1, 0, 1, NULL_PTR); add_prefix (&startfile_prefixes, standard_exec_prefix_1, 0, 1, warn_std_ptr);
tooldir_prefix = concat3 (tooldir_base_prefix, spec_machine, tooldir_prefix = concat3 (tooldir_base_prefix, spec_machine,
dir_separator_str); dir_separator_str);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment