]> git.sur5r.net Git - cc65/commitdiff
In error or warning messages, output the name of the library if this is
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 7 Jun 2012 19:59:51 +0000 (19:59 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 7 Jun 2012 19:59:51 +0000 (19:59 +0000)
relevant. It's otherwise difficult to know what happens when ar65 is called
from within a makefile or similar.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5695 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/ar65/exports.c
src/ar65/library.c
src/ar65/library.h
src/ar65/main.c
src/ar65/objdata.c
src/ar65/objfile.c

index 488d584970b1d1042e8f7497629a8ddaba8b29d5..8f74c670ff965ba9de7aa63b5efe9457d7512e4c 100644 (file)
@@ -6,7 +6,7 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998-2011, Ullrich von Bassewitz                                      */
+/* (C) 1998-2012, Ullrich von Bassewitz                                      */
 /*                Roemerstrasse 52                                           */
 /*                D-70794 Filderstadt                                        */
 /* EMail:         uz@cc65.org                                                */
@@ -41,6 +41,7 @@
 
 /* ar65 */
 #include "error.h"
+#include "library.h"
 #include "objdata.h"
 #include "exports.h"
 
@@ -112,9 +113,9 @@ void ExpInsert (const char* Name, const ObjData* Module)
     while (1) {
        if (strcmp (L->Name, Name) == 0) {
            /* Duplicate entry */
-           Warning ("External symbol `%s' in module `%s' is duplicated in "
-                    "module `%s'",
-                    Name, L->Name, Module->Name);
+                   Warning ("External symbol `%s' in module `%s', library `%s' "
+                     "is duplicated in module `%s'",
+                    Name, L->Name, LibName, Module->Name);
        }
        if (L->Next == 0) {
            break;
index cffb85cd1a2a6798837def07b6b15e3bb334ed2a..c7c9e02c29bb1f5e8e61d5aeedb70d2d4e6dbcb5 100644 (file)
@@ -6,7 +6,7 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998-2011, Ullrich von Bassewitz                                      */
+/* (C) 1998-2012, Ullrich von Bassewitz                                      */
 /*                Roemerstrasse 52                                           */
 /*                D-70794 Filderstadt                                        */
 /* EMail:         uz@cc65.org                                                */
 /*****************************************************************************/
 
 
+                        
+/* Name of the library file */
+const char*            LibName = 0;
 
 /* File descriptor for the library file */
 FILE*                  NewLib = 0;
 static FILE*                   Lib = 0;
-static const char*     LibName = 0;
 
 /* The library header */
-static LibHeader               Header = {
+static LibHeader       Header = {
     LIB_MAGIC,
     LIB_VERSION,
     0,
@@ -99,7 +101,7 @@ static void ReadHeader (void)
     }
     Header.Flags   = Read16 (Lib);
     Header.IndexOffs = Read32 (Lib);
-}
+}                                                  
 
 
 
@@ -388,7 +390,7 @@ void LibClose (void)
     }
     if (NewLib && fclose (NewLib) != 0) {
        Error ("Problem closing temporary library file: %s", strerror (errno));
-    }                                      
+    }
 }
 
 
index bd4b6edbd90b34a52f53e7d79df9f58ff3385195..09a489478271e80c4dae61727374855574b979e2 100644 (file)
@@ -6,10 +6,10 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998     Ullrich von Bassewitz                                        */
-/*              Wacholderweg 14                                              */
-/*              D-70597 Stuttgart                                            */
-/* EMail:       uz@musoftware.de                                             */
+/* (C) 1998-2012, Ullrich von Bassewitz                                      */
+/*                Roemerstrasse 52                                           */
+/*                D-70794 Filderstadt                                        */
+/* EMail:         uz@cc65.org                                                */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
@@ -48,6 +48,9 @@
 
 
 
+/* Name of the library file */
+extern const char* LibName;
+
 /* File descriptor for the new library file */
 extern FILE*   NewLib;
 
@@ -73,7 +76,7 @@ unsigned long LibCopyTo (FILE* F, unsigned long Bytes);
 void LibCopyFrom (unsigned long Pos, unsigned long Bytes, FILE* F);
 /* Copy data from the library file into another file */
 
-void LibClose (void);  
+void LibClose (void);
 /* Write remaining data, close both files and copy the temp file to the old
  * filename
  */
index b2ba84ee9224518859660b373ad7ff33c258a744..6daf24324693fc4d9e8bd2b31b1595799b3cbf51 100644 (file)
@@ -6,12 +6,12 @@
 /*                                                                          */
 /*                                                                          */
 /*                                                                          */
-/* (C) 1998-2011, Ullrich von Bassewitz                                      */
+/* (C) 1998-2012, Ullrich von Bassewitz                                      */
 /*                Roemerstrasse 52                                           */
 /*                D-70794 Filderstadt                                        */
 /* EMail:         uz@cc65.org                                                */
-/*                                                                          */
-/*                                                                          */
+/*                                                                          */
+/*                                                                          */
 /* This software is provided 'as-is', without any expressed or implied      */
 /* warranty.  In no event will the authors be held liable for any damages    */
 /* arising from the use of this software.                                   */
@@ -121,7 +121,7 @@ int main (int argc, char* argv [])
 
            case 'V':
                fprintf (stderr,
-                                "ar65 V%s - (C) Copyright 1998-2011 Ullrich von Bassewitz\n",
+                                "ar65 V%s - (C) Copyright 1998-2012 Ullrich von Bassewitz\n",
                         GetVersionAsString ());
                break;
 
index e6c8372b74348ba44a61b05f359906cea5b0c93d..b22ad023ae346f865853ede64449a0f85374c57c 100644 (file)
@@ -6,7 +6,7 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998-2011, Ullrich von Bassewitz                                      */
+/* (C) 1998-2012, Ullrich von Bassewitz                                      */
 /*                Roemerstrasse 52                                           */
 /*                D-70794 Filderstadt                                        */
 /* EMail:         uz@cc65.org                                                */
@@ -41,6 +41,7 @@
 
 /* ar65 */
 #include "error.h"
+#include "library.h"
 #include "objdata.h"
 
 
@@ -107,7 +108,7 @@ void FreeObjData (ObjData* O)
 void ClearObjData (ObjData* O)
 /* Remove any data stored in O */
 {
-    unsigned I;                
+    unsigned I;
     xfree (O->Name);
     O->Name = 0;
     for (I = 0; I < CollCount (&O->Strings); ++I) {
@@ -164,7 +165,7 @@ void DelObjData (const char* Module)
     }
 
     /* Not found! */
-    Warning ("Module `%s' not found in library", Module);
+    Warning ("Module `%s' not found in library `%s'", Module, LibName);
 }
 
 
index 1d52f7061fa3f3920d73024d6659cd8f7a815865..7d349c7252b27aea7d73978c0239619f6c3fa975 100644 (file)
@@ -267,7 +267,8 @@ void ObjAdd (const char* Name)
         * and the external one.
         */
        if (difftime ((time_t)O->MTime, StatBuf.st_mtime) > 0.0) {
-           Warning ("Replacing module `%s' by older version", O->Name);
+           Warning ("Replacing module `%s' by older version in library `%s'",
+                     O->Name, LibName);
        }
 
         /* Free data */
@@ -312,7 +313,7 @@ void ObjExtract (const char* Name)
 
     /* Bail out if the module does not exist */
     if (O == 0) {
-       Error ("Module `%s' not found in library", Module);
+       Error ("Module `%s' not found in library `%s'", Module, LibName);
     }
 
     /* Open the output file */