From fc8a1c062be1ff690392e13a17c47b9de7c59a50 Mon Sep 17 00:00:00 2001 From: jesusc Date: Wed, 10 Sep 2003 17:33:59 +0000 Subject: [PATCH] When checking for duplicated modules use absolute library paths git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2884 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 8 ++++++++ as/mcs51/lklibr.c | 16 ++++++++++++++-- link/z80/lklibr.c | 16 ++++++++++++++-- 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index a58a0353..04801903 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2003-09-10 Jesus Calvino-Fraga + + 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 * src/SDCCicode.c (geniCodeLogic): fixed bug #797572 diff --git a/as/mcs51/lklibr.c b/as/mcs51/lklibr.c index 21cd004c..fb8091c4 100644 --- a/as/mcs51/lklibr.c +++ b/as/mcs51/lklibr.c @@ -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) { diff --git a/link/z80/lklibr.c b/link/z80/lklibr.c index c712d674..4c1881ac 100644 --- a/link/z80/lklibr.c +++ b/link/z80/lklibr.c @@ -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) { -- 2.30.2