summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 84932b6)
raw | patch | inline | side by side (parent: 84932b6)
author | ishmal <ishmal@users.sourceforge.net> | |
Tue, 28 Nov 2006 20:49:37 +0000 (20:49 +0000) | ||
committer | ishmal <ishmal@users.sourceforge.net> | |
Tue, 28 Nov 2006 20:49:37 +0000 (20:49 +0000) |
build.xml | patch | blob | history | |
buildtool.cpp | patch | blob | history |
diff --git a/build.xml b/build.xml
index 5d2ac8ba0aeea15d1d18f2a0caf4dcebd961df4d..11fe01e2239e16d532c7f2c626d4ea2640a88d54 100644 (file)
--- a/build.xml
+++ b/build.xml
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
<mkdir dir="${dist}"/>
+ <copy file="${src}/helper/sp-marshal.h.mingw"
+ tofile="${src}/helper/sp-marshal.h"/>
+ <copy file="${src}/helper/sp-marshal.cpp.mingw"
+ tofile="${src}/helper/sp-marshal.cpp"/>
+ <makefile file="inkscape_version.h">
+ #define INKSCAPE_VERSION "${version}+devel"
+ </makefile>
<makefile file="config.h">
#ifndef _CONFIG_H_
#define _CONFIG_H_
<target name="compile" depends="init"
description="compile the source " >
<!-- Compile from source to build -->
- <cc cc="gcc" cxx="g++" destdir="${build}/obj">
+ <cc cc="i686-pc-mingw32-gcc" cxx="i686-pc-mingw32-g++"
+ destdir="${build}/obj">
<fileset dir="${src}">
<!-- THINGS TO EXCLUDE -->
<exclude name="ast/.*"/>
<exclude name="removeoverlap/remove_rectangle_overlap-test.h"/>
</fileset>
<flags>
- -Wall -g -O3
- -mms-bitfields
+ -Wall -O3
+ -mms-bitfields
</flags>
<defines>
-DVERSION=\"${version}\"
</target>
<target name="lib" depends="compile">
- <staticlib file="${build}/libinkscape.a">
+ <staticlib command="i686-pc-mingw32-ar crsv"
+ file="${build}/libinkscape.a">
<fileset dir="${build}/obj">
<exclude name="main,o"/>
<exclude name="winmain,o"/>
</target>
<target name="link" depends="lib">
- <rc command="windres -o"
+ <rc command="i686-pc-mingw32-windres"
file="${src}/inkscape.rc"
out="${build}/inkres.o">
<flags>
--include-dir=${src}
</flags>
</rc>
- <link command="g++" out="${build}/inkscape.exe"
+ <link command="i686-pc-mingw32-g++" out="${build}/inkscape.exe"
strip="true" symfile="${build}/inkscape.dbg"
+ stripcommand="i686-pc-mingw32-strip"
+ objcopycommand="i686-pc-mingw32-objcopy"
>
<flags>
</flags>
<copy todir="${dist}/lib"> <fileset dir="${gtk}/lib/gtk-2.0"/> </copy>
<copy todir="${dist}/lib"> <fileset dir="${gtk}/lib/glib-2.0"/> </copy>
<copy todir="${dist}/lib"> <fileset dir="${gtk}/lib/locale"/> </copy>
- <copy todir="${dist}/lib"> <fileset dir="${gtk}/lib/pango"/> </copy>
<copy todir="${dist}">
<fileset dir="share">
<exclude name=".*\.am"/>
diff --git a/buildtool.cpp b/buildtool.cpp
index bfeea1b7ae25301523b67adb995ccf2ecbd1c644..ef80f872aaed951b61d18fd8621350a4832eafdf 100644 (file)
--- a/buildtool.cpp
+++ b/buildtool.cpp
/**
* To use this file, compile with:
* <pre>
- * g++ -O3 buildtool.cpp -o build.exe
+ * g++ -O3 buildtool.cpp -o btool.exe
* (or whatever your compiler might be)
* Then
- * build
+ * btool
* or
- * build {target}
+ * btool {target}
*/
#endif
+#include <errno.h>
+
+
+
namespace buildtool
{
}
errnum = pclose(f);
}
- outbuf = s;
- if (errnum < 0)
- {
- error("exec of command '%s' failed : %s",
+ outbuf = s;
+ if (errnum != 0)
+ {
+ error("exec of command '%s' failed : %s",
command.c_str(), strerror(errno));
- return false;
- }
- else
- return true;
+ return false;
+ }
+ else
+ return true;
#endif
}
std::vector<String> subdirs;
DIR *dir = opendir(dirNative.c_str());
+ if (!dir)
+ {
+ error("Could not open directory %s : %s",
+ dirNative.c_str(), strerror(errno));
+ return false;
+ }
while (true)
{
struct dirent *de = readdir(dir);
}
//## 3: now make
+#ifdef __WIN32__
if (mkdir(cnative)<0)
+#else
+ if (mkdir(cnative, S_IRWXU | S_IRWXG | S_IRWXO)<0)
+#endif
{
- error("cannot make directory '%s'", cnative);
+ error("cannot make directory '%s' : %s",
+ cnative, strerror(errno));
return false;
}
type = TASK_LINK; name = "link";
command = "g++";
doStrip = false;
+ stripCommand = "strip";
+ objcopyCommand = "objcopy";
}
virtual ~TaskLink()
if (symFileName.size()>0)
{
String symFullName = parent.resolve(symFileName);
- cmd = "objcopy --only-keep-debug ";
+ cmd = objcopyCommand;
+ cmd.append(" --only-keep-debug ");
cmd.append(getNativePath(fullTarget));
cmd.append(" ");
cmd.append(getNativePath(symFullName));
if (doStrip)
{
- cmd = "strip ";
+ cmd = stripCommand;
+ cmd.append(" ");
cmd.append(getNativePath(fullTarget));
if (!executeCommand(cmd, "", outbuf, errbuf))
{
return false;
if (s.size()>0)
command = s;
+ if (!parent.getAttribute(elem, "objcopycommand", s))
+ return false;
+ if (s.size()>0)
+ objcopyCommand = s;
+ if (!parent.getAttribute(elem, "stripcommand", s))
+ return false;
+ if (s.size()>0)
+ stripCommand = s;
if (!parent.getAttribute(elem, "out", fileName))
return false;
if (!parent.getAttribute(elem, "strip", s))
FileSet fileSet;
bool doStrip;
String symFileName;
+ String stripCommand;
+ String objcopyCommand;
};
virtual bool parse(Element *elem)
{
+ String s;
+ if (!parent.getAttribute(elem, "command", s))
+ return false;
+ if (s.size()>0)
+ command = s;
if (!parent.getAttribute(elem, "todir", toDirName))
return false;
- String s;
if (!parent.getAttribute(elem, "owndir", s))
return false;
if (!getBool(s, owndir))
public:
TaskRanlib(MakeBase &par) : Task(par)
- { type = TASK_RANLIB; name = "ranlib"; }
+ {
+ type = TASK_RANLIB; name = "ranlib";
+ command = "ranlib";
+ }
virtual ~TaskRanlib()
{}
{
String fullName = parent.resolve(fileName);
//trace("fullDir:%s", fullDir.c_str());
- String cmd = "ranlib ";
+ String cmd = command;
+ cmd.append(" ");
cmd.append(fullName);
String outbuf, errbuf;
if (!executeCommand(cmd, "", outbuf, errbuf))
virtual bool parse(Element *elem)
{
+ String s;
+ if (!parent.getAttribute(elem, "command", s))
+ return false;
+ if (s.size()>0)
+ command = s;
if (!parent.getAttribute(elem, "file", fileName))
return false;
if (fileName.size() == 0)
private:
String fileName;
+ String command;
};
TaskRC(MakeBase &par) : Task(par)
{
type = TASK_RC; name = "rc";
- command = "windres -o";
+ command = "windres";
}
virtual ~TaskRC()
if (!isNewerThan(fullFile, fullOut))
return true;
String cmd = command;
- cmd.append(" ");
+ cmd.append(" -o ");
cmd.append(fullOut);
cmd.append(" ");
cmd.append(flags);
virtual bool parse(Element *elem)
{
+ String s;
+ if (!parent.getAttribute(elem, "command", s))
+ return false;
+ if (s.size()>0)
+ command = s;
if (!parent.getAttribute(elem, "file", fileName))
return false;
*
*/
virtual String version()
- { return "BuildTool v0.3, 2006 Bob Jamison"; }
+ { return "BuildTool v0.6, 2006 Bob Jamison"; }
/**
* Overload a <property>
*/
bool Make::run(const String &target)
{
- status("##################################");
- status("# BuildTool");
- status("# version 0.5");
- status("# 21 Nov 06");
- status("##################################");
+ status("####################################################");
+ status("# %s", version().c_str());
+ status("####################################################");
specifiedTarget = target;
if (!run())
return false;
- status("##################################");
- status("# BuildTool Completed");
- status("##################################");
+ status("####################################################");
+ status("# BuildTool Completed ");
+ status("####################################################");
return true;
}