- include contiki system symbols option (no need for the missing elf-loader files)

(including symbols not working without a few additional files)
This commit is contained in:
fros4943 2006-11-06 18:03:34 +00:00
parent 0f3764539a
commit cc53f38fbb
2 changed files with 46 additions and 6 deletions

View file

@ -1,4 +1,4 @@
# $Id: Makefile.cooja,v 1.8 2006/10/23 16:07:29 fros4943 Exp $ # $Id: Makefile.cooja,v 1.9 2006/11/06 18:07:51 fros4943 Exp $
## The COOJA Simulator Contiki platform Makefile ## The COOJA Simulator Contiki platform Makefile
## ##
@ -64,12 +64,16 @@ vpath %.c $(PROJECTDIRS) \
### Define custom targets ### Define custom targets
$(LIBFILE): $(MAINFILE) $(PROJECT_OBJECTFILES) $(DEPFILE) $(LIBFILE): $(MAINFILE) $(PROJECT_OBJECTFILES) $(DEPFILE)
ifdef SYMBOLS
${CONTIKI}/tools/make-symbols-nm $(LIBFILE) ${CONTIKI}/tools/make-symbols-nm $(LIBFILE)
$(CC) $(CFLAGS) -c symbols.c -o $(OBJECTDIR)/symbols.o $(CC) $(CFLAGS) -c symbols.c -o $(OBJECTDIR)/symbols.o
$(LD) -Map=$(MAPFILE) -shared $(LD_ARGS_1) -o $@ $^ $(LD_ARGS_2) $(LD) -Map=$(MAPFILE) -shared $(LD_ARGS_1) -o $@ $^ $(OBJECTDIR)/symbols.o $(LD_ARGS_2)
${CONTIKI}/tools/make-symbols-nm $(LIBFILE) ${CONTIKI}/tools/make-symbols-nm $(LIBFILE)
$(CC) $(CFLAGS) -c symbols.c -o $(OBJECTDIR)/symbols.o $(CC) $(CFLAGS) -c symbols.c -o $(OBJECTDIR)/symbols.o
$(LD) -Map=$(MAPFILE) -shared $(LD_ARGS_1) -o $@ $^ $(OBJECTDIR)/symbols.o $(LD_ARGS_2)
else
$(LD) -Map=$(MAPFILE) -shared $(LD_ARGS_1) -o $@ $^ $(LD_ARGS_2) $(LD) -Map=$(MAPFILE) -shared $(LD_ARGS_1) -o $@ $^ $(LD_ARGS_2)
endif
$(DEPFILE): ${addprefix $(OBJECTDIR)/, $(CONTIKI_SOURCEFILES:.c=.o)} $(DEPFILE): ${addprefix $(OBJECTDIR)/, $(CONTIKI_SOURCEFILES:.c=.o)}
$(AR) rcf $@ $^ $(AR) rcf $@ $^

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: ContikiMoteTypeDialog.java,v 1.12 2006/10/21 10:40:33 fros4943 Exp $ * $Id: ContikiMoteTypeDialog.java,v 1.13 2006/11/06 18:03:34 fros4943 Exp $
*/ */
package se.sics.cooja.contikimote; package se.sics.cooja.contikimote;
@ -81,6 +81,7 @@ public class ContikiMoteTypeDialog extends JDialog {
private JTextField textID, textOutputFiles, textDescription, textContikiDir, private JTextField textID, textOutputFiles, textDescription, textContikiDir,
textCoreDir, textUserPlatforms; textCoreDir, textUserPlatforms;
private JButton createButton, testButton, rescanButton; private JButton createButton, testButton, rescanButton;
private JCheckBox symbolsCheckBox;
private JPanel processPanel; // Holds process checkboxes private JPanel processPanel; // Holds process checkboxes
private JPanel sensorPanel; // Holds sensor checkboxes private JPanel sensorPanel; // Holds sensor checkboxes
@ -198,6 +199,11 @@ public class ContikiMoteTypeDialog extends JDialog {
myDialog.textUserPlatforms.setText(userPlatformText); myDialog.textUserPlatforms.setText(userPlatformText);
} }
// Set preset "use symbols"
if (moteTypeToConfigure.hasSystemSymbols()) {
myDialog.symbolsCheckBox.setSelected(true);
}
// Scan directories for processes, sensors and core interfaces // Scan directories for processes, sensors and core interfaces
// TODO Really do this without starting a separate thread? // TODO Really do this without starting a separate thread?
myDialog.updateVisualFields(); myDialog.updateVisualFields();
@ -563,6 +569,30 @@ public class ContikiMoteTypeDialog extends JDialog {
mainPane.add(Box.createRigidArea(new Dimension(0, 5))); mainPane.add(Box.createRigidArea(new Dimension(0, 5)));
// Include symbols selection
smallPane = new JPanel();
smallPane.setAlignmentX(Component.LEFT_ALIGNMENT);
smallPane.setLayout(new BoxLayout(smallPane, BoxLayout.X_AXIS));
label = new JLabel("System symbols");
label.setPreferredSize(new Dimension(LABEL_WIDTH, LABEL_HEIGHT));
symbolsCheckBox = new JCheckBox("Include");
symbolsCheckBox.setSelected(false);
symbolsCheckBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
pathsWereUpdated();
}
});
smallPane.add(label);
smallPane.add(Box.createHorizontalStrut(10));
smallPane.add(Box.createHorizontalGlue());
smallPane.add(symbolsCheckBox);
mainPane.add(smallPane);
mainPane.add(Box.createRigidArea(new Dimension(0, 5)));
// Separator // Separator
mainPane.add(new JSeparator()); mainPane.add(new JSeparator());
mainPane.add(Box.createRigidArea(new Dimension(0, 5))); mainPane.add(Box.createRigidArea(new Dimension(0, 5)));
@ -993,7 +1023,7 @@ public class ContikiMoteTypeDialog extends JDialog {
} }
compilationSucceded = ContikiMoteTypeDialog.compileLibrary(identifier, compilationSucceded = ContikiMoteTypeDialog.compileLibrary(identifier,
contikiDir, filesToCompile, contikiDir, filesToCompile, symbolsCheckBox.isSelected(),
taskOutput.getInputStream(MessageList.NORMAL), taskOutput.getInputStream(MessageList.NORMAL),
taskOutput.getInputStream(MessageList.ERROR)); taskOutput.getInputStream(MessageList.ERROR));
} }
@ -1204,6 +1234,8 @@ public class ContikiMoteTypeDialog extends JDialog {
* Contiki base directory * Contiki base directory
* @param sourceFiles * @param sourceFiles
* Source files and directories to include in compilation * Source files and directories to include in compilation
* @param includeSymbols
* Generate and include symbols in library file
* @param outputStream * @param outputStream
* Output stream from compilation (optional) * Output stream from compilation (optional)
* @param errorStream * @param errorStream
@ -1211,7 +1243,7 @@ public class ContikiMoteTypeDialog extends JDialog {
* @return True if compilation succeded, false otherwise * @return True if compilation succeded, false otherwise
*/ */
public static boolean compileLibrary(String identifier, File contikiDir, public static boolean compileLibrary(String identifier, File contikiDir,
Vector<File> sourceFiles, final PrintStream outputStream, Vector<File> sourceFiles, boolean includeSymbols, final PrintStream outputStream,
final PrintStream errorStream) { final PrintStream errorStream) {
File libFile = new File(ContikiMoteType.tempOutputDirectory, File libFile = new File(ContikiMoteType.tempOutputDirectory,
@ -1307,6 +1339,7 @@ public class ContikiMoteTypeDialog extends JDialog {
"LD_ARGS_1=" + GUI.getExternalToolsSetting("LINKER_ARGS_1", ""), "LD_ARGS_1=" + GUI.getExternalToolsSetting("LINKER_ARGS_1", ""),
"LD_ARGS_2=" + GUI.getExternalToolsSetting("LINKER_ARGS_2", ""), "LD_ARGS_2=" + GUI.getExternalToolsSetting("LINKER_ARGS_2", ""),
"EXTRA_CC_ARGS=" + ccFlags, "EXTRA_CC_ARGS=" + ccFlags,
"SYMBOLS=" + (includeSymbols?"1":""),
"CC=" + GUI.getExternalToolsSetting("PATH_C_COMPILER"), "CC=" + GUI.getExternalToolsSetting("PATH_C_COMPILER"),
"LD=" + GUI.getExternalToolsSetting("PATH_LINKER"), "LD=" + GUI.getExternalToolsSetting("PATH_LINKER"),
"PROJECTDIRS=" + sourceDirs, "PROJECTDIRS=" + sourceDirs,
@ -1979,6 +2012,9 @@ public class ContikiMoteTypeDialog extends JDialog {
} }
myMoteType.setMoteInterfaces(moteInterfaces); myMoteType.setMoteInterfaces(moteInterfaces);
// Set "using symbols"
myMoteType.setHasSystemSymbols(symbolsCheckBox.isSelected());
dispose(); dispose();
} else if (e.getActionCommand().equals("testsettings")) { } else if (e.getActionCommand().equals("testsettings")) {
testButton.requestFocus(); testButton.requestFocus();