The Source for Java Technology Collaboration


Quick Start Build Guide

These notes contain a rapid walk through the process of building and running the CDC Java runtime environment for a target system. The rest of this Getting Started Guide provides more explanations and the recipes provide concrete examples based on commercial and open source platforms.

  1. Create a directory to contain the phoneME Advanced source code and build system:

    % mkdir phoneme
    % cd phoneme
    

  2. Get the phoneME Advanced source code with one of the following methods.

    • Download the project source code bundle.

      1. See the phoneME Project Downloads for a list of source code bundles.

      2. Download a source code bundle.

      3. Unpack the source code bundle:

        % unzip bundle.zip
        

    • Checkout the project source code repository.

      1. Obtain a java.net account for use with the Subversion repository.

      2. Checkout the basic components from the source code repository:

        % svn checkout https://phoneme.dev.java.net/svn/phoneme/components/cdc/trunk cdc
        % svn checkout https://phoneme.dev.java.net/svn/phoneme/components/tools/trunk tools
        

  3. Go to the build directory for your target device:

    % cd cdc/build/linux-arm-generic
    

  4. Find the locations of the various build tools. Each tool group is associated with a macro used by the CDC build system to locate the build tools.

    1. Target build tools (C compiler, linker, etc.).

      CVM_TARGET_TOOLS_PREFIX=<prefix>
      

      Note that this macro is not exactly a path. It is a prefix that includes a path and the shared portion of the tool name that precedes the root tool name. The goal of CVM_TARGET_TOOLS_PREFIX is to find all the target build tools with a certain name scheme. For example, if gcc is located at /opt/arm-linux/bin/arm-linux-gcc, then you would use:

      CVM_TARGET_TOOLS_PREFIX=/opt/arm-linux/bin/arm-linux-
      

      Note the trailing '-'.

    2. Optional. Java build tools (for javac, etc.).

      JDK_HOME=<prefix>
      

      The CDC build system uses JDK_HOME to locate the JDK. For example,

      JDK_HOME=/usr/java/j2sdk1.4.2_15
      

      Note: This macro is unnecessary if these tools are in your PATH variable.

  5. Read through the comments in GNUmakefile to see if any flags need to be changed. For linux-arm-generic, USE_AAPCS is the most common flag to change. Sometimes processor-specific flags need to or can be added to ASM_ARCH_FLAGS, but in most cases the compiler default is the correct choice.

  6. Build the CDC Java runtime environment for the target system:

    % make CVM_TARGET_TOOLS_PREFIX=<prefix> \
                 JDK_HOME=<prefix> \
                 J2ME_CLASSLIB=foundation
    

    When the build is complete, the target files are located in the target build directory and, by default, includes many temporary build files and directories that are not specifically needed for the CDC Java runtime environment. The important target files and directories are:

    • bin
    • lib
    • testclasses.zip

    To direct the CDC build system to generate these files in a separate directory use the CVM_BUILD_SUBDIR_NAME macro. For example,

    CVM_BUILD_SUBDIR_NAME=cdc
    

    generates the target files in a directory named cdc.

    Other build options like CVM_DEBUG and CVM_JIT are described in the rest of the phoneME Advanced Getting Started Guide, the CDC Build System Guide (see Chapter 5) and the build file cdc/build/share/top.mk.

  7. Move the contents of the target directory to your target device.

    % zip -r cdc.zip bin lib testclasses.zip
    % sftp target-device
    ...
    

  8. Launch an example application with the CDC Java runtime environment:

    % unzip cdc.zip
    % bin/cvm -cp testclasses.zip Test
    

Topic PhoneMEAdvancedBSGQuick . { Edit | Ref-By | Printable | Diffs r7 < r6 < r5 < r4 < r3 | More }
 XML java.net RSS

Revision r7 - 21 Nov 2008 - 00:00:25 - Main.dbsears
Parents: WebHome > PhoneMEAdvanced