CDC Build System Guide
Total Page:16
File Type:pdf, Size:1020Kb
CDC Build System Guide Java™ Platform, Micro Edition Connected Device Configuration, Version 1.1.2 Foundation Profile, Version 1.1.2 Optimized Implementation Sun Microsystems, Inc. www.sun.com December 2008 Copyright © 2008 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved. Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product that is described in this document. In particular, and without limitation, these intellectual property rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or more additional patents or pending patent applications in the U.S. and in other countries. U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. This distribution may include materials developed by third parties. Parts of the product may be derived from Berkeley BSD systems, licensed from the University of California. UNIX is a registered trademark in the U.S. and in other countries, exclusively licensed through X/Open Company, Ltd. Sun, Sun Microsystems, the Sun logo, Java, Solaris and HotSpot are trademarks or registered trademarks of Sun Microsystems, Inc. or its subsidiaries in the United States and other countries. The Adobe logo is a registered trademark of Adobe Systems, Incorporated. Products covered by and information contained in this service manual are controlled by U.S. Export Control laws and may be subject to the export or import laws in other countries. Nuclear, missile, chemical biological weapons or nuclear maritime end uses or end users, whether direct or indirect, are strictly prohibited. Export or reexport to countries subject to U.S. embargo or to entities identified on U.S. export exclusion lists, including, but not limited to, the denied persons and specially designated nationals lists is strictly prohibited. DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. Copyright © 2008 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, États-Unis. Tous droits réservés. Sun Microsystems, Inc. détient les droits de propriété intellectuelle relatifs à la technologie incorporée dans le produit qui est décrit dans ce document. En particulier, et ce sans limitation, ces droits de propriété intellectuelle peuvent inclure un ou plusieurs des brevets américains listés à l’adresse suivante: http://www.sun.com/patents et un ou plusieurs brevets supplémentaires ou les applications de brevet en attente aux États - Unis et dans les autres pays. Droits du gouvernement des États-Unis ? Logiciel Commercial. Les droits des utilisateur du gouvernement des États-Unis sont soumis aux termes de la licence standard Sun Microsystems et aux conditions appliquées de la FAR et de ces compléments. Cette distribution peut inclure des éléments développés par des tiers. Des parties de ce produit pourront être dérivées des systèmes Berkeley BSD licenciés par l’Université de Californie. UNIX est une marque déposée aux États-Unis et dans d’autres pays et licenciée exclusivement par X/Open Company, Ltd. Sun, Sun Microsystems, le logo Sun, Java, Solaris et HotSpot sont des marques de fabrique ou des marques déposées enregistrées de Sun Microsystems, Inc. ou ses filiales aux États-Unis et dans d’autres pays. Le logo Adobe est une marque déposée de Adobe Systems, Incorporated. Les produits qui font l’objet de ce manuel d’entretien et les informations qu’il contient sont regis par la legislation americaine en matière de contrôle des exportations et peuvent être soumis au droit d’autres pays dans le domaine des exportations et importations. Les utilisations finales, ou utilisateurs finaux, pour des armes nucleaires, des missiles, des armes biologiques et chimiques ou du nucleaire maritime, directement ou indirectement, sont strictement interdites. Les exportations ou reexportations vers des pays sous embargo des États-Unis, ou vers des entites figurant sur les listes d’exclusion d’exportation americaines, y compris, mais de maniere non exclusive, la liste de personnes qui font objet d’un ordre de ne pas participer, d’une façon directe ou indirecte, aux exportations des produits ou des services qui sont regi par la legislation americaine sur le contrôle des exportations et la liste de ressortissants specifiquement designes, sont rigoureusement interdites. LA DOCUMENTATION EST FOURNIE "EN L’ÉTAT" ET TOUTES AUTRES CONDITIONS, DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT EXCLUES, DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS NOTAMMENT TOUTE GARANTIE IMPLICITE RELATIVE À LA QUALITE MARCHANDE, À L’APTITUDE À UNE UTILISATION PARTICULIERE OU À L’ÀBSENCE DE CONTREFAÇON. Contents Preface xi 1. Introduction 1–1 1.1 Host Development Environment 1–2 1.2 Target Platforms 1–2 1.3 Build Options 1–2 1.4 Java ME Standard API Choices 1–3 1.5 Application Development 1–3 1.6 CDC Build Process Overview 1–4 2. Installation 2–1 2.1 Host Development System Requirements 2–1 2.2 Build Tools 2–2 2.2.1 Host Build Tools 2–3 2.2.2 Java Build Tools 2–3 2.2.3 Target Build Tools 2–4 2.3 Build System Setup Examples 2–6 3. Build System Layout 3–1 3.1 Relationship to the phoneME Open Source Project 3–1 3.2 cdc Component 3–2 iii 3.2.1 build Directory Structure 3–3 3.2.2 Makefile Hierarchy 3–3 3.3 secop Component 3–4 3.4 Generated Files for the CDC Java Runtime Environment 3–5 3.4.1 Development Files 3–5 3.4.2 Test and Demo Programs 3–5 3.4.3 Other Generated Files 3–6 4. Build System Procedures 4–1 4.1 The Build Cycle 4–1 4.1.1 Performing a Test Build 4–1 4.1.2 Selecting a Target Device 4–2 4.1.3 Standard API Choices: Profiles and Optional Packages 4–2 4.1.4 Selecting Testing and Performance Features 4–3 4.1.5 Quick Rebuilds 4–3 4.1.6 Generating Verbose Build Logs 4–4 4.1.7 Creating a Runtime Bundle 4–4 4.1.8 Testing the Build 4–5 4.2 JVMTI Support 4–5 4.3 Building a Development Version of the CDC Java Class Library 4–6 4.4 Preloading Java Class Files with JavaCodeCompact 4–7 4.4.1 Linking Java Programs 4–8 4.4.2 Lazy Linking Support 4–8 4.4.3 Preloaded Builds 4–9 4.4.4 Adding Classes to Preloaded Builds 4–10 A. Build Option Reference A–1 A.1 Build Option Categories A–1 A.2 Guidelines for Overriding Build Options A–2 iv CDC Build System Guide • December 2008 A.3 Build Option Descriptions A–2 A.3.1 Supported Build Options A–3 A.3.2 Limited Support Build Options A–6 B. JavaCodeCompact Reference B–1 B.1 Description B–1 B.2 Options B–2 B.3 Opcode Transformations B–3 B.4 Output B–4 5. Legacy JVMPI Support C–1 Contents v vi CDC Build System Guide • December 2008 Figures FIGURE 1-1 CDC Build System 1–4 vii viii CDC Build System Guide • December 2008 Tables TABLE 1-1 Standard Java ME API Features 1–3 TABLE 2-1 Linux PC Host Requirements 2–2 TABLE 2-2 Host Build Tool Macros 2–3 TABLE 2-3 Java SE Build Tools Macros 2–4 TABLE 2-4 Target Build Tool Macros 2–5 TABLE 3-1 phoneME Source Repository Components 3–1 TABLE 3-2 Commercial Source Repository Components 3–2 TABLE 3-3 build Directory 3–3 TABLE 3-4 CDC Build System Makefiles in build/share 3–4 TABLE 3-5 Generated Development Files 3–5 TABLE 3-6 Test and Demo Files 3–6 TABLE 3-7 Other Generated Files 3–6 TABLE 4-1 CVM_PRELOAD_SET Build Option Flags 4–9 TABLE A-1 Supported Build Options A–3 TABLE A-2 Limited Support Build Options A–6 TABLE A-3 Legacy Build Options A–9 TABLE B-1 JavaCodeCompact Options B–2 ix x CDC Build System Guide • December 2008 Preface This guide describes the build system shared by various implementations of technology based on the Connected Device Configuration (CDC) and its related profiles and optional packages. The CDC build system can generate an executable binary image containing a CDC Java runtime environment. This guide contains task descriptions for installing, configuring, testing and using the CDC build system as well as build option descriptions for controlling functionality, testability and performance features. The companion document CDC Runtime Guide describes how to use a CDC Java runtime environment. It focuses on runtime issues like installation, configuration, testing and running Java™ technology-based application software as well as developer issues like compiling, debugging and profiling. This guide focuses on how to enable these features at build-time. Who Should Read This Guide This guide is intended for software engineers who need to build a CDC Java runtime environment for one of the following purposes: ■ Porting the CDC HotSpot Implementation Java virtual machine. ■ Porting one of the CDC profile class libraries. ■ Testing a CDC Java runtime environment. ■ Developing applications. ■ System integration. The reader should be familiar with Java and UNIX build tools as well as embedded software development. Before using the CDC build system, it is helpful to spend some time learning how to use a CDC Java runtime environment. See the CDC Runtime Guide for more details.