enabled config of entire ar command, not only arguments

This commit is contained in:
fros4943 2007-09-28 07:21:21 +00:00
parent a03ff4d7ac
commit 87e32f037e
6 changed files with 30 additions and 8 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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",

View file

@ -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")};

View file

@ -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, '/');