Contents Previous Next

Chapter   3

Compiler Requirements


In order to be able to compile the KVM codebase, you must have a C compiler capable of compiling ANSI-compliant C files. Your compiler must define the basic C types as shown below in

TABLE 1  –  Basic types
Type
Description
char
An 8-bit quantity. It can be signed or unsigned.
signed char
A signed 8-bit quantity.
unsigned char
An unsigned 8-bit quantity.
short
A signed 16-bit quantity.
unsigned short
An unsigned 16-bit quantity.
int
A signed quantity. It is either 16 or 32 bits.
unsigned int
A unsigned quantity. It is either 16 or 32 bits.
long
A signed 32-bit quantity.
unsigned long
An unsigned 32-bit quantity.
void *
A 32-bit pointer.

Table 1.

If your J2ME configuration or profile supports floating point numbers, your compiler must support the floating point types shown below

TABLE 2  –  Floating point types
Type
Description
float
A 32-bit floating point value.
double
A 64-bit floating point value.

in Table 2.

All KVM implementations support the Java type long.1 It is preferable that your compiler support 64-bit integers; however this is not a requirement. Porting the Java type long is discussed in Chapter 9, "64-bit Support.”

Your compiler must have some means of indicating additional directories to be searched for “includes” of the form:

    #include <filename> 

Our reference implementation has only been tested on machines with 32-bit pointers and that do not require “far” pointers of any sort. We do not know if it will run successfully on platforms with pointers of other sizes.

The codebase has been successfully compiled with the following compilers:

The only non-ANSI C feature in the KVM source code base is its use of 64-bit integer arithmetic. Refer to Chapter 9 for further information on 64-bit support.

1Note that in the Java programming language, the type long is always 64 bits. TABLE 1 assumes that, as in most current C implementations, the type long represents a 32-bit quantity. This document uses the phrase “The Java type long” to refer to the 64-bit meaning.

 


Contents Previous Next KVM Porting Guide
, CLDC 1.1