When checking for duplicated modules use absolute library paths
authorjesusc <jesusc@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 10 Sep 2003 17:33:59 +0000 (17:33 +0000)
committerjesusc <jesusc@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 10 Sep 2003 17:33:59 +0000 (17:33 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2884 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
as/mcs51/lklibr.c
link/z80/lklibr.c

index a58a0353ab8d783a0a8f80459b3275f0bd7b405b..04801903a5b279b932817ddd3152143d90a553c4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2003-09-10  Jesus Calvino-Fraga <jesusc@ece.ubc.ca>
+
+       When checking for duplicated modules, use absolute paths
+       instead of relative paths.  Files changed:
+
+       * as/mcs51/lklib.c
+       * link/z80/lklib.c
+
 2003-09-09  Erik Petrich <epetrich@ivorytower.norman.ok.us>
 
        * src/SDCCicode.c (geniCodeLogic): fixed bug #797572
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)
                         {
index c712d6745f7cad74f7d3ca8914f818557a27ffe3..4c1881ac47366e9793ea13ae0bdf7b08e17ba7b0 100644 (file)
@@ -577,8 +577,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)
                         {