C H A P T E R  1

Introduction

This book describes how to build Java Wireless Client software. Java Wireless Client software has a powerful and flexible build system that supports building on multiple platforms for multiple platforms. The platform where you run Java Wireless Client software is the target platform.

This book describes the build system as a whole and provides several example builds. The examples are a good way to become acquainted with the Java Wireless Client software and build system.

Once you are comfortable building Java Wireless Client software, you can begin to adapt the build to your own specific hardware.

Building a complete Java Wireless Client software stack consists of several steps. Basically, you start at the bottom and work your way up.

1. Build the JavaCalltrademark API (Windows only).

2. Build PCSL.

3. Build CLDC.

4. Build Java Wireless Client software and optional APIs.

Each build uses the results of previous steps.

This chapter provides a brief overview of the directory structure of the Java Wireless Client software. It also lists the tools you need to build the software.

This book describes scripts that you can modify and use to build the Java Wireless Client software. These scripts are available for your use in the docs/build-scripts directory.


Directory Structure

The top level of the Java Wireless Client software contains javacall, pcsl, and cldc directories that correspond to the JavaCall API, PCSL, and CLDC parts of the stack. The source code and makefiles for each layer are contained in the corresponding directory.

The rest of the Java Wireless Client software stack, MIDP and optional APIs, is contained in the rest of the top level directories. For example, midp contains the source files and makefiles for the MIDP APIs. The jsr135 directory contains the source code for JSR 135 Mobile Media API, and so on.

The Java Wireless Client software build is driven by the makefiles in midp. By setting flags for the build system, you can include source code for optional APIs in the Java Wireless Client software build.


Tools

The exact set of tools that you need to build the Java Wireless Client software depends upon your target platform and the optional APIs that you plan to include.

In general, however, you need the following:

1. GNU Make

2. UNIX® system-style tools

3. A C/C++ compiler

4. The Java Platform, Standard Edition (Java SE platform) Development Kit (JDKtrademark) version 1.4.2 (not 1.5.x)

Consult the Release Notes for more specific information and recommendations for tool versions.

Upcoming chapters will discuss how to set up and verify your tools for specific types of builds.


Environment Variables and Build Options

Always specify build options on the make command line. In some cases, it is possible to use environment variables to supply values to the build system, but it is a bad idea.

For example, suppose you did something like this:

export SOME_OPTION=true
make

If SOME_OPTION has no definition in the build system, the environment variable's value is used. On the other hand, if SOME_OPTION is defined with a default value in the build system, the value of the environment variable is ignored.

Mechanisms that work some times and not other times only lead to pain and frustration.

Instead, define all build options on the make command line, like this:

make SOME_OPTION=true

This always works as you expect.