Getting Started with phoneME Feature Software (MR2)

# Building a CLDC Reference Port first | prev | next-last CLDC software is an OSS community version of Sun Microsystems' Connected Limited Device Configuration HotSpot™ Implementation virtual machine. Although primarily created from the same shared code base, Sun Microsystems' commercial product might not fully and accurately represent the OSS source base, due to licensing and other legal restrictions. This document has the following sections: Building CLDC Software on a Linux/i386 Build Platform Building CLDC Software on a Win32/i386 Build Platform Building CLDC Documentation For more information about building and running CLDC, see CLDC HotSpot Implementation software documentation. Note: This document is part of the MR2 development release version of phoneME Feature software. The instructions have not been verified or tested. The contents will continue to change as development moves forward. ### Building CLDC Software on a Linux/i386 Build Platform This section desccribes how to build a default implemenation of the CLDC software. A successful build of CLDC is required to build the phoneME Feature software client. Setting Variables for a Linux/i386 Build Platform To properly build CLDC software on a Linux/i386 build platform, you must set the environment variables shown in TABLE 4-1.
TABLE 4-1 Linux/i386 Build Platform Environment Variables
Name | Description
--- | ---
`JVMWorkSpace` | The location of your CLDC software source code directory. For example, `JVMWorksSpace=$HOME/cldc`. Note: This variable is set the same for both Linux/i386 and Linux/ARM target builds.
`JVMBuildSpace` | The location of your CLDC software build output. For example, `JVMBuildSpace=$BUILD_OUTPUT_DIR/cldc`. Note: This variable is set the same for both Linux/i386 and Linux/ARM target builds.
`ENABLE_PCSL` | Required for building CLDC with the PCSL software component. Must be set to `true`.
`ENABLE_ISOLATES` | Required for building a CLDC implementation with multitasking capability. Must be set to `true`. If not explicitly set to `true`, the build defaults to `false` and CLDC is built without multitasking capability.
Building a default version of the CLDC software creates the executable `cldc_vm`, for both Linux/i386 and Linux/ARM target platforms. Setting Build Environment Variables for Both Target Platforms The primary CLDC environment variables, `$JVMWorkSpace` and `$JVMBuildSpace`, are set once, as system variables, for both Linux/i386 and Linux/ARM target platforms, as shown here. `$ export JVMWorksSpace=$HOME/cldc` `$ export JVMBuildSpace=$BUILD_OUTPUT_DIR/cldc` Note: The variables `ENABLE_PCSL` and `ENABLE_ISOLATES` are set on the `make` command line, as shown below. Building CLDC for a Linux/i386 Target Platform Change directory to `$JVMWorkSpace/build/linux_i386`. `$ cd $JVMWorkSpace/build/linux_i386` Run the `make` command to build CLDC software, to include PCSL libraries, and to enable multiasking capabilities, as shown here. `$ make ENABLE_PCSL=true ENABLE_ISOLATES=true` The generated CLDC output is found under `$JVMBuildSpace/linux_i386/dist`. Building CLDC for a Linux/ARM Target Platform Change directory to `$JVMWorkSpace/build/linux_arm`. `$ cd $JVMWorkSpace/build/linux_arm` Run the `make` command to build CLDC software, to include PCSL libraries, to enable multitasking capabilities, and to call MontaVista development tools, as shown here. `$ make ENABLE_PCSL=true ENABLE_ISOLATES=true GNU_TOOLS_DIR=$MONTAVISTA` Note: In the above command line, the variable `$MONTAVISTA` is a shortcut for a much longer command string, as described here. The generated CLDC output is found under `$JVMBuildSpace/linux_arm/dist` ### Building CLDC Software on a Win32/i386 Build Platform To properly build the CLDC software on a Windows platform, you must set the environment variables shown in TABLE 4-2.
TABLE 4-2 Win32/i386 Build Platform Environment Variables
Name | Description
--- | ---
`JVMWorkSpace` | The location of your CLDC software source code workspace. For example, `JVMWorksSpace=InstallDir/cldc`.
`JVMBuildSpace` | The location of your CLDC software build output. For example, `JVMBuildSpace=$BUILD_OUTPUT_DIR/cldc`.
`ENABLE_PCSL` | Required for building the phoneME Feature software. Must be set to `true`.
`ENABLE_ISOLATES` | Required for building a CLDC implementation with multitasking capability. Must be set to `true`. If not explicitly set to `true`, the build defaults to `false` and CLDC is built without multitasking capability.
`JAVACALL_OUTPUT_DIR` | If you are building a JavaCall implementation (Win32 only), this specifies the location of the JavaCall output. Note: If you have previously built JavaCall, this variable should already be set.
Building a default version of CLDC creates the CLDC software executable `cldc_vm.exe`, for both the Win32/i386 and Javacall/i386 target platforms. Setting Win32/i386 Build Environment Variables for Both Target Platforms Set CLDC build environment variables as shown here: `$ set JVMWorksSpace=%HOME%/cldc` `$ set JVMBuildSpace=%BUILD_OUTPUT_DIR%/cldc` Note: The variables `ENABLE_PCSL` and `ENABLE_ISOLATES` are set on the `make` command line, as shown below. Building CLDC for a Win32/i386 Target Platform Change directory to `%JVMWorkSpace%/build/win32_i386`. `$ cd %JVMWorkSpace%/build/win32_i386` Run the `make` command to build the CLDC software, to include the PCSL libraries, and to enable multitasking capabilities, as shown here. `$ make ENABLE_PCSL=true ENABLE_ISOLATES=true` The generated CLDC output is found under `%JVMBuildSpace%/build/win32_i386/dist`. Building CLDC for a Javacall/i386 Target Platform Change directory to `%JVMWorkSpace%/build/javacall_i386_vc`. `$ cd %JVMWorkSpace%/build/javacall_i386_vc` Note: If you have previously built the Javacall porting layer for PCSL, the `JAVACALL_PLATFORM` and `JAVACALL_OUTPUT_DIR` environment variables should already be set. If not, set them as shown here: `$ set JAVACALL_PLATFORM=javacall_i386_vc` `$ set JAVACALL_OUTPUT_DIR=%BUILD-OUTPUT_DIR%/javacall` Run the `make` command to build the CLDC software, to include the PCSL libraries, and to enable multitasking capabilities, as shown here. `$ make ENABLE_PCSL=true ENABLE_ISOLATES=true` The generated CLDC output is found under `%JVMBuildSpace%/build/javacall_i386/dist`. ### Running CLDC Software Once you build the CLDC software, you can invoke it from the command line to run a class compiled from the Java programming language. The path to the executable depends on the target platform (operating system and processor) for which you build the software. Running CLDC on a Linux/i386 or Linux/ARM Target Platform Change to the CLDC build space for your target platform: On a Linux/i386 target platform, change to: `$ cd $JVMBuildSpace/linux_i386/dist` On a Linux/ARM target platform, change to: `$ cd $JVMBuildSpace/linux_arm/dist` Enter the following command: `$ bin/cldc_vm -classpath` location-of-compiled-applications`/classes` classname For example, to run the `HelloWorld` application, the command string could be: `$ bin/cldc_vm -classpath /src/classes HelloWorld` Running CLDC on a Win32/i386 or Javacall/i386 Target Platform Change to the CLDC build space for the Win32/i386 platform: On a win32/i386 target platform, change to: `$ cd %JVMBuildSpace%/win32_i386/dist` On a Javacall/i386 target platform, change to: `$ cd %JVMBuildSpace%/javacall_i386/dist` Enter the following command: `$ bin/cldc_vm.exe -classpath` location-of-compiled-applications`/classes` classname For example, to run the `HelloWorld` application, the command string could be: `$ bin/cldc_vm -classpath C:/src/classes HelloWorld` ### Building CLDC Documentation You can create HTML documents from CLDC porting interfaces. To do this for the CLDC software, use the `make docs_html` build target. Generating Javadoc Tool Documentation Building Javadoc tool documentation is the same for both Linux/i386 and Win32/i386 build platforms. Change to the default build directory for your build platform. For example, this could be a Linux/i386 platform, as shown here. `$ cd $JVMWorkSpace/build/linux_i386` Build Javadoc tool HTML documentation. `$ make docs_html` The generated HTML documents are put in the following directory: `$JVMBuildSpace/doc/javadoc/html` Viewing phoneME Feature Documents Use any browser to display the Javadoc tool output file at the following URL: `file://$JVMBuildSpace/doc/javadoc/html/index.html`
first | prev | next-last