From 87e32f037e755075b96923773f8cc4c25e70dfa2 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Fri, 28 Sep 2007 07:21:21 +0000 Subject: [PATCH] enabled config of entire ar command, not only arguments --- platform/cooja/Makefile.cooja | 4 ++-- .../cooja/config/external_tools_linux.config | 3 +++ .../cooja/config/external_tools_win32.config | 3 +++ tools/cooja/java/se/sics/cooja/GUI.java | 3 ++- .../contikimote/ContikiMoteTypeDialog.java | 21 ++++++++++++++++--- .../cooja/dialogs/ExternalToolsDialog.java | 4 ++-- 6 files changed, 30 insertions(+), 8 deletions(-) diff --git a/platform/cooja/Makefile.cooja b/platform/cooja/Makefile.cooja index 84564c145..20a285783 100644 --- a/platform/cooja/Makefile.cooja +++ b/platform/cooja/Makefile.cooja @@ -1,4 +1,4 @@ -# $Id: Makefile.cooja,v 1.19 2007/09/05 14:04:17 fros4943 Exp $ +# $Id: Makefile.cooja,v 1.20 2007/09/28 07:21:56 fros4943 Exp $ ## The COOJA Simulator Contiki platform Makefile ## @@ -92,7 +92,7 @@ else endif $(ARFILE): ${addprefix $(OBJECTDIR)/, $(CONTIKI_SOURCEFILES:.c=.o)} - $(AR) rcf $@ $^ + $(AR_COMMAND_1) $^ $(AR_COMMAND_2) ifndef WINDIR .PHONY: symbols.c diff --git a/tools/cooja/config/external_tools_linux.config b/tools/cooja/config/external_tools_linux.config index d05f4a6cd..3f7e35c47 100644 --- a/tools/cooja/config/external_tools_linux.config +++ b/tools/cooja/config/external_tools_linux.config @@ -2,6 +2,7 @@ PATH_CONTIKI = ../../.. PATH_COOJA_CORE_RELATIVE = /platform/cooja PATH_MAKE = make PATH_LINKER = ld +PATH_AR = ar PATH_SHELL = sh PATH_C_COMPILER = gcc PATH_OBJDUMP=objdump @@ -15,6 +16,8 @@ REGEXP_PARSE_SENSORS = ([^/]*.c):SENSORS_SENSOR\\(([^,]*), COMPILER_ARGS = LINK_COMMAND_1 = gcc -shared -Wl,-Map=$(MAPFILE) -o $(LIBFILE) LINK_COMMAND_2 = +AR_COMMAND_1 = ar rcf $(ARFILE) +AR_COMMAND_2 = CONTIKI_STANDARD_PROCESSES = sensors_process;etimer_process CONTIKI_MAIN_TEMPLATE_FILENAME = contiki_template.c MANTIS_MAIN_TEMPLATE_FILENAME = mantis_template.c diff --git a/tools/cooja/config/external_tools_win32.config b/tools/cooja/config/external_tools_win32.config index cf866ed31..58d81f3be 100644 --- a/tools/cooja/config/external_tools_win32.config +++ b/tools/cooja/config/external_tools_win32.config @@ -2,6 +2,7 @@ PATH_CONTIKI = ../../.. PATH_COOJA_CORE_RELATIVE = /platform/cooja PATH_MAKE = make PATH_LINKER = ld +PATH_AR=ar PATH_SHELL = sh PATH_C_COMPILER = gcc PATH_OBJDUMP=objdump @@ -15,6 +16,8 @@ REGEXP_PARSE_SENSORS = ([^/]*.c):SENSORS_SENSOR\\(([^,]*), COMPILER_ARGS = -mno-cygwin -Wall -I'$(JAVA_HOME)/include' -I'$(JAVA_HOME)/include/win32' LINK_COMMAND_1 = gcc -mno-cygwin -shared -Wl,-Map=$(MAPFILE) -Wl,--add-stdcall-alias -o $(LIBFILE) LINK_COMMAND_2 = -L/usr/lib/mingw -lmsvcrt +AR_COMMAND_1 = ar rcf $(ARFILE) +AR_COMMAND_2 = CONTIKI_STANDARD_PROCESSES = sensors_process;etimer_process CONTIKI_MAIN_TEMPLATE_FILENAME = contiki_template.c MANTIS_MAIN_TEMPLATE_FILENAME = mantis_template.c diff --git a/tools/cooja/java/se/sics/cooja/GUI.java b/tools/cooja/java/se/sics/cooja/GUI.java index 60b63e0f0..b2df58266 100644 --- a/tools/cooja/java/se/sics/cooja/GUI.java +++ b/tools/cooja/java/se/sics/cooja/GUI.java @@ -24,7 +24,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: GUI.java,v 1.62 2007/09/21 16:14:19 fros4943 Exp $ + * $Id: GUI.java,v 1.63 2007/09/28 07:21:21 fros4943 Exp $ */ package se.sics.cooja; @@ -148,6 +148,7 @@ public class GUI { "PATH_SHELL", "PATH_C_COMPILER", "COMPILER_ARGS", "PATH_LINKER", "LINK_COMMAND_1", "LINK_COMMAND_2", + "PATH_AR", "AR_COMMAND_1", "AR_COMMAND_2", "PATH_OBJDUMP", "OBJDUMP_ARGS", "PATH_JAVAC", diff --git a/tools/cooja/java/se/sics/cooja/contikimote/ContikiMoteTypeDialog.java b/tools/cooja/java/se/sics/cooja/contikimote/ContikiMoteTypeDialog.java index cf989951a..0b5c6c4d4 100644 --- a/tools/cooja/java/se/sics/cooja/contikimote/ContikiMoteTypeDialog.java +++ b/tools/cooja/java/se/sics/cooja/contikimote/ContikiMoteTypeDialog.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ContikiMoteTypeDialog.java,v 1.35 2007/09/21 16:14:19 fros4943 Exp $ + * $Id: ContikiMoteTypeDialog.java,v 1.36 2007/09/28 07:21:22 fros4943 Exp $ */ package se.sics.cooja.contikimote; @@ -1172,7 +1172,9 @@ public class ContikiMoteTypeDialog extends JDialog { libraryCreatedOK = false; } else { libraryCreatedOK = true; - if (!libFile.exists() || !depFile.exists() || !mapFile.exists()) { + if (!libFile.exists() || !depFile.exists()) { + /* TODO Check if map file is really needed */ + logger.fatal("Not all needed files could be located"); libraryCreatedOK = false; } } @@ -1449,18 +1451,26 @@ public class ContikiMoteTypeDialog extends JDialog { String ccFlags = GUI.getExternalToolsSetting("COMPILER_ARGS", ""); String link1 = GUI.getExternalToolsSetting("LINK_COMMAND_1", ""); String link2 = GUI.getExternalToolsSetting("LINK_COMMAND_2", ""); + String ar1 = GUI.getExternalToolsSetting("AR_COMMAND_1", ""); + String ar2 = GUI.getExternalToolsSetting("AR_COMMAND_2", ""); link1 = link1.replace("$(MAPFILE)", mapFile.getPath().replace(File.separatorChar, '/')); link2 = link2.replace("$(MAPFILE)", mapFile.getPath().replace(File.separatorChar, '/')); + ar1 = ar1.replace("$(MAPFILE)", mapFile.getPath().replace(File.separatorChar, '/')); + ar2 = ar2.replace("$(MAPFILE)", mapFile.getPath().replace(File.separatorChar, '/')); ccFlags = ccFlags.replace("$(MAPFILE)", mapFile.getPath().replace(File.separatorChar, '/')); link1 = link1.replace("$(LIBFILE)", libFile.getPath().replace(File.separatorChar, '/')); link2 = link2.replace("$(LIBFILE)", libFile.getPath().replace(File.separatorChar, '/')); + ar1 = ar1.replace("$(LIBFILE)", libFile.getPath().replace(File.separatorChar, '/')); + ar2 = ar2.replace("$(LIBFILE)", libFile.getPath().replace(File.separatorChar, '/')); ccFlags = ccFlags.replace("$(LIBFILE)", libFile.getPath().replace(File.separatorChar, '/')); link1 = link1.replace("$(ARFILE)", arFile.getPath().replace(File.separatorChar, '/')); link2 = link2.replace("$(ARFILE)", arFile.getPath().replace(File.separatorChar, '/')); - ccFlags = ccFlags.replace("$(DEPFILE)", arFile.getPath().replace(File.separatorChar, '/')); + ar1 = ar1.replace("$(ARFILE)", arFile.getPath().replace(File.separatorChar, '/')); + ar2 = ar2.replace("$(ARFILE)", arFile.getPath().replace(File.separatorChar, '/')); + ccFlags = ccFlags.replace("$(ARFILE)", arFile.getPath().replace(File.separatorChar, '/')); String javaHome = System.getenv().get("JAVA_HOME"); if (javaHome == null) { @@ -1468,6 +1478,8 @@ public class ContikiMoteTypeDialog extends JDialog { } link1 = link1.replace("$(JAVA_HOME)", javaHome); link2 = link2.replace("$(JAVA_HOME)", javaHome); + ar1 = ar1.replace("$(JAVA_HOME)", javaHome); + ar2 = ar2.replace("$(JAVA_HOME)", javaHome); ccFlags = ccFlags.replace("$(JAVA_HOME)", javaHome); for (File sourceFile : sourceFiles) { @@ -1503,10 +1515,13 @@ public class ContikiMoteTypeDialog extends JDialog { "TARGET=cooja", "TYPEID=" + identifier, "LINK_COMMAND_1=" + link1, "LINK_COMMAND_2=" + link2, + "AR_COMMAND_1=" + ar1, + "AR_COMMAND_2=" + ar2, "EXTRA_CC_ARGS=" + ccFlags, "SYMBOLS=" + (includeSymbols?"1":""), "CC=" + GUI.getExternalToolsSetting("PATH_C_COMPILER"), "LD=" + GUI.getExternalToolsSetting("PATH_LINKER"), + "AR=" + GUI.getExternalToolsSetting("PATH_AR"), "PROJECTDIRS=" + sourceDirs, "PROJECT_SOURCEFILES=" + sourceFileNames, "PATH=" + System.getenv("PATH")}; diff --git a/tools/cooja/java/se/sics/cooja/dialogs/ExternalToolsDialog.java b/tools/cooja/java/se/sics/cooja/dialogs/ExternalToolsDialog.java index c81427df9..9a076210d 100644 --- a/tools/cooja/java/se/sics/cooja/dialogs/ExternalToolsDialog.java +++ b/tools/cooja/java/se/sics/cooja/dialogs/ExternalToolsDialog.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ExternalToolsDialog.java,v 1.6 2007/09/18 16:07:10 fros4943 Exp $ + * $Id: ExternalToolsDialog.java,v 1.7 2007/09/28 07:21:21 fros4943 Exp $ */ package se.sics.cooja.dialogs; @@ -111,7 +111,7 @@ public class ExternalToolsDialog extends JDialog { // Some explanations Box explanations = Box.createVerticalBox(); - explanations.add(new JLabel("Special variables used in COMPILER_ARGS, LINK_COMMAND_1 and LINK_COMMAND_2:")); + explanations.add(new JLabel("Special variables used in COMPILER_ARGS, LINK_COMMAND_[12] and AR_COMMAND_[12]:")); String javaHome = System.getenv().get("JAVA_HOME"); if (javaHome != null) { javaHome = javaHome.replace(File.separatorChar, '/');