OSDN Git Service

Revert:
[pf3gnuchains/gcc-fork.git] / gcc / incpath.c
index e5fe8db..9cc783f 100644 (file)
@@ -1,6 +1,6 @@
 /* Set up combined include path chain for the preprocessor.
    Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
    Free Software Foundation, Inc.
 
    Broken out of cppinit.c and cppfiles.c and rewritten Mar 2003.
 #include "incpath.h"
 #include "cppdefault.h"
 
-/* Windows does not natively support inodes, and neither does MSDOS.
-   Cygwin's emulation can generate non-unique inodes, so don't use it.
+/* Microsoft Windows does not natively support inodes.
    VMS has non-numeric inodes.  */
 #ifdef VMS
 # define INO_T_EQ(A, B) (!memcmp (&(A), &(B), sizeof (A)))
 # define INO_T_COPY(DEST, SRC) memcpy(&(DEST), &(SRC), sizeof (SRC))
-#elif !((defined _WIN32 && !defined (_UWIN)) || defined __MSDOS__)
+#elif !defined (HOST_LACKS_INODE_NUMBERS)
 # define INO_T_EQ(A, B) ((A) == (B))
 # define INO_T_COPY(DEST, SRC) (DEST) = (SRC)
 #endif
@@ -46,7 +45,7 @@
 #define DIRS_EQ(A, B) ((A)->dev == (B)->dev \
        && INO_T_EQ((A)->ino, (B)->ino))
 #else
-#define DIRS_EQ(A, B) (!strcasecmp ((A)->name, (B)->name))
+#define DIRS_EQ(A, B) (!strcmp ((A)->canonical_name, (B)->canonical_name))
 #endif
 
 static const char dir_separator_str[] = { DIR_SEPARATOR, 0 };
@@ -172,8 +171,8 @@ add_standard_paths (const char *sysroot, const char *iprefix,
                   && strncmp (p->fname, cpp_PREFIX, cpp_PREFIX_len) == 0)
            {
              static const char *relocated_prefix;
-             /* If this path starts with the configure-time prefix, 
-                but the compiler has been relocated, replace it 
+             /* If this path starts with the configure-time prefix,
+                but the compiler has been relocated, replace it
                 with the run-time prefix.  The run-time exec prefix
                 is GCC_EXEC_PREFIX.  Compute the path from there back
                 to the toplevel prefix.  */
@@ -183,13 +182,13 @@ add_standard_paths (const char *sysroot, const char *iprefix,
                  /* Make relative prefix expects the first argument
                     to be a program, not a directory.  */
                  dummy = concat (gcc_exec_prefix, "dummy", NULL);
-                 relocated_prefix 
+                 relocated_prefix
                    = make_relative_prefix (dummy,
                                            cpp_EXEC_PREFIX,
                                            cpp_PREFIX);
                }
              str = concat (relocated_prefix,
-                           p->fname + cpp_PREFIX_len, 
+                           p->fname + cpp_PREFIX_len,
                            NULL);
              str = update_path (str, p->component);
            }
@@ -400,7 +399,7 @@ add_path (char *path, int chain, int cxx_aware, bool user_supplied_p)
   char* end = path + pathlen - 1;
   /* Preserve the lead '/' or lead "c:/".  */
   char* start = path + (pathlen > 2 && path[1] == ':' ? 3 : 1);
-  
+
   for (; end > start && IS_DIR_SEPARATOR (*end); end--)
     *end = 0;
 #endif
@@ -408,6 +407,9 @@ add_path (char *path, int chain, int cxx_aware, bool user_supplied_p)
   p = XNEW (cpp_dir);
   p->next = NULL;
   p->name = path;
+#ifndef INO_T_EQ
+  p->canonical_name = lrealpath (path);
+#endif
   if (chain == SYSTEM || chain == AFTER)
     p->sysp = 1 + !cxx_aware;
   else