summaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2000-04-24 23:35:43 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2000-04-24 23:35:43 +0000
commit22869eeb0e34d82b020507d43a6f4df208bb7cc3 (patch)
tree5a4d401e9dfc167c6adf9a332aa403de4614e5b2 /gcc/gcc.c
parentc5a389715b9bb785cf453abf9aec6aaa97767565 (diff)
downloadgcc-22869eeb0e34d82b020507d43a6f4df208bb7cc3.tar.gz
* gcc.c (lookup_compiler): Make multiple passes for case
insensitive filesystems. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33393 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c69
1 files changed, 42 insertions, 27 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index a5e6bbe4e5f..d8dd5637729 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -5638,38 +5638,53 @@ lookup_compiler (name, length, language)
(!strcmp (cp->suffix, "-") && !strcmp (name, "-"))
|| (strlen (cp->suffix) < length
/* See if the suffix matches the end of NAME. */
-#ifdef OS2
- && ((!strcmp (cp->suffix,
- name + length - strlen (cp->suffix))
- || !strpbrk (cp->suffix, "ABCDEFGHIJKLMNOPQRSTUVWXYZ"))
- && !strcasecmp (cp->suffix,
- name + length - strlen (cp->suffix)))
-#else
&& !strcmp (cp->suffix,
name + length - strlen (cp->suffix))
-#endif
))
- {
- if (cp->spec[0][0] == '@')
- {
- struct compiler *new;
-
- /* An alias entry maps a suffix to a language.
- Search for the language; pass 0 for NAME and LENGTH
- to avoid infinite recursion if language not found.
- Construct the new compiler spec. */
- language = cp->spec[0] + 1;
- new = (struct compiler *) xmalloc (sizeof (struct compiler));
- new->suffix = cp->suffix;
- memcpy (new->spec,
- lookup_compiler (NULL_PTR, 0, language)->spec,
- sizeof new->spec);
- return new;
- }
+ break;
+ }
- /* A non-alias entry: return it. */
- return cp;
+#if defined (OS2) ||defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ /* look again, but case-insensitively this time. */
+ if (cp < compilers)
+ for (cp = compilers + n_compilers - 1; cp >= compilers; cp--)
+ {
+ if (/* The suffix `-' matches only the file name `-'. */
+ (!strcmp (cp->suffix, "-") && !strcmp (name, "-"))
+ || (strlen (cp->suffix) < length
+ /* See if the suffix matches the end of NAME. */
+ && ((!strcmp (cp->suffix,
+ name + length - strlen (cp->suffix))
+ || !strpbrk (cp->suffix, "ABCDEFGHIJKLMNOPQRSTUVWXYZ"))
+ && !strcasecmp (cp->suffix,
+ name + length - strlen (cp->suffix)))
+ ))
+ break;
+ }
+#endif
+
+
+ if (cp >= compilers)
+ {
+ if (cp->spec[0][0] == '@')
+ {
+ struct compiler *new;
+
+ /* An alias entry maps a suffix to a language.
+ Search for the language; pass 0 for NAME and LENGTH
+ to avoid infinite recursion if language not found.
+ Construct the new compiler spec. */
+ language = cp->spec[0] + 1;
+ new = (struct compiler *) xmalloc (sizeof (struct compiler));
+ new->suffix = cp->suffix;
+ memcpy (new->spec,
+ lookup_compiler (NULL_PTR, 0, language)->spec,
+ sizeof new->spec);
+ return new;
}
+
+ /* A non-alias entry: return it. */
+ return cp;
}
return 0;