From cac9aa6475006090bd6d3a75e4964d1af6805266 Mon Sep 17 00:00:00 2001 From: ishmal Date: Fri, 17 Nov 2006 20:22:51 +0000 Subject: [PATCH] add --- build.xml | 599 +++++++++++++++++++++++++++----------------------- buildtool.cpp | 195 +++++++++++++--- 2 files changed, 489 insertions(+), 305 deletions(-) diff --git a/build.xml b/build.xml index f8d8002a0..79b3bf42c 100644 --- a/build.xml +++ b/build.xml @@ -1,271 +1,328 @@ - - - Build file for Sands office data tool - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Wall -g -O3 - -mms-bitfields - - - -DVERSION=\"${version}\" - -DHAVE_CONFIG_H - -DXP_WIN - -D_INTL_REDIRECT_INLINE - -DWITH_INKBOARD -DHAVE_SSL - - - -I${gtk}/include - - -I${gtk}/include/glibmm-2.4 - -I${gtk}/lib/glibmm-2.4/include - -I${gtk}/include/gtkmm-2.4 - -I${gtk}/lib/gtkmm-2.4/include - -I${gtk}/include/gdkmm-2.4 - -I${gtk}/lib/gdkmm-2.4/include - -I${gtk}/include/pangomm-1.4 - -I${gtk}/include/atkmm-1.6 - -I${gtk}/include/cairomm-1.0 - -I${gtk}/include/sigc++-2.0 - -I${gtk}/lib/sigc++-2.0/include - -I${gtk}/include/gtk-2.0 - -I${gtk}/lib/gtk-2.0/include - -I${gtk}/include/atk-1.0 - -I${gtk}/include/pango-1.0 - -I${gtk}/include/glib-2.0 - -I${gtk}/lib/glib-2.0/include - - -I${gtk}/include/libxml2 - -I${gtk}/include/freetype2 - -I${gtk}/include/cairo - - -Wno-comment -I${gtk}/perl/lib/CORE - - -I${gtk}/python/include - - - - - - - - - - - - - - - - - - - - - - - - --include-dir=${src} - - - - - - - - - - - - - -L${gtk}/lib - -lgtkmm-2.4 -lgdkmm-2.4 -lglibmm-2.4 - -latkmm-1.6 -lpangomm-1.4 -lsigc-2.0 - -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 - -lgdk_pixbuf-2.0 - -lpangocairo-1.0 -lpangoft2-1.0 -lpangowin32-1.0 -lpango-1.0 - -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lcairo - - -L${gtk}/perl/lib/CORE -lperl58 - - -L${gtk}/python/libs -lpython24 - ${gtk}/bin/libxml2.dll - ${gtk}/lib/iconv.lib - -lfreetype.dll -lfontconfig.dll - -llcms.dll - -lssl -lcrypto - -lpng -lpopt ${gtk}/lib/zdll.lib - -lgc -mwindows -lws2_32 -lintl -lm - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + Build file for Sands office data tool + + + + + + + + + + + + + + + #ifndef _CONFIG_H_ + #define _CONFIG_H_ + + #ifndef WIN32 + #define WIN32 + #endif + + /*###################################### + ## This is for require-config.h, whose + ## purpose I cannot fathom. + ######################################*/ + + #define PACKAGE_TARNAME + + /*###################################### + #### RESOURCE DIRECTORIES + ######################################*/ + + #define INKSCAPE_DATADIR "." + #define PACKAGE_LOCALE_DIR "locale" + + + /*###################################### + #### OTHER DEFINITIONS + ######################################*/ + + #define GETTEXT_PACKAGE "inkscape" + + #define PACKAGE_STRING VERSION + + #define HAVE_GETOPT_H 1 + #define HAVE_STRING_H 1 + #define HAVE_LIBINTL_H 1 + #define HAVE_MALLOC_H 1 + #define HAVE_STDLIB_H 1 + #define HAVE_SYS_STAT_H 1 + + #define ENABLE_LCMS 1 + + #define ENABLE_NLS 1 + #define HAVE_BIND_TEXTDOMAIN_CODESET 1 + + /* keep binreloc off */ + #define BR_PTHREADS 0 + #undef ENABLE_BINRELOC + + /* CairoPDF options */ + #define HAVE_CAIRO_PDF 1 + #define PANGO_ENABLE_ENGINE 1 + #define RENDER_WITH_PANGO_CAIRO 1 + + #define HAVE_GTK_WINDOW_FULLSCREEN 1 + + #define g_ascii_strtod fixed_g_ascii_strtod + + #endif /* _CONFIG_H_ */ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -Wall -O3 + -mms-bitfields + + + -DVERSION=\"${version}\" + -DHAVE_CONFIG_H + -DXP_WIN + -D_INTL_REDIRECT_INLINE + -DWITH_INKBOARD -DHAVE_SSL + + + -I${gtk}/include + + -I${gtk}/include/glibmm-2.4 + -I${gtk}/lib/glibmm-2.4/include + -I${gtk}/include/gtkmm-2.4 + -I${gtk}/lib/gtkmm-2.4/include + -I${gtk}/include/gdkmm-2.4 + -I${gtk}/lib/gdkmm-2.4/include + -I${gtk}/include/pangomm-1.4 + -I${gtk}/include/atkmm-1.6 + -I${gtk}/include/cairomm-1.0 + -I${gtk}/include/sigc++-2.0 + -I${gtk}/lib/sigc++-2.0/include + -I${gtk}/include/gtk-2.0 + -I${gtk}/lib/gtk-2.0/include + -I${gtk}/include/atk-1.0 + -I${gtk}/include/pango-1.0 + -I${gtk}/include/glib-2.0 + -I${gtk}/lib/glib-2.0/include + + -I${gtk}/include/libxml2 + -I${gtk}/include/freetype2 + -I${gtk}/include/cairo + + -Wno-comment -I${gtk}/perl/lib/CORE + + -I${gtk}/python/include + + + + + + + + + + + + + + + + + + + + + + + + --include-dir=${src} + + + + + + + + + + + + + -L${gtk}/lib + -lgtkmm-2.4 -lgdkmm-2.4 -lglibmm-2.4 + -latkmm-1.6 -lpangomm-1.4 -lsigc-2.0 + -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 + -lgdk_pixbuf-2.0 + -lpangocairo-1.0 -lpangoft2-1.0 -lpangowin32-1.0 -lpango-1.0 + -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lcairo + + -L${gtk}/perl/lib/CORE -lperl58 + + -L${gtk}/python/libs -lpython24 + ${gtk}/bin/libxml2.dll + ${gtk}/lib/iconv.lib + -lfreetype.dll -lfontconfig.dll + -llcms.dll + -lssl -lcrypto + -lpng -lpopt ${gtk}/lib/zdll.lib + -lgc -mwindows -lws2_32 -lintl -lm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/buildtool.cpp b/buildtool.cpp index d738e03a2..e3efeff5e 100644 --- a/buildtool.cpp +++ b/buildtool.cpp @@ -21,18 +21,18 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -/* - - - - - - - - +/** + * To use this file, compile with: + *
+ * g++ -O3 buildtool.cpp -o build.exe
+ * (or whatever your compiler might be) 
+ * Then
+ * build
+ * or 
+ * build {target}
+ */  
 
 
-*/
 
 #include 
 #include 
@@ -1990,6 +1990,16 @@ protected:
     std::vector tokenize(const String &val,
 	                      const String &delimiters);
 
+    /**
+     *  replace runs of whitespace with a space
+     */
+    String strip(const String &s);
+
+    /**
+     *  remove leading whitespace from each line
+     */
+    String leftJustify(const String &s);
+
     /**
      *  remove leading and trailing whitespace from string
      */
@@ -2233,6 +2243,78 @@ std::vector MakeBase::tokenize(const String &str,
 
 
 
+/**
+ *  replace runs of whitespace with a single space
+ */
+String MakeBase::strip(const String &s)
+{
+    int len = s.size();
+    String stripped;
+    for (int i = 0 ; igetValue();
-    int len = s.size();
     //Replace all runs of whitespace with a single space
-    String stripped; 
-    for (int i = 0 ; i");
+            return true;
+            }
+        //trace("fullName:%s", fullName.c_str());
+        FILE *f = fopen(fullName.c_str(), "w");
+        if (!f)
+            {
+            error(" could not open %s for writing : %s",
+                fullName.c_str(), strerror(errno));
+            return false;
+            }
+        for (unsigned int i=0 ; i requires 'file=\"filename\"' attribute");
+            return false;
+            }
+        if (!parent.getValue(elem, text))
+            return false;
+        text = leftJustify(text);
+        //trace("dirname:%s", dirName.c_str());
+        return true;
+        }
+
+private:
+
+    String fileName;
+    String text;
+};
+
+
+
 /**
  * Create a named directory
  */
@@ -5800,6 +5925,8 @@ Task *Task::createTask(Element *elem)
         task = new TaskJavac(parent);
     else if (tagName == "link")
         task = new TaskLink(parent);
+    else if (tagName == "makefile")
+        task = new TaskMakeFile(parent);
     else if (tagName == "mkdir")
         task = new TaskMkDir(parent);
     else if (tagName == "msgfmt")
-- 
2.30.2