mirror of
https://github.com/oliverschmidt/contiki.git
synced 2025-02-12 15:30:59 +00:00
do not generate source + prepare environment method was updated
This commit is contained in:
parent
645d505f46
commit
ace6cff93f
@ -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: ContikiMoteType.java,v 1.41 2010/03/10 07:52:05 fros4943 Exp $
|
* $Id: ContikiMoteType.java,v 1.42 2010/03/15 11:04:07 fros4943 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.sics.cooja.contikimote;
|
package se.sics.cooja.contikimote;
|
||||||
@ -273,7 +273,7 @@ public class ContikiMoteType implements MoteType {
|
|||||||
mapFile.delete();
|
mapFile.delete();
|
||||||
|
|
||||||
/* Generate Contiki main source */
|
/* Generate Contiki main source */
|
||||||
try {
|
/*try {
|
||||||
CompileContiki.generateSourceFile(
|
CompileContiki.generateSourceFile(
|
||||||
libSource,
|
libSource,
|
||||||
javaClassName,
|
javaClassName,
|
||||||
@ -283,7 +283,7 @@ public class ContikiMoteType implements MoteType {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw (MoteTypeCreationException) new MoteTypeCreationException(
|
throw (MoteTypeCreationException) new MoteTypeCreationException(
|
||||||
"Error when generating Contiki main source").initCause(e);
|
"Error when generating Contiki main source").initCause(e);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/* Prepare compiler environment */
|
/* Prepare compiler environment */
|
||||||
String[][] env;
|
String[][] env;
|
||||||
@ -293,7 +293,8 @@ public class ContikiMoteType implements MoteType {
|
|||||||
contikiApp,
|
contikiApp,
|
||||||
mapFile,
|
mapFile,
|
||||||
libFile,
|
libFile,
|
||||||
archiveFile);
|
archiveFile,
|
||||||
|
javaClassName);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw (MoteTypeCreationException) new MoteTypeCreationException(
|
throw (MoteTypeCreationException) new MoteTypeCreationException(
|
||||||
"Error when creating environment: " + e.getMessage()).initCause(e);
|
"Error when creating environment: " + e.getMessage()).initCause(e);
|
||||||
|
@ -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: CompileContiki.java,v 1.5 2010/03/10 07:49:25 fros4943 Exp $
|
* $Id: CompileContiki.java,v 1.6 2010/03/15 11:04:07 fros4943 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.sics.cooja.dialogs;
|
package se.sics.cooja.dialogs;
|
||||||
@ -42,6 +42,7 @@ import java.io.InputStream;
|
|||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.io.OutputStreamWriter;
|
import java.io.OutputStreamWriter;
|
||||||
import java.io.Reader;
|
import java.io.Reader;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import javax.swing.Action;
|
import javax.swing.Action;
|
||||||
|
|
||||||
@ -363,12 +364,13 @@ public class CompileContiki {
|
|||||||
* Generate compiler environment using external tools settings.
|
* Generate compiler environment using external tools settings.
|
||||||
* Used by Contiki Mote Type.
|
* Used by Contiki Mote Type.
|
||||||
*
|
*
|
||||||
* @param identifier Mote type identifier
|
* @param identifier Mote type identifier, "mtype123"
|
||||||
* @param contikiApp Contiki application source
|
* @param contikiApp Contiki application source, "hello-world.c"
|
||||||
* @param mapFile Expected map file
|
* @param mapFile Output map file, "mtype123.map"
|
||||||
* @param libFile Expected JNI Contiki library
|
* @param libFile Output JNI library, "mtype123.cooja"
|
||||||
* @param archiveFile Expected Contiki archive
|
* @param archiveFile Output archive, "mtype123.a"
|
||||||
* @return Environment
|
* @param javaClass Java JNI library class, "Lib4"
|
||||||
|
* @return Compilation environment
|
||||||
* @throws Exception At errors
|
* @throws Exception At errors
|
||||||
*/
|
*/
|
||||||
public static String[][] createCompilationEnvironment(
|
public static String[][] createCompilationEnvironment(
|
||||||
@ -376,7 +378,8 @@ public class CompileContiki {
|
|||||||
File contikiApp,
|
File contikiApp,
|
||||||
File mapFile,
|
File mapFile,
|
||||||
File libFile,
|
File libFile,
|
||||||
File archiveFile)
|
File archiveFile,
|
||||||
|
String javaClass)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
|
|
||||||
if (identifier == null) {
|
if (identifier == null) {
|
||||||
@ -394,6 +397,9 @@ public class CompileContiki {
|
|||||||
if (archiveFile == null) {
|
if (archiveFile == null) {
|
||||||
throw new Exception("No archive file specified");
|
throw new Exception("No archive file specified");
|
||||||
}
|
}
|
||||||
|
if (javaClass == null) {
|
||||||
|
throw new Exception("No Java library class name specified");
|
||||||
|
}
|
||||||
|
|
||||||
boolean includeSymbols = false; /* TODO */
|
boolean includeSymbols = false; /* TODO */
|
||||||
|
|
||||||
@ -438,21 +444,23 @@ public class CompileContiki {
|
|||||||
|
|
||||||
/* Strip away contiki application .c extension */
|
/* Strip away contiki application .c extension */
|
||||||
String contikiAppNoExtension = contikiApp.getName().substring(0, contikiApp.getName().length()-2);
|
String contikiAppNoExtension = contikiApp.getName().substring(0, contikiApp.getName().length()-2);
|
||||||
String[][] env = new String[13][];
|
|
||||||
env[0] = new String[] { "LIBNAME", identifier };
|
|
||||||
env[1] = new String[] { "CONTIKI_APP", contikiAppNoExtension };
|
|
||||||
env[2] = new String[] { "COOJA_SOURCEFILES", "" };
|
|
||||||
env[3] = new String[] { "CC", GUI.getExternalToolsSetting("PATH_C_COMPILER") };
|
|
||||||
env[4] = new String[] { "EXTRA_CC_ARGS", ccFlags };
|
|
||||||
env[5] = new String[] { "LD", GUI.getExternalToolsSetting("PATH_LINKER") };
|
|
||||||
env[6] = new String[] { "LINK_COMMAND_1", link1 };
|
|
||||||
env[7] = new String[] { "LINK_COMMAND_2", link2 };
|
|
||||||
env[8] = new String[] { "AR", GUI.getExternalToolsSetting("PATH_AR") };
|
|
||||||
env[9] = new String[] { "AR_COMMAND_1", ar1 };
|
|
||||||
env[10] = new String[] { "AR_COMMAND_2", ar2 };
|
|
||||||
env[11] = new String[] { "SYMBOLS", includeSymbols?"1":"" };
|
|
||||||
env[12] = new String[] { "PATH", System.getenv("PATH") };
|
|
||||||
|
|
||||||
return env;
|
/* Create environment */
|
||||||
|
ArrayList<String[]> env = new ArrayList<String[]>();
|
||||||
|
env.add(new String[] { "LIBNAME", identifier });
|
||||||
|
env.add(new String[] { "CLASSNAME", javaClass });
|
||||||
|
env.add(new String[] { "CONTIKI_APP", contikiAppNoExtension });
|
||||||
|
env.add(new String[] { "COOJA_SOURCEFILES", "" });
|
||||||
|
env.add(new String[] { "CC", GUI.getExternalToolsSetting("PATH_C_COMPILER") });
|
||||||
|
env.add(new String[] { "EXTRA_CC_ARGS", ccFlags });
|
||||||
|
env.add(new String[] { "LD", GUI.getExternalToolsSetting("PATH_LINKER") });
|
||||||
|
env.add(new String[] { "LINK_COMMAND_1", link1 });
|
||||||
|
env.add(new String[] { "LINK_COMMAND_2", link2 });
|
||||||
|
env.add(new String[] { "AR", GUI.getExternalToolsSetting("PATH_AR") });
|
||||||
|
env.add(new String[] { "AR_COMMAND_1", ar1 });
|
||||||
|
env.add(new String[] { "AR_COMMAND_2", ar2 });
|
||||||
|
env.add(new String[] { "SYMBOLS", includeSymbols?"1":"" });
|
||||||
|
env.add(new String[] { "PATH", System.getenv("PATH") });
|
||||||
|
return env.toArray(new String[0][0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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: ConfigurationWizard.java,v 1.8 2010/03/10 07:49:46 fros4943 Exp $
|
* $Id: ConfigurationWizard.java,v 1.9 2010/03/15 11:04:06 fros4943 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.sics.cooja.dialogs;
|
package se.sics.cooja.dialogs;
|
||||||
@ -601,7 +601,8 @@ public class ConfigurationWizard extends JDialog {
|
|||||||
new File(cLibraryName + ".c"),
|
new File(cLibraryName + ".c"),
|
||||||
new File(cLibraryName + ContikiMoteType.mapSuffix),
|
new File(cLibraryName + ContikiMoteType.mapSuffix),
|
||||||
new File(cLibraryName + ContikiMoteType.librarySuffix),
|
new File(cLibraryName + ContikiMoteType.librarySuffix),
|
||||||
new File(cLibraryName + ContikiMoteType.dependSuffix)
|
new File(cLibraryName + ContikiMoteType.dependSuffix),
|
||||||
|
javaLibraryName
|
||||||
);
|
);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
testOutput.addMessage("### Error: Compiler environment failed", MessageList.ERROR);
|
testOutput.addMessage("### Error: Compiler environment failed", MessageList.ERROR);
|
||||||
|
@ -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: ContikiMoteCompileDialog.java,v 1.6 2010/03/10 07:51:30 fros4943 Exp $
|
* $Id: ContikiMoteCompileDialog.java,v 1.7 2010/03/15 11:04:07 fros4943 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.sics.cooja.dialogs;
|
package se.sics.cooja.dialogs;
|
||||||
@ -164,7 +164,8 @@ public class ContikiMoteCompileDialog extends AbstractCompileDialog {
|
|||||||
source,
|
source,
|
||||||
((ContikiMoteType)moteType).mapFile,
|
((ContikiMoteType)moteType).mapFile,
|
||||||
((ContikiMoteType)moteType).libFile,
|
((ContikiMoteType)moteType).libFile,
|
||||||
((ContikiMoteType)moteType).archiveFile
|
((ContikiMoteType)moteType).archiveFile,
|
||||||
|
((ContikiMoteType)moteType).javaClassName
|
||||||
);
|
);
|
||||||
String[] envOneDimension = new String[env.length];
|
String[] envOneDimension = new String[env.length];
|
||||||
for (int i=0; i < env.length; i++) {
|
for (int i=0; i < env.length; i++) {
|
||||||
@ -361,7 +362,7 @@ public class ContikiMoteCompileDialog extends AbstractCompileDialog {
|
|||||||
((ContikiMoteType)moteType).setCoreInterfaces(coreInterfaces);
|
((ContikiMoteType)moteType).setCoreInterfaces(coreInterfaces);
|
||||||
|
|
||||||
/* Generate Contiki main source */
|
/* Generate Contiki main source */
|
||||||
try {
|
/*try {
|
||||||
CompileContiki.generateSourceFile(
|
CompileContiki.generateSourceFile(
|
||||||
((ContikiMoteType)moteType).libSource,
|
((ContikiMoteType)moteType).libSource,
|
||||||
((ContikiMoteType)moteType).javaClassName,
|
((ContikiMoteType)moteType).javaClassName,
|
||||||
@ -370,7 +371,7 @@ public class ContikiMoteCompileDialog extends AbstractCompileDialog {
|
|||||||
);
|
);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw (Exception) new Exception("Error when generating Contiki main source").initCause(e);
|
throw (Exception) new Exception("Error when generating Contiki main source").initCause(e);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/* Start compiling */
|
/* Start compiling */
|
||||||
super.compileContiki();
|
super.compileContiki();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user