// Must be after Closure.root(..) because of HAIKU_Threads may become 1
new HaikuDefs(HaikuDefs.getProperty("APP_BASE")).print();
File cf=new File(HaikuDefs.getProperty("APP_BASE")+"/"+Haikufy.choice("haikuC")+"/haikuConfig.h");
haikuConfigh=new PrintOnChange(cf);
haikuConfigh.println("#include \"haikuJ2C.h\"");
File ni=new File(HaikuDefs.getProperty("APP_BASE")+"/"+Haikufy.choice("haikuC")+"/haikuConfig.c");
haikuConfigc=new PrintOnChange(ni);
haikuConfigc.println("#include \"haikuConfig.h\"");
haikuConfigc.println();
//haikuConfigc.printf("#include \"Bytecodes.h\"\n");
haikuConfigc.printf("#include <float.h>\n");
haikuConfigc.printf("\n");
Closure.root("java.lang.Thread");
Closure.root("java.lang.String");
int distinctBCs = Closure.getDistinctBCs();
FunctionTable.setInvokeShortMax(Math.max(256-distinctBCs-35, 0));
/*
* Order is important to keep exceptionCode at position 0 in case of exception usage.
*
* statics_t allStatics;
* //jobject:
* ...
* //jint:
* // 0 haiku_vm_arduino_HaikuMicroKernel_exceptionCode
* // 1 haiku_vm_arduino_HaikuMicroKernel_exceptionArg
*
* FIRST
*/
if(mainOsThread!=null) {
if (linkerOption) {
new Compile2Data(mainOsThread).link();
} else {
new Compile2C(mainOsThread).compile();
}
}
/*
* SECOND
*/
if (!mainOsThread.equals(mainclass)) {
if (linkerOption) {
new Compile2Data(mainclass).link();
} else {
new Compile2C(mainclass).compile();
}
}
/*
* THIRD
*
*/
if (linkerOption) {
new Compile2Data("java/lang/Thread").link();
} else {
new Compile2C("java/lang/Thread").compile();
}
/*
* FOURTH
*
*/
if (linkerOption) {
new Compile2Data("java/lang/String").link();
} else {
new Compile2C("java/lang/String").compile();
}
Msg2Meth.printAllMsgsH(haikuConfigh);
BC2IDX.printAllBCdefinesH(haikuConfigh);
BC2IDX.printBCtableC(haikuConfigc);
PrintOnChange bytecodeDispatcher=new PrintOnChange(new File(HaikuDefs.getProperty("APP_BASE")+"/"+Haikufy.choice("haikuC")+"/bytecodeDispatcher.h"));
BC2IDX.printBytecodeLabels(bytecodeDispatcher);
bytecodeDispatcher.close();
if (singleFile) {
haikuConfigc.printf("\n");
haikuConfigc.printf("\n");
haikuConfigc.println("#include \"haikuJava.h\"");