java.net: Wiki

The Source for Java Technology Collaboration


 <<O>>  Difference Topic BuildingSquawk (7 - 19 Jun 2009 - Main.khumalo)
Line: 1 to 1
 
META TOPICPARENT name="Squawk"

Building Squawk

This pages describes the steps to install and build Squawk on desktops and devices.
Line: 13 to 13
 

OnLinux

Building Squawk for Devices

Changed:
<
<

OnSPOT

>
>

ForSPOT

 

BuildingSquawkForOtherMCUs

ThumbOrNoThumb

Squawk Build Options

Deleted:
<
<

Squawk Builder Properties

There are a variety of properties defined in build.properties that control conditional compilation of the Squawk system. If the file build.override exists then the properties defined there will override the default values in build.properties. In addition, build properties can be overriden by passing the name of a properties file to the builder using the -override option, or by directly setting properties for the builder using the usual -Dkey=value option. Some commonly used properties are:
 
Deleted:
<
<
  • ASSERTIONS_ENABLED Enables use of com.sun.squawk.util.Assert (and defines Klass.ASSERTIONS_ENABLED)
  • DEBUG_CODE_ENABLED Set true to enable miscellaneous debug code (and define Klass.DEBUG_CODE_ENABLED)
  • FLOATS Floating point support. NOTE: FLOATS=false is currently broken due to phoneme code that we are inheriting
  • FLASH_MEMORY This is a heavily overloaded flag that means "has flash memory", "runs on bare metal (no OS)", "run on SPOT"
  • ENABLE_DYNAMIC_CLASSLOADING When false, can only load classes from suite. This should be false when FLASH_MEMORY is true
  • ENABLE_SDA_DEBUGGER Enable JPDA debugger agent support. Most debugger code is in debugger module, but some support routines are in base Squawk.

Option Remarks
SQUAWK always true
EXCLUDEAlways false
KERNEL_SQUAWKSet true for the split version of Squawk with support for asychronous handling of interrupts.
SQUAWK_64Set true on 64 bit systems (same as the romizer -64 option)
REVERSE_PARAMETERSParameter pushing convention
TRACING_ENABLEDEnables use of com.sun.squawk.util.Tracer (and defines Klass.TRACING_ENABLED)
ASSERTIONS_ENABLEDEnables use of com.sun.squawk.util.Assert (and defines Klass.ASSERTIONS_ENABLED)
DEBUG_CODE_ENABLEDSet true to enable miscellaneous debug code (and define Klass.DEBUG_CODE_ENABLED)
SUITE_VERIFIERSet true to enable verification of bytecodes once they have translated into the suite format
J2ME.STATSSet true for various stats in the translator to be available
MACROIZEMakes the macroized version of the Squawk executable. This can also be enabled with the '-mac' switch to the builder
GCSpecifies the class implementing com.sun.squawk.GarbageCollector that is to be used. com.sun.squawk.Lisp2Collector | com.sun.squawk.Lisp2GenerationalCollector | com.sun.squawk.CheneyCollector
NATIVE_GC_ONLYDisable support for interpreted GC. Disables the -interpgc flags as well
SMARTMONITORSSmart monitor releasing
INCLUDE_EXECUTECIO_PARMSTEMP hack for problem in compiler
FLOATSFloating point support
VERIFY_SIGNATURESIf true, verify signatures of suites
NATIVE_VERIFICATIONUse native C sha1 for signature verification. This triggers compiling of everything in vm/util
NATIVE_VERIFICATION_ONLYExclusivly Verification using native C sha1 only. Don't include suite signature verification java code
CLDC1.1Include classes and members added in CLDC 1.1 (apart from floating point stuff which is controlled by the FLOATS property)
JDK1.0Include classes and members that are part of JDK1.0 but not CLDC 1.0a or CLDC 1.1
FULL_SLOT_CLEARING_ANALYSISInclude full activation slot clearing analysis
TRUST_SLOT_CLEARINGTrust the slot clearing analysis in the slow VM
CHECK_SLOT_CLEARINGChecking code to see if the slot clearing analysis is correct
BUFFERCHANNELINPUTEnable in cases where channel I/O read operations can be improved (This speeds up class loading by about 30% when -Xioport is used.)
J2ME.HEAP_TRACEEnables tracing of the heap's layout at each collection to squawk.heap. This will also be enabled if J2ME.DEBUG is true
REUSEABLE_MESSAGESDisable message reuse
TYPEMAPEnables memory access type checking in the VM
FLASH_MEMORYEnable support for flash memory
ENABLE_DYNAMIC_CLASSLOADINGEnable support for dynamically loading classes into squawk (enables translator support) When false, can only load classes from suites. This should be false whan FLASH_MEMORY is true.
TRUSTEDEnable SKVM
VM2CEnables the generated C version of the collector
FINALIZATIONEnables support for Object.finalize()
OLD_IIC_MESSAGESEnable old inter-isolate message scheme
FAST_INVOKEINTERFACEUse C version of findslot (for interface method invocation) in the interpreter
RESOURCE.CONNECTIONEnable the "resource:" protocol
VERBOSE_EXCEPTIONSflag from CLDC sources. CLDC uses #ifdef VERBOSE_EXCEPTIONS, squawk uses /*if[VERBOSE_EXCEPTIONS]*/
ENABLE_SDA_DEBUGGEREnable JPDA debugger agent support Most debugger code is in sda module, but some support routines are in base Squawk
REAL_TIMEEnable real-time subset
REAL_TIME_MINIif true, exclude items that we could easily support, but that aren't that useful, such as methods that accept clocks, schedulers, or monitor control policies (we only support one of each anyway) the point of this is determine the size of this clutter.
REAL_TIME_PROTOif true, excludes items that we won't support initially becuase they are somewhat difficult. This includes Interruptable, Timed, and AIE. May include some scheduling parameters and feasability analysis support.
RTSJ1.0Enable full RTSJ 1.0 support. Update this so that: RTSJ1.0 = REAL_TIME & !(REAL_TIME_MINI | REAL_TIME_PROTO)

Squawk Executable Build Options

The squawk executable is built as part of the rom command. The format of the rom command is:
  • d build-options rom rom-options module more modules

The build-options primarily affect the C compilation of the system, except for the first two listed. Here is a list of commonly used build-options:

    -verbose            verbose builder output
    -Dname=value      sets a builder property
    -Xplat:name         the platform to cross-compile to. Platform drives default C compiler. See Note below
                        (default is host platform))
    -comp:name          the C compiler used to build native executables
                        Supported: 'msc', 'gcc' or 'cc' or 'gcc-macosx' (any
                        other value disables C compilaton)
    -nocomp             disables C compilation (but not C file preprocessing)
    -cflags:opts        extra C compiler options (e.g. '-cflags:-g')
    -o1                 optimize C compilation/linking for minimal size
    -o2                 optimize C compilation/linking for speed
    -o3                 optimize C compilation/linking for max speed
    -prod               build the production version of the VM
    -mac                build the interpreter loop using fast macros
    -tracing            enable tracing in the VM
    -profiling          enable profiling in the VM
    -assume             enable assertions in the VM
By default a non-optimized debug version of the executable is built, with assertions and runtime tracing enabled. The build-options that we use day-to-day are:
    -prod -mac -o2    
Note that -mac has nothing to do with Macintosh(TM) computers, but results in a much faster interpreter.

The rom-options affect the generation of the suite. The commonly used rom-options are:

    -metadata           create matching metadata suite
    -exclude:file       excludes classes that match the class names or packages
                        in file ('.exclude' is used implicitly)
    -strip:t            strip symbolic information according to :
                           'd' - debug: retain all symbolic info
                           'a' - application: discard all symbolic info
                           'l' - library (default): discard symbolic info
                                 for private/package-private fields and methods
                           'e' - extendable library: discard symbolic info
                                 for private fields and methods
    -lnt                retain line number tables
    -lvt                retain local variable tables
    -v                  verbose romizer output

A module is a directory that has a 'j2meclasses' subdirectory or a jar/zip file. More than one suite can be created by separating the modules for each suite with '--'.

Note

-Xplat does not appear to work in the main squawk branch. Browse the cvs for a SunSPOT orientated release which appears to support (amongst other things) these build.properties :

# PLATFORM TYPE may be one of:
# BARE_METAL - Squawk runs on the bare metal, implenting inetrrupts, timers, etc.
# DELEGATING - Squawk delagates all IO to another JVM, via JNI
# NATIVE - Squawk runs on an OS, and calls native OS routines for IO, etc.
# SOCKET - Squawk delagates all IO to another JVM, via a socket
#
# The builder will synthesize definitions of four additional properties: PLATFORM_TYPE_BARE_METAL,
# PLATFORM_TYPE_DELEGATING, PLATFORM_TYPE_NATIVE, and PLATFORM_TYPE_SOCKET, which can be used
# by the Java and C preprocessors to conditionally compile code.
# Uncomment one of the following definitions:
#PLATFORM_TYPE=BARE_METAL
#PLATFORM_TYPE=DELEGATING
PLATFORM_TYPE=NATIVE
#PLATFORM_TYPE=SOCKET

 -- Main.khumalo - 06 Oct 2008 -- Main.derek_white - 10 Jul 2008 \ No newline at end of file

 <<O>>  Difference Topic BuildingSquawk (6 - 16 Jun 2009 - Main.derek_white)
Line: 1 to 1
 
META TOPICPARENT name="Squawk"

Building Squawk

This pages describes the steps to install and build Squawk on desktops and devices.
Line: 15 to 15
 

Building Squawk for Devices

OnSPOT

BuildingSquawkForOtherMCUs

Added:
>
>

ThumbOrNoThumb

 

Squawk Build Options


 <<O>>  Difference Topic BuildingSquawk (5 - 28 May 2009 - Main.fraybentos)
Line: 1 to 1
 
META TOPICPARENT name="Squawk"

Building Squawk

This pages describes the steps to install and build Squawk on desktops and devices.
Line: 14 to 14
 

Building Squawk for Devices

OnSPOT

Changed:
<
<

BuildingSquawkForOtherCPUs

>
>

BuildingSquawkForOtherMCUs

 

Squawk Build Options


 <<O>>  Difference Topic BuildingSquawk (4 - 28 May 2009 - Main.fraybentos)
Line: 1 to 1
 
META TOPICPARENT name="Squawk"

Building Squawk

This pages describes the steps to install and build Squawk on desktops and devices.
Line: 14 to 14
 

Building Squawk for Devices

OnSPOT

Added:
>
>

BuildingSquawkForOtherCPUs

 

Squawk Build Options


 <<O>>  Difference Topic BuildingSquawk (3 - 06 Oct 2008 - Main.khumalo)
Line: 1 to 1
 
META TOPICPARENT name="Squawk"

Building Squawk

This pages describes the steps to install and build Squawk on desktops and devices.
Line: 85 to 85
 
    -verbose            verbose builder output
    -Dname=value      sets a builder property

Changed:
<
<
-Xplat:name the platform to cross-compile to. Platform drives default C compiler.
>
>
-Xplat:name the platform to cross-compile to. Platform drives default C compiler. See Note below
  (default is host platform)) -comp:name the C compiler used to build native executables
Supported
'msc', 'gcc' or 'cc' or 'gcc-macosx' (any
Line: 126 to 126
 file. More than one suite can be created by separating the modules for each suite with '--'.
Added:
>
>
Note

-Xplat does not appear to work in the main squawk branch. Browse the cvs for a SunSPOT orientated release which appears to support (amongst other things) these build.properties :

# PLATFORM TYPE may be one of:
# BARE_METAL - Squawk runs on the bare metal, implenting inetrrupts, timers, etc.
# DELEGATING - Squawk delagates all IO to another JVM, via JNI
# NATIVE - Squawk runs on an OS, and calls native OS routines for IO, etc.
# SOCKET - Squawk delagates all IO to another JVM, via a socket
#
# The builder will synthesize definitions of four additional properties: PLATFORM_TYPE_BARE_METAL,
# PLATFORM_TYPE_DELEGATING, PLATFORM_TYPE_NATIVE, and PLATFORM_TYPE_SOCKET, which can be used
# by the Java and C preprocessors to conditionally compile code.
# Uncomment one of the following definitions:
#PLATFORM_TYPE=BARE_METAL
#PLATFORM_TYPE=DELEGATING
PLATFORM_TYPE=NATIVE
#PLATFORM_TYPE=SOCKET

-- Main.khumalo - 06 Oct 2008

 -- Main.derek_white - 10 Jul 2008

 <<O>>  Difference Topic BuildingSquawk (2 - 23 Jul 2008 - Main.khumalo)
Line: 1 to 1
 
META TOPICPARENT name="Squawk"

Building Squawk

This pages describes the steps to install and build Squawk on desktops and devices.
Line: 27 to 27
 
  • ENABLE_DYNAMIC_CLASSLOADING When false, can only load classes from suite. This should be false when FLASH_MEMORY is true
  • ENABLE_SDA_DEBUGGER Enable JPDA debugger agent support. Most debugger code is in debugger module, but some support routines are in base Squawk.
Added:
>
>

Option Remarks
SQUAWK always true
EXCLUDEAlways false
KERNEL_SQUAWKSet true for the split version of Squawk with support for asychronous handling of interrupts.
SQUAWK_64Set true on 64 bit systems (same as the romizer -64 option)
REVERSE_PARAMETERSParameter pushing convention
TRACING_ENABLEDEnables use of com.sun.squawk.util.Tracer (and defines Klass.TRACING_ENABLED)
ASSERTIONS_ENABLEDEnables use of com.sun.squawk.util.Assert (and defines Klass.ASSERTIONS_ENABLED)
DEBUG_CODE_ENABLEDSet true to enable miscellaneous debug code (and define Klass.DEBUG_CODE_ENABLED)
SUITE_VERIFIERSet true to enable verification of bytecodes once they have translated into the suite format
J2ME.STATSSet true for various stats in the translator to be available
MACROIZEMakes the macroized version of the Squawk executable. This can also be enabled with the '-mac' switch to the builder
GCSpecifies the class implementing com.sun.squawk.GarbageCollector that is to be used. com.sun.squawk.Lisp2Collector | com.sun.squawk.Lisp2GenerationalCollector | com.sun.squawk.CheneyCollector
NATIVE_GC_ONLYDisable support for interpreted GC. Disables the -interpgc flags as well
SMARTMONITORSSmart monitor releasing
INCLUDE_EXECUTECIO_PARMSTEMP hack for problem in compiler
FLOATSFloating point support
VERIFY_SIGNATURESIf true, verify signatures of suites
NATIVE_VERIFICATIONUse native C sha1 for signature verification. This triggers compiling of everything in vm/util
NATIVE_VERIFICATION_ONLYExclusivly Verification using native C sha1 only. Don't include suite signature verification java code
CLDC1.1Include classes and members added in CLDC 1.1 (apart from floating point stuff which is controlled by the FLOATS property)
JDK1.0Include classes and members that are part of JDK1.0 but not CLDC 1.0a or CLDC 1.1
FULL_SLOT_CLEARING_ANALYSISInclude full activation slot clearing analysis
TRUST_SLOT_CLEARINGTrust the slot clearing analysis in the slow VM
CHECK_SLOT_CLEARINGChecking code to see if the slot clearing analysis is correct
BUFFERCHANNELINPUTEnable in cases where channel I/O read operations can be improved (This speeds up class loading by about 30% when -Xioport is used.)
J2ME.HEAP_TRACEEnables tracing of the heap's layout at each collection to squawk.heap. This will also be enabled if J2ME.DEBUG is true
REUSEABLE_MESSAGESDisable message reuse
TYPEMAPEnables memory access type checking in the VM
FLASH_MEMORYEnable support for flash memory
ENABLE_DYNAMIC_CLASSLOADINGEnable support for dynamically loading classes into squawk (enables translator support) When false, can only load classes from suites. This should be false whan FLASH_MEMORY is true.
TRUSTEDEnable SKVM
VM2CEnables the generated C version of the collector
FINALIZATIONEnables support for Object.finalize()
OLD_IIC_MESSAGESEnable old inter-isolate message scheme
FAST_INVOKEINTERFACEUse C version of findslot (for interface method invocation) in the interpreter
RESOURCE.CONNECTIONEnable the "resource:" protocol
VERBOSE_EXCEPTIONSflag from CLDC sources. CLDC uses #ifdef VERBOSE_EXCEPTIONS, squawk uses /*if[VERBOSE_EXCEPTIONS]*/
ENABLE_SDA_DEBUGGEREnable JPDA debugger agent support Most debugger code is in sda module, but some support routines are in base Squawk
REAL_TIMEEnable real-time subset
REAL_TIME_MINIif true, exclude items that we could easily support, but that aren't that useful, such as methods that accept clocks, schedulers, or monitor control policies (we only support one of each anyway) the point of this is determine the size of this clutter.
REAL_TIME_PROTOif true, excludes items that we won't support initially becuase they are somewhat difficult. This includes Interruptable, Timed, and AIE. May include some scheduling parameters and feasability analysis support.
RTSJ1.0Enable full RTSJ 1.0 support. Update this so that: RTSJ1.0 = REAL_TIME & !(REAL_TIME_MINI | REAL_TIME_PROTO)
 

Squawk Executable Build Options

The squawk executable is built as part of the rom command. The format of the rom command is:
  • d build-options rom rom-options module more modules

 <<O>>  Difference Topic BuildingSquawk (1 - 10 Jul 2008 - Main.derek_white)
Line: 1 to 1
Added:
>
>
META TOPICPARENT name="Squawk"

Building Squawk

This pages describes the steps to install and build Squawk on desktops and devices.

General

Squawk is built using a custom Java-based build system, cleverly called "builder". This build system is more cross-platform than "make", and may predate "ant". The build system can be started on the command line by entering java -jar build.jar, but is more commonly starting using a script (or batch file) named "d". We will use "d" in this documentation. For a full list of builder commands enter d -help.

Building Squawk for Desktop

OnWindows

OnMac

OnLinux

Building Squawk for Devices

OnSPOT

Squawk Build Options

Squawk Builder Properties

There are a variety of properties defined in build.properties that control conditional compilation of the Squawk system. If the file build.override exists then the properties defined there will override the default values in build.properties. In addition, build properties can be overriden by passing the name of a properties file to the builder using the -override option, or by directly setting properties for the builder using the usual -Dkey=value option. Some commonly used properties are:

  • ASSERTIONS_ENABLED Enables use of com.sun.squawk.util.Assert (and defines Klass.ASSERTIONS_ENABLED)
  • DEBUG_CODE_ENABLED Set true to enable miscellaneous debug code (and define Klass.DEBUG_CODE_ENABLED)
  • FLOATS Floating point support. NOTE: FLOATS=false is currently broken due to phoneme code that we are inheriting
  • FLASH_MEMORY This is a heavily overloaded flag that means "has flash memory", "runs on bare metal (no OS)", "run on SPOT"
  • ENABLE_DYNAMIC_CLASSLOADING When false, can only load classes from suite. This should be false when FLASH_MEMORY is true
  • ENABLE_SDA_DEBUGGER Enable JPDA debugger agent support. Most debugger code is in debugger module, but some support routines are in base Squawk.

Squawk Executable Build Options

The squawk executable is built as part of the rom command. The format of the rom command is:
  • d build-options rom rom-options module more modules

The build-options primarily affect the C compilation of the system, except for the first two listed. Here is a list of commonly used build-options:

    -verbose            verbose builder output
    -Dname=value      sets a builder property
    -Xplat:name         the platform to cross-compile to. Platform drives default C compiler.
                        (default is host platform))
    -comp:name          the C compiler used to build native executables
                        Supported: 'msc', 'gcc' or 'cc' or 'gcc-macosx' (any
                        other value disables C compilaton)
    -nocomp             disables C compilation (but not C file preprocessing)
    -cflags:opts        extra C compiler options (e.g. '-cflags:-g')
    -o1                 optimize C compilation/linking for minimal size
    -o2                 optimize C compilation/linking for speed
    -o3                 optimize C compilation/linking for max speed
    -prod               build the production version of the VM
    -mac                build the interpreter loop using fast macros
    -tracing            enable tracing in the VM
    -profiling          enable profiling in the VM
    -assume             enable assertions in the VM
By default a non-optimized debug version of the executable is built, with assertions and runtime tracing enabled. The build-options that we use day-to-day are:
    -prod -mac -o2    
Note that -mac has nothing to do with Macintosh(TM) computers, but results in a much faster interpreter.

The rom-options affect the generation of the suite. The commonly used rom-options are:

    -metadata           create matching metadata suite
    -exclude:file       excludes classes that match the class names or packages
                        in file ('.exclude' is used implicitly)
    -strip:t            strip symbolic information according to :
                           'd' - debug: retain all symbolic info
                           'a' - application: discard all symbolic info
                           'l' - library (default): discard symbolic info
                                 for private/package-private fields and methods
                           'e' - extendable library: discard symbolic info
                                 for private fields and methods
    -lnt                retain line number tables
    -lvt                retain local variable tables
    -v                  verbose romizer output

A module is a directory that has a 'j2meclasses' subdirectory or a jar/zip file. More than one suite can be created by separating the modules for each suite with '--'.

-- Main.derek_white - 10 Jul 2008


Topic BuildingSquawk . { View | Diffs r7 < r6 < r5 < r4 | More }
 XML java.net RSS