When checking for duplicated modules use absolute library paths
[fw/sdcc] / as / mcs51 / lklibr.c
index 21cd004c47693fc704a0397bf06883989240aeff..fb8091c467e58648a754d60f0ab221a91bfb8469 100644 (file)
@@ -721,8 +721,20 @@ int fndsym( char *name )
                 }
                 else
                 {
-                    if( !( EQ(FirstFound->libspc, ThisLibr->libspc) && 
-                           EQ(FirstFound->relfil, ThisLibr->relfil) ) )
+                    char absPath1[PATH_MAX];
+                    char absPath2[PATH_MAX];
+#if defined(__BORLANDC__) || defined(_MSC_VER)
+                    int j;
+
+                    _fullpath(absPath1, FirstFound->libspc, PATH_MAX);
+                    _fullpath(absPath2, ThisLibr->libspc, PATH_MAX);
+                    for(j=0; absPath1[j]!=0; j++) absPath1[j]=tolower(absPath1[j]);
+                    for(j=0; absPath2[j]!=0; j++) absPath2[j]=tolower(absPath2[j]);
+#else
+                    realpath(FirstFound->libspc, absPath1);
+                    realpath(ThisLibr->libspc, absPath2);
+#endif
+                    if( !( EQ(absPath1, absPath2) && EQ(FirstFound->relfil, ThisLibr->relfil) ) )
                     {
                         if(numfound==1)
                         {