summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ff26f7d)
raw | patch | inline | side by side (parent: ff26f7d)
author | ishmal <ishmal@users.sourceforge.net> | |
Fri, 24 Nov 2006 19:28:16 +0000 (19:28 +0000) | ||
committer | ishmal <ishmal@users.sourceforge.net> | |
Fri, 24 Nov 2006 19:28:16 +0000 (19:28 +0000) |
build.xml | patch | blob | history | |
buildtool.cpp | patch | blob | history |
diff --git a/build.xml b/build.xml
index 66ac63b92318b750a68fdf81cdd283b024ce0a5a..f28a8f24f692920852c20c5cabe8815facbe9664 100644 (file)
--- a/build.xml
+++ b/build.xml
-lgc -mwindows -lws2_32 -lintl -lm
</libs>
</link>
- <!--<strip file="${build}/inkscape.exe"/>-->
</target>
<target name="dist" depends="link,i18n"
diff --git a/buildtool.cpp b/buildtool.cpp
index 8d05b6bcdb26b30d980fbc2d67b17dace23f750d..bfeea1b7ae25301523b67adb995ccf2ecbd1c644 100644 (file)
--- a/buildtool.cpp
+++ b/buildtool.cpp
status("============ cmd ============\n%s\n=============================",
command.c_str());
+ outbuf.clear();
+ errbuf.clear();
+
#ifdef __WIN32__
/*
{
type = TASK_LINK; name = "link";
command = "g++";
+ doStrip = false;
}
virtual ~TaskLink()
//trace("LINK cmd:%s", cmd.c_str());
- String outString, errString;
- if (!executeCommand(cmd.c_str(), "", outString, errString))
+ String outbuf, errbuf;
+ if (!executeCommand(cmd.c_str(), "", outbuf, errbuf))
{
- error("LINK problem: %s", errString.c_str());
+ error("LINK problem: %s", errbuf.c_str());
return false;
}
+
+ if (symFileName.size()>0)
+ {
+ String symFullName = parent.resolve(symFileName);
+ cmd = "objcopy --only-keep-debug ";
+ cmd.append(getNativePath(fullTarget));
+ cmd.append(" ");
+ cmd.append(getNativePath(symFullName));
+ if (!executeCommand(cmd, "", outbuf, errbuf))
+ {
+ error("<strip> symbol file failed : %s", errbuf.c_str());
+ return false;
+ }
+ }
+
+ if (doStrip)
+ {
+ cmd = "strip ";
+ cmd.append(getNativePath(fullTarget));
+ if (!executeCommand(cmd, "", outbuf, errbuf))
+ {
+ error("<strip> failed : %s", errbuf.c_str());
+ return false;
+ }
+ }
+
return true;
}
command = s;
if (!parent.getAttribute(elem, "out", fileName))
return false;
+ if (!parent.getAttribute(elem, "strip", s))
+ return false;
+ if (!getBool(s, doStrip))
+ return false;
+ if (!parent.getAttribute(elem, "symfile", symFileName))
+ return false;
std::vector<Element *> children = elem->getChildren();
for (unsigned int i=0 ; i<children.size() ; i++)
private:
- String command;
- String fileName;
- String flags;
- String libs;
+ String command;
+ String fileName;
+ String flags;
+ String libs;
FileSet fileSet;
+ bool doStrip;
+ String symFileName;
};
{
String fullName = parent.resolve(fileName);
//trace("fullDir:%s", fullDir.c_str());
- String cmd = "strip ";
- cmd.append(fullName);
-
+ String cmd;
String outbuf, errbuf;
+
+ if (symFileName.size()>0)
+ {
+ String symFullName = parent.resolve(symFileName);
+ cmd = "objcopy --only-keep-debug ";
+ cmd.append(getNativePath(fullName));
+ cmd.append(" ");
+ cmd.append(getNativePath(symFullName));
+ if (!executeCommand(cmd, "", outbuf, errbuf))
+ {
+ error("<strip> symbol file failed : %s", errbuf.c_str());
+ return false;
+ }
+ }
+
+ cmd = "strip ";
+ cmd.append(getNativePath(fullName));
if (!executeCommand(cmd, "", outbuf, errbuf))
+ {
+ error("<strip> failed : %s", errbuf.c_str());
return false;
+ }
return true;
}
{
if (!parent.getAttribute(elem, "file", fileName))
return false;
+ if (!parent.getAttribute(elem, "symfile", symFileName))
+ return false;
if (fileName.size() == 0)
{
- error("<strip> requires 'file=\"fileNname\"' attribute");
+ error("<strip> requires 'file=\"fileName\"' attribute");
return false;
}
return true;
private:
String fileName;
+ String symFileName;
};