Building a PCSL Reference Port (MR1)

first | prev | next | last

This document contains instructions for building a PCSL reference port. It has the following sections:

The phoneME Feature software uses the PCSL libraries to build the phoneME Feature software. PCSL contains the following individual services:

  • file
  • memory
  • network
  • print

Note: Although each PCSL service can be individually built, this guide describes how to build the full PCSL only.

To build a default implementation of PCSL, you take the following general steps:

  • Set environment variables for your platform
  • Run make all to build the PCSL implementation
  • Build Doxygen PCSL documentation (optional)

For more information on building individual PCSL services and other build options, see the Sun Java Wireless Client Build Guide.


PCSL Environment Variables

Note: Make a note of the values you choose for these variables. When building the phoneME Feature software, you must set corresponding values.

PCSL has three environment variables that can be set, as shown below:

  • PCSL_PLATFORM - Identifies the target operating system, the target CPU, and the compiler that the build system uses to create the PCSL library. Its value has the form os_cpu_compiler. This is a mandatory variable and must be set when building for all platforms.
  • PCSL_OUTPUT_DIR - Specifies into which directory the build system puts its output (for example, object files and libraries). This is an optional variable. If it is not specified, PCSL sets the output directory for you.
  • GNU_TOOLS_DIR - Specifies the location of the Monta Vista build tools for the Linux platform.

Note: In order for the CLDC and phoneME Feature software build processes to find PCSL output, the variable PCSL_OUTPUT_DIR must be set as a system variable.

Setting System Variables on a Linux Platform

Note: This document assumes the use of the Bash shell on the Linux platform. If you are using some other shell, set the variables for the shell you are using.

To set PCSL_PLATFORM, PCSL_OUTPUT_DIR, and GNU_TOOLS_DIR as Linux system variables, enter the following commands:

$ export PCSL_PLATFORM=linux_arm_gcc
$ export PCSL_OUTPUT_DIR=$HOME/pcsl_output
$ export GNU_TOOLS_DIR=/opt/montavista/cee/devkit/arm/v4t_le/armv4tl-hardhat-linux

Note: In the variables shown above, $HOME represents the location of your PCSL software. pcsl_output represents the location of the PCSL build output for your target platform (for example, linux_arm).

Setting System Variables on a Windows Platform

Note: This document assumes the use of Cyg4Me on the Windows platform.

To set PCSL_PLATFORM and PCSL_OUTPUT_DIR as Windows system variables, enter the following commands:

$ set PCSL_PLATFORM=win32_i386_vc
$ set PCSL_OUTPUT_DIR=C:/my_output/pcsl/output

Note: In the variables shown above, output represents the location of the PCSL build output for your target platform (for example, win32_i386).


Using PCSL make Files

To build a full implementation of PCSL, you run the make command at the top of your PCSL file tree. The make command calls a platform-specific makefile, called os_cpu_compiler.gmk, which builds an implementation of PCSL for your specific platform.

Each target platform has a makefile, which is tailored to the target platform's operating system, CPU, and the compiler used to build the PCSL implementation. For example, the makefile for the Windows implementation of PCSL is called win32_i386_vc.gmk.

The file os_cpu_compiler.gmk is located in the directory InstallDir/pcsl/makefiles/platforms.

Note: InstallDir is the location of your phoneME Feature software.

PCSL Build Targets

The PCSL build system provides several make targets that enable you to build specific sections of the PCSL reference port. However, this guide describes only two, as shown in TABLE 3-1.

TABLE 3-1 PCSL Build Targets

Name

Description

all

Builds libraries and public header files for services. Build results are in the $PCSL_OUTPUT_DIR/os_cpu subdirectory.

doc

Builds services API document generated by Doxygen. Output is in the $PCSL_OUTPUT_DIR/doc subdirectory. For more information, see Building PCSL Documentation.

For more information on PCSL build targets, see the Sun Java Wireless Client Build Guide.


Building PCSL Software

PCSL software is used to build both CLDC and phoneME Feature software. To build CLDC for the Linux/ARM target platform, you must first build PCSL for the Linux/i386 platform. By following the procedures in this section, you can build a default PCSL software reference port that contains libraries, tools, tests, and documentation bundles for your target platform.

Note: The following procedures build more than just the lib and inc directories. However, these are all the only directories needed for software development. For a complete list of directories built on the Linux and Windows platforms, see the Sun Java Wireless Client Build Guide.

Building for a Linux/i386 Platform

  1. Change to the PCSL directory.
  2. $ cd InstallDir/pcsl

  3. Run the make command.
  4. $ make GNU_TOOLS_DIR= PCSL_PLATFORM=linux_i386_gcc all

    Note: In the command above, the GNU_TOOLS_DIR variable is intentionally left undefined. This lack of definition overrides the previously set variable and prevents the build from picking up the Monta Vista tools used by other Linux platform builds.

    When the make command has successfully completed, the following directories exist:

    • $PCSL_OUTPUT_DIR/linux_i386/lib
    • $PCSL_OUTPUT_DIR/linux_i386/inc
Building for a Linux/ARM Platform

  1. Change to the PCSL directory.
  2. $ cd InstallDir/pcsl

  3. Run the make command.

    $ make all

    When the make command successfully completes, the following directories exist:

    • $PCSL_OUTPUT_DIR/linux_arm/lib
    • $PCSL_OUTPUT_DIR/linux_arm/inc

Building on a Windows Platform

  1. Mount the phoneME Feature software's PCSL directory at the root level.
  2. For example, if you installed the phoneME Feature software in C:\jwc1.1.3, use this command:

    $ mount C:\jwc1.1.3\pcsl /jwc1.1.3/pcsl

  3. Change to the PCSL directory.
  4. $ cd InstallDir/pcsl

  5. Run the make command.
  6. $ make all

    When the make command has successfully completed, the following directories exist:

    • $PCSL_OUTPUT_DIR/win32_i386/lib
    • $PCSL_OUTPUT_DIR/win32_i386/inc

Building PCSL Documentation

If you installed the Doxygen tool (from http://www.doxygen.org), you can create HTML documents from porting interfaces. To do this for PCSL, use the make doc build target. The documents are put in the directory $PCSL_OUTPUT_DIR/doc/doxygen/html.

Note: The build system assumes that the Doxygen executable is /usr/bin/doxygen. If your executable is in a different location, edit the Docs.gmk file in the directory InstallDir/pcsl/makefiles/share (where InstallDir is the location of your phoneME Feature software).

Set the DOXYGEN_CMD variable to the appropriate value.

Generating Doxygen Documentation

The following procedure for building Doxygen documentation is the same for both Linux and Windows build platforms.

  1. Change to the PCSL directory:
  2. $ cd InstallDir/pcsl

  3. Run the make doc command:
  4. $ make doc

Viewing PCSL Documents

Use any browser to display the Doxygen output file at the following URL:

file:///$PCSL_OUTPUT_DIR/doc/doxygen/html/index.html

first | prev | next | last