From db06133cbfa9239691f129bd0d7b7898d3d8fce4 Mon Sep 17 00:00:00 2001 From: ishmal Date: Fri, 24 Nov 2006 19:28:16 +0000 Subject: [PATCH] Add "strip" to so you can do it if linking is successful --- build.xml | 1 - buildtool.cpp | 81 ++++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 70 insertions(+), 12 deletions(-) diff --git a/build.xml b/build.xml index 66ac63b92..f28a8f24f 100644 --- a/build.xml +++ b/build.xml @@ -241,7 +241,6 @@ -lgc -mwindows -lws2_32 -lintl -lm - 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(" symbol file failed : %s", errbuf.c_str()); + return false; + } + } + + if (doStrip) + { + cmd = "strip "; + cmd.append(getNativePath(fullTarget)); + if (!executeCommand(cmd, "", outbuf, errbuf)) + { + error(" failed : %s", errbuf.c_str()); + return false; + } + } + return true; } @@ -6407,6 +6437,12 @@ public: 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 children = elem->getChildren(); for (unsigned int i=0 ; i0) + { + 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(" symbol file failed : %s", errbuf.c_str()); + return false; + } + } + + cmd = "strip "; + cmd.append(getNativePath(fullName)); if (!executeCommand(cmd, "", outbuf, errbuf)) + { + error(" failed : %s", errbuf.c_str()); return false; + } return true; } @@ -7058,9 +7114,11 @@ public: { if (!parent.getAttribute(elem, "file", fileName)) return false; + if (!parent.getAttribute(elem, "symfile", symFileName)) + return false; if (fileName.size() == 0) { - error(" requires 'file=\"fileNname\"' attribute"); + error(" requires 'file=\"fileName\"' attribute"); return false; } return true; @@ -7069,6 +7127,7 @@ public: private: String fileName; + String symFileName; }; -- 2.30.2