CDC Build System: Host EnvironmentOnce you have downloaded the source code for phoneME Advanced MR1, you can use the build system included with it to build different executable versions of a CDC Java runtime environment. These different versions can include different peformance features, API options or run on different target platforms. The following sections show how to setup the CDC build system on a Linux/x86 host platform, and then build different versions of the CDC Java runtime environment that will also run on a Linux/x86 platform. A later section describes how to build different versions of the CDC Java runtime environment that will also run on alternate devices like advanced phones.
This guide only covers the basic build procedures and build options. See the CDC Build System Guide for more information about build options, build system organization and tool setup issues. See CDC Build System: Target Devices for information on how to build executable versions of the CDC Java runtime environment for various embedded target devices. Build System Setup
The CDC build system included with the source code for the phoneME Advanced MR1 can run on many different Linux distributions. To run the CDC build system, you will need certain Linux developer tools like a C/C++ compiler as well as the Java developer tools included in the Java SE SDK. A reasonable guideline is that a recent, common Linux distribution should include the tools needed by the CDC build system. However some user-oriented Linux distributions like Ubuntu and openSUSE may not include the necessary tools by default. So the tables below provides guidelines for acquiring the necessary tools. Note: Linux distributions have a mechanism for deploying pre-built software called a package management system. There are two main Linux package management systems:
Note that the source code and build system for this release
have been tested with earlier versions of gcc as well,
in particular 3.3.x and 3.4.x.
Download and install the Java SE SDK, version 1.4.2. The examples below are based on installing the Java developer tools in /usr/java/j2sdk. Note that many Linux distributions include alternate implementations of these Java developer tools. We have only tested and run the CDC build system with the Java developer tools provided by Sun. A Simple Example Build: CDCOnce you've set up the CDC build system by installing the necessary build tools and specifying their location in the GNUmakefile, then you can perform a simple build process to validate the build system.
The simplest build target is CDC without any profile.
This is a "headless" implementation
that we'll use to run a basic HelloWorld application.
The CDC build system is launched with a single make command.
% make The build system will display a log of the build process. If the build is successful, it will display something like:
... make[1]: Entering directory `/home/user/phoneme-advanced-mr1/build/linux-x86-generic' make[1]: Nothing to be done for `tools'. make[1]: Leaving directory `/home/user/phoneme-advanced-mr1/build/linux-x86-generic' If the build fails at some point, your build tools are probably misconfigured or not compatible. The first step is to look at the definitions of variables:
Test the ExecutableWhen the build process completes successfully it generates an executable CDC Java runtime environment. The component files of the CDC Java runtime environment are located in the target build directory. The most basic runtime files are in the bin and lib directories and a set of demo programs are in testclasses.zip. Here is the command-line for running a simple test application.
% bin/cvm -cp testclasses.zip HelloWorld Building Foundation ProfileFoundation Profile (FP) is a more complete API specification for headless devices. The steps described above can be easily modified to build an executable for FP. All you have to do is add J2ME_CLASSLIB=foundation build option to the build options in the GNUmakefile. More Build OptionsThe CDC build system includes many build options and targets:
The CDC Build System Guide provides tables that describe each build option. Building Personal Basis ProfileThe CDC build system has many build options for building versions of the CDC Java runtime environment with additional API capabilities. For example, Personal Basis Profile (PBP) is an API specification for providing GUI capabilities. While PBP is not itself a GUI framework, it provides an infrastructure for implementing lightweight GUI widget toolkits like Swing and support for the xlet application model.
This build example will show how to build the CDC Java runtime environment
with a PBP implementation based on the
Qt
GUI framework.
The build system requirements for PBP are the same as the base requirements described earlier with the addition of the Qt3 development libraries.
Build the ExecutableBuilding PBP requires a few additional build options. You can put these make variables on the make command-line or add them to the GNUmakefile.
J2ME_CLASSLIB=basis QT_TARGET_DIR=/usr/share/qt3/lib X11_LIB_DIR=/usr/X11R6/lib
QT_TARGET_DIR
refers to the location of the
Qt3
development libraries.
X11_LIB_DIR
refers to the location of the X11 libraries.
Here is the command-line for running a PBP test application.
% bin/cvm -cp democlasses.jar basis.DemoFrame Building Personal Profile
Personal Profile (PP) is also an API specification
for providing GUI capabilities.
In fact,
it's a superset of PBP which adds support for AWT and applets.
The build system requirements for PP are the same as the
build system requirements for PBP
described earlier.
Building PP requires a few additional build options. You can put these on the make command-line or add them to the GNUmakefile.
J2ME_CLASSLIB=personal Test the ExecutableHere is the command-line for running a PP test application.
% bin/cvm -cp democlasses.jar personal.DemoFrame |