PhoneMEAdvancedBuildingJDBCandRMI < Mobileandembedded < TWiki

TWiki . Mobileandembedded . PhoneMEAdvancedBuildingJDBCandRMI

How to Build JDBC and RMI Optional Packages

The JDBC and RMI optional packages were originally designed to be overlayed on top of the CDC source tree, and then built using OPT_PKGS=jdbc,rmi. While this mechanism (probably) still works, it is not very desirable when checking out CDC from the svn repository. Having the overlay just clutters the CDC source directory with source files not under svn control. The following instructions can be used for building JDBC and RMI from separate component directories rather than as overlays.

Building JDBC

1. Get the JDBC sources from here.

2. unzip the JDBC sources. The root of the JDBC component will be named <dir>/jdbc_cdc1.0/cdcfoundation. The path to the directory will be set on the make command line using the JDBC_DIR variable. If you want to avoid the need to set JDBC_DIR, then copy this directory to one named jdbc that is located in the same directory as the cdc component.

mv /tmp/jdbc_cdc1.0/cdcfoundation/ $COMPONENTS_DIR/jdbc

3. Add the following to the end of cdc/build/share/defs_op.mk (NOTE: as of revision 5980, the following is already in defs_op.mk, and does not need to be added):

# Include JDBC
ifeq ($(USE_JDBC), true)
ifeq ($(J2ME_CLASSLIB),cdc)
$(error USE_JDBC=true requries at least J2ME_CLASSLIB=foundation)
endif
export JDBC_DIR ?= $(COMPONENTS_DIR)/jdbc
JDBC_DEFS_FILE = $(JDBC_DIR)/build/share/defs_jdbc_pkg.mk
ifeq ($(wildcard $(JDBC_DEFS_FILE)),)
$(error JDBC_DIR must point to a directory containing JDBC sources: $(JDBC_DIR))
endif
# fixup JDBC_PACKAGE_SRCPATH
JDBC_PACKAGE_SRCPATH = \
    $(JDBC_DIR)/src/share/jdbc/classes
include $(JDBC_DEFS_FILE)
endif

4. Now you can build with the following command:

make J2ME_CLASSLIB=foundation USE_JDBC=true JDBC_DIR=$JDBC_DIR

5. Note there is no support for including $JDBC_DIR/build/share/rules_jdbc_pkg.mk. It is only needed for producing javadocs, and building javadocs is no longer supported from the phoneME source tree.

Building RMI

1. Get the RMI sources from here.

2. unzip the RMI sources. Unlike JDBC, the sources do not unzip into a subdirectory, so you'll probably want to do the following:

mkdir rmi
mv rmiop-1_0-src.zip rmi
cd rmi
unzip rmiop-1_0-src.zip

If you do the above, the root of the RMI component will be named <dir>/rmi. The path to the directory will be set on the make command line using the RMI_DIR variable. If you want to avoid the need to set RMI_DIR, then copy this directory to one named rmi that is located in the same directory as the cdc component.

mv /tmp/rmi $COMPONENTS_DIR/rmi

3. Add the following to the end of cdc/build/share/defs_op.mk (NOTE: as of revision 5980, the following is already in defs_op.mk, and does not need to be added):

# Include RMI
ifeq ($(USE_RMI), true)
ifeq ($(J2ME_CLASSLIB),cdc)
$(error USE_RMI=true requries at least J2ME_CLASSLIB=foundation)
endif
export RMI_DIR ?= $(COMPONENTS_DIR)/rmi
RMI_DEFS_FILE = $(RMI_DIR)/build/share/defs_rmi_pkg.mk
ifeq ($(wildcard $(RMI_DEFS_FILE)),)
$(error RMI_DIR must point to a directory containing RMI sources: $(RMI_DIR))
endif
include $(RMI_DEFS_FILE)
# fixup RMI_SRCDIR
RMI_SRCDIR = $(RMI_DIR)/src/share/rmi/classes
endif

4. Now you can build with the following command:

make J2ME_CLASSLIB=foundation USE_RMI=true RMI_DIR=$RMI_DIR

5. Note there is no support for including $RMI_DIR/build/share/rules_rmi_pkg.mk. It is only needed for producing javadocs, and building javadocs is no longer supported from the phoneME source tree.

-- ChrisPlummer - 24 May 2007

----- Revision r9 - 10 Dec 2008 - 17:20:38 - Main.dbsears