Code

Add new property to <cc>, refreshCache, to force recomp
authorishmal <ishmal@users.sourceforge.net>
Fri, 2 May 2008 15:32:07 +0000 (15:32 +0000)
committerishmal <ishmal@users.sourceforge.net>
Fri, 2 May 2008 15:32:07 +0000 (15:32 +0000)
build.xml
buildtool.cpp

index 91b6eb007693a83aed317c0b3a8e625e3a17c5f9..8d032e22c27f23477d058e85a56eb8fb7435a560 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -7,7 +7,7 @@
  *   Bob Jamison
  *   Others 
  *
- * Copyright (C) 2006-2007 Inkscape.org
+ * Copyright (C) 2006-2008 Inkscape.org
  *
  *  This library is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU Lesser General Public
 
   <!-- set global properties for this build -->
   <property environment="env"/>
-  <property name="version"     value="0.46+devel"/>
-  <property name="src"         location="src"/>
-  <property name="lib"         location="lib"/>
-  <property name="build"       location="build"/>
-  <property name="dist"        location="inkscape"/>
+  <property name="version"       value="0.46+devel"/>
+  <property name="src"           location="src"/>
+  <property name="lib"           location="lib"/>
+  <property name="build"         location="build"/>
+  <property name="dist"          location="inkscape"/>
 
   <!-- Use these settings for the native compiler -->  
   <!-- -->
-  <property name="arch"        value="mingw32-"/>
-  <property name="archutil"    value=""/>
-  <property name="gtk"         location="c:/devlibs"/>
+  <property name="arch"          value="mingw32-"/>
+  <property name="archutil"      value=""/>
+  <property name="gtk"           location="c:/devlibs"/>
   <!-- -->
 
   <!-- Use these settings for the cross compiler -->  
   <!--
-  <property name="arch"        value="i686-pc-mingw32-"/>
-  <property name="archutil"    value="${arch}"/>
-  <property name="gtk"         location="/target"/>
+  <property name="arch"          value="i686-pc-mingw32-"/>
+  <property name="archutil"      value="${arch}"/>
+  <property name="gtk"           location="/target"/>
   -->
 
+  <!-- Extra properties -->  
+  <property name="refresh"       value="false"/>
 
 
   <!--
     <!-- Compile from source to build -->
     <cc cc="${arch}gcc" cxx="${arch}g++"
              destdir="${build}/obj"
-                        continueOnError="false">
+                        continueOnError="false"
+                        refreshCache="${refresh}">
         <fileset dir="${src}">
             <!-- THINGS TO EXCLUDE -->
             <exclude name="2geom/chebyshev.cpp"/>
index ead2e8da0fb414ba30211202c245d127531b603e..9ee051f1aae903472cd3f146781f195ef5d8019e 100644 (file)
@@ -38,7 +38,7 @@
  *
  */
 
-#define BUILDTOOL_VERSION  "BuildTool v0.8.2, 2007-2008 Bob Jamison"
+#define BUILDTOOL_VERSION  "BuildTool v0.8.3"
 
 #include <stdio.h>
 #include <fcntl.h>
@@ -3919,7 +3919,7 @@ bool MakeBase::listFiles(MakeBase &propRef, FileSet &fileSet)
         {
         for (iter = includes.begin() ; iter != includes.end() ; iter++)
             {
-            String pattern = *iter;
+            String &pattern = *iter;
             std::vector<String>::iterator siter;
             for (siter = fileList.begin() ; siter != fileList.end() ; siter++)
                 {
@@ -3942,7 +3942,7 @@ bool MakeBase::listFiles(MakeBase &propRef, FileSet &fileSet)
         std::vector<String>::iterator siter;
         for (siter = excludes.begin() ; siter != excludes.end() ; siter++)
             {
-            String pattern = *siter;
+            String &pattern = *siter;
             if (regexMatch(s, pattern))
                 {
                 //trace("EXCLUDED:%s", s.c_str());
@@ -5671,8 +5671,8 @@ bool DepTool::scanFile(const String &fname, FileRec *frec)
     String buf;
     while (!feof(f))
         {
-        int len = fread(readBuf, 1, readBufSize, f);
-        readBuf[len] = '\0';
+        int nrbytes = fread(readBuf, 1, readBufSize, f);
+        readBuf[nrbytes] = '\0';
         buf.append(readBuf);
         }
     fclose(f);
@@ -5791,7 +5791,7 @@ bool DepTool::generateDependencies()
         FileRec *include = iter->second;
         if (include->type == FileRec::CFILE)
             {
-            String cFileName   = iter->first;
+            //String cFileName   = iter->first;
             FileRec *ofile     = new FileRec(FileRec::OFILE);
             ofile->path        = include->path;
             ofile->baseName    = include->baseName;
@@ -6171,6 +6171,7 @@ public:
         defines         = "";
         includes        = "";
         continueOnError = false;
+        refreshCache    = false;
         fileSet.clear();
         excludeInc.clear();
         }
@@ -6197,9 +6198,9 @@ public:
         FILE *f = NULL;
         f = fopen("compile.lst", "w");
 
-        bool refreshCache = false;
+        //refreshCache is probably false here, unless specified otherwise
         String fullName = parent.resolve("build.dep");
-        if (isNewerThan(parent.getURI().getPath(), fullName))
+        if (refreshCache || isNewerThan(parent.getURI().getPath(), fullName))
             {
             taskstatus("regenerating C/C++ dependency cache");
             refreshCache = true;
@@ -6426,6 +6427,10 @@ public:
             return false;
         if (s=="true" || s=="yes")
             continueOnError = true;
+        if (!parent.getAttribute(elem, "refreshCache", s))
+            return false;
+        if (s=="true" || s=="yes")
+            refreshCache = true;
 
         std::vector<Element *> children = elem->getChildren();
         for (unsigned int i=0 ; i<children.size() ; i++)
@@ -6477,6 +6482,7 @@ protected:
     String   defines;
     String   includes;
     bool     continueOnError;
+    bool     refreshCache;
     FileSet  fileSet;
     FileList excludeInc;