Browse Source

Use new --output-data-var ld-tigcc switch instead of renaming hack.

git-svn-id: file:///var/svn/tigccpp/trunk@1157 9552661e-59e3-4036-b4f2-dbe53926924f
kevinkofler 17 years ago
parent
commit
4e8e376523
2 changed files with 5 additions and 33 deletions
  1. 2 0
      ktigcc/NEWS
  2. 3 33
      ktigcc/mainform.cpp

+ 2 - 0
ktigcc/NEWS

@@ -19,6 +19,8 @@ CVS HEAD (2007-06-17):
 * Now using the builtin pucrunch support in the latest ld-tigcc instead of
   ttpack and ttbin2oth. This also adds support for outputting unwrapped binaries
   for compressed files.
+* Now using the new ld-tigcc switch --output-data-var to set the data variable
+  file name on the computer instead of the old renaming hack.
 
 
 KTIGCC 1.06 (2006-11-25):

+ 3 - 33
ktigcc/mainform.cpp

@@ -3702,7 +3702,6 @@ void MainForm::projectAddFiles()
 }
 
 static bool stopCompilingFlag, errorsCompilingFlag;
-static bool ti89_targeted, ti92p_targeted, v200_targeted, dataFileGenerated;
 static QString compileStats;
 static QDateTime newestHeaderTimestamp;
 static QStringList objectFiles;
@@ -3827,7 +3826,6 @@ void MainForm::startCompiling()
   deletableAsmFiles.clear();
   errorList->errorListView->clear();
   programOutput=QString::null;
-  ti89_targeted=ti92p_targeted=v200_targeted=dataFileGenerated=FALSE;
   compileStats=QString::null;
   projectProgramOutputAction->setEnabled(FALSE);
   procio=static_cast<K3ProcIO *>(NULL);
@@ -4107,20 +4105,14 @@ void MainForm::procio_readReady()
         break;
       case 1:
         line=line.trimmed();
-        // Collect targets (the data file renaming needs to know them).
-        if (line=="TI-89") ti89_targeted=TRUE;
-        else if (line=="TI-92 Plus") ti92p_targeted=TRUE;
-        else if (line=="V200") v200_targeted=TRUE;
         // The next line is the first one to display in the dialog. (TIGCC IDE
         // does the same.)
-        else if (line.startsWith("Program Variable Name:",FALSE))
+        if (line.startsWith("Program Variable Name:",FALSE))
           ldTigccStatPhase=2;
         break;
       case 2:
         compileStats.append(line.simplified());
         compileStats.append('\n');
-        if (line.trimmed().startsWith("Data Variable Size:",FALSE))
-          dataFileGenerated=TRUE;
         break;
     }
   }
@@ -4492,7 +4484,8 @@ void MainForm::linkProject()
     *procio<<(QString("%1/bin/ld-tigcc").arg(tigcc_base))
            <<"-v"<<"-o"<<projectBaseName
            <<"-n"<<(settings.pack?packFullName:projectName);
-    if (!dataVarName.isNull()) *procio<<"-d"<<dataVarName;
+    if (!dataVarName.isNull())
+      *procio<<"-d"<<dataVarName<<"--output-data-var"<<projectBaseName+"-data";
     *procio<<linkerOptions<<objectFiles;
     if (settings.std_lib)
       *procio<<QString(settings.flash_os?"%1/lib/flashos.a"
@@ -4510,29 +4503,6 @@ void MainForm::linkProject()
     delete procio;
     procio=static_cast<K3ProcIO *>(NULL);
     if (errorsCompilingFlag || stopCompilingFlag) return;
-    // In the PPG case, the data files get a -data tag from the linker so the
-    // names don't conflict. In the uncompressed case, rename the data file here
-    // to match both that and the previous behavior.
-    if (!settings.pack && dataFileGenerated)  {
-      QDir qdir;
-      const int numTargets=3;
-      bool targeted[numTargets]={ti89_targeted,ti92p_targeted,v200_targeted};
-      static const char dextsbin[numTargets][5]={".y89",".y9x",".yv2"};
-      static const char dextswrapped[numTargets][5]={".89y",".9xy",".v2y"};
-      static const char (*dexts)[5]=settings.outputbin?dextsbin:dextswrapped;
-      for (int target=0; target<numTargets; target++) {
-        if (targeted[numTargets]) {
-          qdir.remove(projectBaseName+"-data"+dexts[target]);
-          if (!moveFile(projectBaseName+dexts[target],
-                        projectBaseName+"-data"+dexts[target])) {
-            new ErrorListItem(this,etError,QString::null,QString::null,
-                              "Failed to rename data file.",-1,-1);
-            errorsCompilingFlag=TRUE;
-          }
-          if (errorsCompilingFlag || stopCompilingFlag) return;
-        }
-      }
-    }
     if (settings.pack) {
       if (errorsCompilingFlag || stopCompilingFlag) return;
       statusBar()->message("Creating launcher...");