java.net: Wiki

The Source for Java Technology Collaboration


 <<O>>  Difference Topic PhoneMEBuilding (33 - 14 Nov 2008 - Main.randomaniac777)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Line: 323 to 323
 

-- Main.michael_heinrichs - 26 Nov 2007

Added:
>
>
If using MR3 then set the environment variable USE_VS2005 to true when building MIDP and the manifest-file will automatically incorporated into the exe-file during build time.

-- Main.randomaniac777 - 14 Nov 2008

 \ No newline at end of file

 <<O>>  Difference Topic PhoneMEBuilding (32 - 04 Jun 2008 - Main.terrencebarr)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Deleted:
<
<
Creation date: 28 Mar 2007
 Updates: -- Main.terrencebarr - 02 Jul 2007
Added:
>
>
IMPORTANT NOTICE
phoneME Feature MR3 will be released very shortly. In MR3 there have been updates to the build process and many of the phoneME components so this page is no longer fully applicable to MR3. As soon as MR3 is released this page will be updated accordingly

-- Main.terrencebarr - 04 Jun 2008

 

Table of Contents


 <<O>>  Difference Topic PhoneMEBuilding (31 - 26 Nov 2007 - Main.michael_heinrichs)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Line: 313 to 313
 -- Main.emil_kvarnhammar - 26 May 2007
Added:
>
>
You can merge the manifest-file and the exe-file with mt.exe. After that, the manifest-file is no longer needed. Works great on Windows Vista, but I have not tried it on Windows XP. This can by applied to any exe-file created for phoneME. The syntax is:

mt.exe -manifest romgen.exe.manifest -outputresource:romgen.exe

-- Main.michael_heinrichs - 26 Nov 2007


 <<O>>  Difference Topic PhoneMEBuilding (30 - 02 Jul 2007 - Main.terrencebarr)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Line: 11 to 11
 
Changed:
<
<
>
>
 

 <<O>>  Difference Topic PhoneMEBuilding (29 - 02 Jul 2007 - Main.terrencebarr)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Creation date: 28 Mar 2007

Added:
>
>
Updates: -- Main.terrencebarr - 02 Jul 2007
 

Table of Contents


 <<O>>  Difference Topic PhoneMEBuilding (28 - 02 Jul 2007 - Main.terrencebarr)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Line: 6 to 6
 

Table of Contents

Changed:
<
<
>
>
 
Line: 14 to 14
 
Changed:
<
<
#Introduction
>
>
 

Introduction

This wiki topic is a place to collect up-to-date information on how to build phoneME Feature. It assumes that you are already familiar with following phoneME documentation and pages:


 <<O>>  Difference Topic PhoneMEBuilding (27 - 02 Jul 2007 - Main.terrencebarr)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Line: 6 to 6
 

Table of Contents

Changed:
<
<
  • [[#BuildIntroduction][Introduction]
>
>
 
Line: 14 to 14
 
Changed:
<
<
>
>
#Introduction
 

Introduction

This wiki topic is a place to collect up-to-date information on how to build phoneME Feature. It assumes that you are already familiar with following phoneME documentation and pages:

Line: 109 to 109
 

Applying Fixes to the Configuration Files

Added:
>
>
Because of the bckwards-incompatible changes in the Microsoft tools described above a couple of fixes to the build configuration files need to be made in order for the build to execute successfully.

 

Fixing javacall

Edit javacall/build/vc/rules.gmk

Line: 142 to 144
 After the CLDC build successfully completes, you may need to copy romgen.exe.manifest from $JVMBuildSpace/cldc/win32_i386/romgen/app to $JVMBuildSpace/win32_i386/cldc/dist/bin. Otherwise romgen.exe may fail during the MIDP build with a message about a missing DLL.
Changed:
<
<
Update: With the latest source base copying romgen.exe.manifest does not seem to be necessary.
>
>
Also possible:

cp $OUTPUT/cldc/win32_i386/romgen/app/romgen.exe.manifest $OUTPUT/cldc/win32_i386/dist/bin

Update: Copying romgen.exe.manifest appears necessary on Windows XP systems but not necessary on Windows 2000.

 Update: The CLDC build failed when I attempted the SJWC JavaCall build. I get the same link error as for MIDP below. I fixed it by adding a line to cldc/build/javacall_i386_vc/javacall_i386_vc.cfg:

 <<O>>  Difference Topic PhoneMEBuilding (26 - 02 Jul 2007 - Main.terrencebarr)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Line: 6 to 6
 

Table of Contents

Changed:
<
<
  • [[#IntroductioN][Introduction]
>
>
  • [[#BuildIntroduction][Introduction]
 
Changed:
<
<
>
>
 
Added:
>
>
 
Changed:
<
<
>
>
 

Introduction

This wiki topic is a place to collect up-to-date information on how to build phoneME Feature. It assumes that you are already familiar with following phoneME documentation and pages:

Line: 105 to 106
  The problem seems to lie with the length of the $OUTPUT path so by setting it individually to something really short such as c:\out the problem is reduced significantly.
Changed:
<
<

Applying Fixes to the Build

>
>

Applying Fixes to the Configuration Files

 

Fixing javacall

Line: 163 to 164
 You will get lots of warnings about method deprecation and an unsupported compiler option /GB, but it should stagger through to the end without errors.
Deleted:
<
<

Running the phoneME executable on a system that has Microsoft Visual Studio installed

Just go to the $OUTPUT/midp/bin/i386 directory and run runMidlet.exe as described in the Getting Started Guide. It should work fine.

 

A Working Setup

Line: 275 to 272
  sh ./build-phoneME.sh
Changed:
<
<
However, if you have not yet updated the build configuration files as described below the build will fail. After fixing up the configuration files the build should run all the way through and result in a completely built phoneME stack located in the $OUTPUT/midp directory.
>
>
If you have fixed up the configuration files according to the previous steps the build should run all the way through and result in a completely built phoneME stack located in the $OUTPUT/midp directory.

Running the resulting phoneME Feature binary on Windows

Running the phoneME executable on a system that has Microsoft Visual Studio installed

Just go to the $OUTPUT/midp/bin/i386 directory and run runMidlet.exe as described in the Getting Started Guide. It should work fine.

 

Running the phoneME executable on a system that does not have Microsoft Visual Studio installed


 <<O>>  Difference Topic PhoneMEBuilding (25 - 02 Jul 2007 - Main.terrencebarr)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Line: 6 to 6
 

Table of Contents

Changed:
<
<
  • [[#Introduction][Introduction]
>
>
  • [[#IntroductioN][Introduction]
 
Added:
>
>
 
Deleted:
<
<
 
Added:
>
>
 
Changed:
<
<
#Introduction
>
>
 

Introduction

This wiki topic is a place to collect up-to-date information on how to build phoneME Feature. It assumes that you are already familiar with following phoneME documentation and pages:

Line: 38 to 39
 
Changed:
<
<

Building on Windows

>
>

Tools Setup on Windows

 In addition to building on Linux phoneME Feature can also be built on Windows. Both Windows 2000 Professional SP4 as well as Windows XP have been successfully used.
Line: 104 to 105
  The problem seems to lie with the length of the $OUTPUT path so by setting it individually to something really short such as c:\out the problem is reduced significantly.
Added:
>
>

Applying Fixes to the Build

Fixing javacall

Edit javacall/build/vc/rules.gmk

In lines 53 and 54, change the compiler flags definition. Add the flags _CRT_SECURE_NO_DEPRECATE and _CRT_NONSTDC_NO_DEPRECATE and change the treat-warnings-as-errors level from /W3 to /W2. It should now look something like this:

LOCAL_CFLAGS_debug = -MDd -Gm -GX -Zi -Od -D_DEBUG -D_MBCS -D_LIB -YX -FD -GZ -W2 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
LOCAL_CFLAGS_nodebug = -MD -GX -O2 -D_MBCS -D_LIB /YX -FD -W2 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE

Fixing PCSL

Edit pcsl/makefiles/share/vc.gmk

In lines 46-50, change the compiler flags definition. Add the flags _CRT_SECURE_NO_DEPRECATE and _CRT_NONSTDC_NO_DEPRECATE and change the treat-warnings-as-errors level from /W3 to /W2. It should now look something like this:

ifeq ($(USE_DEBUG), true)
CFLAGS= /WX /c /W2 -Zi -Od -MDd /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
else
CFLAGS= /WX /c /W2 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
endif

The PCSL build should run fine now.

Fixing CLDC

For CLDC, be sure to set the environment variable USE_VS2005 to true (as done in the build-phoneME.sh above) before starting the build. It takes care of a lot of compiler warnings.

After the CLDC build successfully completes, you may need to copy romgen.exe.manifest from $JVMBuildSpace/cldc/win32_i386/romgen/app to $JVMBuildSpace/win32_i386/cldc/dist/bin. Otherwise romgen.exe may fail during the MIDP build with a message about a missing DLL.

Update: With the latest source base copying romgen.exe.manifest does not seem to be necessary.

Update: The CLDC build failed when I attempted the SJWC JavaCall build. I get the same link error as for MIDP below. I fixed it by adding a line to cldc/build/javacall_i386_vc/javacall_i386_vc.cfg:

LINK_FLAGS+=-nodefaultlib:libcmt.lib

Note: Towards the end of the CLDC build there are still a lot of warning messages around compiler and linker options, such as /GB, /DEBUGTYPE, and multiple defined symbols regarding LIBCMT. The build should complete successfully despite these warnings.

Fixing MIDP

The MIDP link will not work unless you add a flag. Do this by adding the following line to midp/build/win32/Platform.gmk:

LD_FLAGS+=-nodefaultlib:libcmt.lib

After this, the MIDP build should proceed successfully.

You will get lots of warnings about method deprecation and an unsupported compiler option /GB, but it should stagger through to the end without errors.

Running the phoneME executable on a system that has Microsoft Visual Studio installed

Just go to the $OUTPUT/midp/bin/i386 directory and run runMidlet.exe as described in the Getting Started Guide. It should work fine.

 
Changed:
<
<

A Working Setup

>
>

A Working Setup

 
  • cygwin.bat
Line: 142 to 205
 .
Changed:
<
<

Building

>
>

Build Scripts

 phoneME Feature offers a multitude of configuration, build options, and flags to allow you to create binaries to your exact requirements. For detailed information please see the Getting Started Guide for phoneME Feature MR2, and the phoneME Feature MR2 build guide.
Line: 212 to 277
 However, if you have not yet updated the build configuration files as described below the build will fail. After fixing up the configuration files the build should run all the way through and result in a completely built phoneME stack located in the $OUTPUT/midp directory.
Deleted:
<
<

Applying Fixes to the Build

Fixing javacall

Edit javacall/build/vc/rules.gmk

In lines 53 and 54, change the compiler flags definition. Add the flags _CRT_SECURE_NO_DEPRECATE and _CRT_NONSTDC_NO_DEPRECATE and change the treat-warnings-as-errors level from /W3 to /W2. It should now look something like this:

LOCAL_CFLAGS_debug = -MDd -Gm -GX -Zi -Od -D_DEBUG -D_MBCS -D_LIB -YX -FD -GZ -W2 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
LOCAL_CFLAGS_nodebug = -MD -GX -O2 -D_MBCS -D_LIB /YX -FD -W2 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE

Fixing PCSL

Edit pcsl/makefiles/share/vc.gmk

In lines 46-50, change the compiler flags definition. Add the flags _CRT_SECURE_NO_DEPRECATE and _CRT_NONSTDC_NO_DEPRECATE and change the treat-warnings-as-errors level from /W3 to /W2. It should now look something like this:

ifeq ($(USE_DEBUG), true)
CFLAGS= /WX /c /W2 -Zi -Od -MDd /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
else
CFLAGS= /WX /c /W2 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
endif

The PCSL build should run fine now.

Fixing CLDC

For CLDC, be sure to set the environment variable USE_VS2005 to true (as done in the build-phoneME.sh above) before starting the build. It takes care of a lot of compiler warnings.

After the CLDC build successfully completes, you may need to copy romgen.exe.manifest from $JVMBuildSpace/cldc/win32_i386/romgen/app to $JVMBuildSpace/win32_i386/cldc/dist/bin. Otherwise romgen.exe may fail during the MIDP build with a message about a missing DLL.

Update: With the latest source base copying romgen.exe.manifest does not seem to be necessary.

Update: The CLDC build failed when I attempted the SJWC JavaCall build. I get the same link error as for MIDP below. I fixed it by adding a line to cldc/build/javacall_i386_vc/javacall_i386_vc.cfg:

LINK_FLAGS+=-nodefaultlib:libcmt.lib

Note: Towards the end of the CLDC build there are still a lot of warning messages around compiler and linker options, such as /GB, /DEBUGTYPE, and multiple defined symbols regarding LIBCMT. The build should complete successfully despite these warnings.

Fixing MIDP

The MIDP link will not work unless you add a flag. Do this by adding the following line to midp/build/win32/Platform.gmk:

LD_FLAGS+=-nodefaultlib:libcmt.lib

After this, the MIDP build should proceed successfully.

You will get lots of warnings about method deprecation and an unsupported compiler option /GB, but it should stagger through to the end without errors.

Running the phoneME executable on a system that has Microsoft Visual Studio installed

Just go to the $OUTPUT/midp/bin/i386 directory and run runMidlet.exe as described in the Getting Started Guide. It should work fine.

 

Running the phoneME executable on a system that does not have Microsoft Visual Studio installed

Binaries built with Microsoft Visual Studio require dynamic linking of additional libraries which come with Microsoft Visual Studio. On standard Windows installations these libraries may not be present. Here is a blog on the issue:


 <<O>>  Difference Topic PhoneMEBuilding (24 - 02 Jul 2007 - Main.terrencebarr)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Creation date: 28 Mar 2007

Added:
>
>

Table of Contents

#Introduction

 

Introduction

This wiki topic is a place to collect up-to-date information on how to build phoneME Feature. It assumes that you are already familiar with following phoneME documentation and pages:

Line: 18 to 27
 This wiki topic here is meant as additional information to complement the Getting Started Guide and to add late-breaking information, tips, and workarounds when building phoneME Feature.
Added:
>
>
 

Tested phoneME Feature Versions

Currently, these instructions here have been verified using the MR2 b04 build available here:

Line: 28 to 38
 
Added:
>
>
 

Building on Windows

In addition to building on Linux phoneME Feature can also be built on Windows. Both Windows 2000 Professional SP4 as well as Windows XP have been successfully used.

Line: 93 to 104
  The problem seems to lie with the length of the $OUTPUT path so by setting it individually to something really short such as c:\out the problem is reduced significantly.
Added:
>
>
 

A Working Setup

  • cygwin.bat
Line: 200 to 212
 However, if you have not yet updated the build configuration files as described below the build will fail. After fixing up the configuration files the build should run all the way through and result in a completely built phoneME stack located in the $OUTPUT/midp directory.
Added:
>
>

Applying Fixes to the Build

 

Fixing javacall

Edit javacall/build/vc/rules.gmk


 <<O>>  Difference Topic PhoneMEBuilding (23 - 26 May 2007 - Main.emil_kvarnhammar)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Line: 278 to 278
 -- Main.terrencebarr - 26 Apr 2007
Added:
>
>
Windows Platform SDK is required when building the source code. It can be downloaded and installed from Microsoft's website: Windows Platform SDK

-- Main.emil_kvarnhammar - 26 May 2007


 <<O>>  Difference Topic PhoneMEBuilding (22 - 26 Apr 2007 - Main.terrencebarr)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Line: 26 to 26
 as well as
Changed:
<
<
  • The MR2 b13 as well as b20 build available via the subversion repository (latest available version as of 28 Mar 2007)
>
>
 

Building on Windows


 <<O>>  Difference Topic PhoneMEBuilding (21 - 26 Apr 2007 - Main.terrencebarr)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Line: 26 to 26
 as well as
Changed:
<
<
>
>
  • The MR2 b13 as well as b20 build available via the subversion repository (latest available version as of 28 Mar 2007)
 

Building on Windows


 <<O>>  Difference Topic PhoneMEBuilding (20 - 26 Apr 2007 - Main.terrencebarr)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Line: 136 to 136
 Here are example build-phoneME.sh scripts for selected configurations:
Changed:
<
<
  • Example 1
>
>
Example 1
 phoneME Feature MR2 with CLDC + MIDP, not using javacall, and without debug support. This is the most basic build configuration.
Line: 161 to 161
 MIDP_OUTPUT_DIR=$OUTPUT/midp
Changed:
<
<
  • Example 2
>
>
Example 2
 
Changed:
<
<
phoneME Feature MR2 with CLDC + MIDP, using javacall, and with debug support enabled. This is a configuration that can be integrated with NetBeans so that you can run and debug MIDlets on phoneME Feature from within NetNeans as an additional emulator platform:
>
>
phoneME Feature MR2 with CLDC + MIDP, using javacall, and with debug support enabled. This is a configuration that can be integrated with NetBeans so that you can run and debug MIDlets on phoneME Feature as an additional emulator platform from within NetNeans:
 
#build-phoneME.sh

 <<O>>  Difference Topic PhoneMEBuilding (19 - 26 Apr 2007 - Main.terrencebarr)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Line: 200 to 200
 However, if you have not yet updated the build configuration files as described below the build will fail. After fixing up the configuration files the build should run all the way through and result in a completely built phoneME stack located in the $OUTPUT/midp directory.
Added:
>
>

Fixing javacall

Edit javacall/build/vc/rules.gmk

In lines 53 and 54, change the compiler flags definition. Add the flags _CRT_SECURE_NO_DEPRECATE and _CRT_NONSTDC_NO_DEPRECATE and change the treat-warnings-as-errors level from /W3 to /W2. It should now look something like this:

LOCAL_CFLAGS_debug = -MDd -Gm -GX -Zi -Od -D_DEBUG -D_MBCS -D_LIB -YX -FD -GZ -W2 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
LOCAL_CFLAGS_nodebug = -MD -GX -O2 -D_MBCS -D_LIB /YX -FD -W2 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
 

Fixing PCSL

Edit pcsl/makefiles/share/vc.gmk


 <<O>>  Difference Topic PhoneMEBuilding (18 - 26 Apr 2007 - Main.terrencebarr)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Line: 132 to 132
 

Building

Changed:
<
<
phoneME Feature offers a multitude of configuration, build options, and flags to allow you to create binaries to your exact requirements. For detailed information please see the Getting Started Guide for phoneME Feature MR2, and the phoneME Feature MR2 build guide.
>
>
phoneME Feature offers a multitude of configuration, build options, and flags to allow you to create binaries to your exact requirements. For detailed information please see the Getting Started Guide for phoneME Feature MR2, and the phoneME Feature MR2 build guide.
 Here are example build-phoneME.sh scripts for selected configurations:
Changed:
<
<
  • Example 1: phoneME Feature MR2 with CLDC + MIDP, not using javacall, and without debug support. This is the most basic build configuration.
>
>
  • Example 1
 
Changed:
<
<
build-phoneME.sh:
>
>
phoneME Feature MR2 with CLDC + MIDP, not using javacall, and without debug support. This is the most basic build configuration.
 
Added:
>
>
#build-phoneME.sh
 export TOP=c:/cygwin/home/work/phoneME_feature_MR2 export OUTPUT=c:/cygwin/out export LOG=$TOP/log.txt
Line: 160 to 161
 MIDP_OUTPUT_DIR=$OUTPUT/midp
Changed:
<
<
  • Example 2: phoneME Feature MR2 with CLDC + MIDP, using javacall, and with debug support enabled. This is a configuration that can be integrated with NetBeans? so that you can run and debug MIDlets on phoneME Feature from within NetNeans? as an additional emulator platform:
>
>
  • Example 2
 
Changed:
<
<
build-phoneME.sh:
>
>
phoneME Feature MR2 with CLDC + MIDP, using javacall, and with debug support enabled. This is a configuration that can be integrated with NetBeans so that you can run and debug MIDlets on phoneME Feature from within NetNeans as an additional emulator platform:
 
Added:
>
>
#build-phoneME.sh
 export TOP=c:/cygwin/home/work/phoneME_feature_MR2 export OUTPUT=c:/cygwin/out export LOG=$TOP/log.txt

 <<O>>  Difference Topic PhoneMEBuilding (17 - 26 Apr 2007 - Main.terrencebarr)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Line: 132 to 132
 

Building

Changed:
<
<
  • A build-phoneME.sh to build phoneME Feature MR2 with CLDC + MIDP, no javacall, and no debugging:
>
>
phoneME Feature offers a multitude of configuration, build options, and flags to allow you to create binaries to your exact requirements. For detailed information please see the Getting Started Guide for phoneME Feature MR2, and the phoneME Feature MR2 build guide.

Here are example build-phoneME.sh scripts for selected configurations:

  • Example 1: phoneME Feature MR2 with CLDC + MIDP, not using javacall, and without debug support. This is the most basic build configuration.

build-phoneME.sh:

 
export TOP=c:/cygwin/home/work/phoneME_feature_MR2
Changed:
<
<
export OUTPUT=$TOP/output
>
>
export OUTPUT=c:/cygwin/out
 export LOG=$TOP/log.txt # make PCSL cd $TOP/pcsl
Line: 154 to 160
 MIDP_OUTPUT_DIR=$OUTPUT/midp
Changed:
<
<
  • A build-phoneME.sh to build phoneME Feature MR2 with CLDC + MIDP, with javacall, and debugging enabled:
>
>
  • Example 2: phoneME Feature MR2 with CLDC + MIDP, using javacall, and with debug support enabled. This is a configuration that can be integrated with NetBeans? so that you can run and debug MIDlets on phoneME Feature from within NetNeans? as an additional emulator platform:

build-phoneME.sh:

 
export TOP=c:/cygwin/home/work/phoneME_feature_MR2
Changed:
<
<
export OUTPUT=$TOP/output
>
>
export OUTPUT=c:/cygwin/out
 export LOG=$TOP/log.txt
Changed:
<
<
# make PCSL cd $TOP/pcsl make ENABLE_PCSL=true PCSL_PLATFORM=win32_i386_vc PCSL_OUTPUT_DIR=$OUTPUT/pcsl # make CLDC cd $TOP/cldc/build/win32_i386 make JDK_DIR=c:/j2sdk1.4.2_13 ENABLE_PCSL=true JVMWorkSpace?=$TOP/cldc JVMBuildSpace?=$OUTPUT/cldc USE_VS2005=true PCSL_OUTPUT_DIR=$OUTPUT/pcsl # make MIDP cd $TOP/midp/build/win32 make JDK_DIR=c:/j2sdk1.4.2_13 TOOLS_DIR=$TOP/tools CLDC_DIST_DIR=$OUTPUT/cldc/win32_i386/dist USE_VS2005=true PCSL_OUTPUT_DIR=$OUTPUT/pcsl MIDP_OUTPUT_DIR=$OUTPUT/midp
>
>
# javacall cd $TOP/javacall/configuration/phoneMEFeature/win32_x86; make USE_DEBUG=true JAVACALL_DIR=$TOP/javacall JAVACALL_OUTPUT_DIR=$OUTPUT/javacall # PCSL cd $TOP/pcsl; make USE_DEBUG=false ENABLE_PCSL=true PCSL_PLATFORM=javacall_i386_vc JAVACALL_OUTPUT_DIR=$OUTPUT/javacall PCSL_OUTPUT_DIR=$OUTPUT/pcsl # CLDC cd $TOP/cldc/build/javacall_i386_vc; make JDK_DIR=c:/j2sdk1.4.2_13 ENABLE_PCSL=true PCSL_PLATFORM=javacall_i386_vc PCSL_OUTPUT_DIR=$OUTPUT/pcsl JAVACALL_OUTPUT_DIR=$OUTPUT/javacall JVMWorkSpace?=$TOP/cldc JVMBuildSpace?=$OUTPUT/cldc USE_VS2005=true ENABLE_ISOLATES=true ENABLE_JAVA_DEBUGGER=true ENABLE_SYSTEM_CLASSES_DEBUG=true ENABLE_ROM_JAVA_DEBUGGER=true USE_DEBUG=true # MIDP cd $TOP/midp/build/javacall; make JDK_DIR=c:/j2sdk1.4.2_13 TOOLS_DIR=$TOP/tools CLDC_DIST_DIR=$OUTPUT/cldc/javacall_i386_vc/dist JAVACALL_PLATFORM=win32_i386_vc JAVACALL_OUTPUT_DIR=$OUTPUT/javacall PCSL_OUTPUT_DIR=$OUTPUT/pcsl MIDP_OUTPUT_DIR=$OUTPUT/midp USE_VS2005=true USE_MULTIPLE_ISOLATES=true USE_DEBUG=true USE_JAVA_DEBUGGER=true
 

You can start a complete MIDP build with:


 <<O>>  Difference Topic PhoneMEBuilding (16 - 26 Apr 2007 - Main.terrencebarr)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Line: 65 to 65
 
  • Be very careful with paths within cyg4me and shells you run within cyg4me. There seems to be various flaky behavior around paths, e.g. _path_ vs. c:/cygwin/_path_ vs. \cygwin\_path_ vs. /cygdrive/c/_path_ should all be the same but depending on the stage of the build and the tools used they seem to be evaluated differently by different tools resulting in puzzling build failures. A source of much fiddling and irritation. Make sure you enter all paths as described below.
  • Also, don't use shell environment variables except for a variable for the top of your source tree. Pass all variables to make on the command line directly.
Changed:
<
<
  • Your executable path in cyg4me bash should look like this: j2sdk1.4.2_13/bin, followed by cyg4me/bin, followed by the stuff defined by Visual C++ vsvargs32.bat
>
>
  • Your executable path in cyg4me bash should look like this: j2sdk1.4.2_13/bin, followed by cyg4me/bin, followed by the stuff defined by Visual C++ vsvargs32.bat
 
  • Make sure j2sdk1.4.2_13/bin is in your excutable path and check the correct version by running java -version from the comand line. Also, pass in JDK_DIR seperately on the make command line. Dropping either will result in failures.
  • Finally, sometimes the phoneME Windows build will fail with a STATUS_ACCESS_VIOLATION something like this:
Line: 79 to 79
 This seems to be cause by some bug in cyg4me with handling paths. In particular, the sh.exe program crashes and the build fails. The workaround is to shorten or lengthen the path of your phoneME Feature source tree root. Try the following: delete the build output directory, move the source tree to some other directory, and re-run the build. This bug can be very frustrating and it might take several tries to avoid it.
Added:
>
>
Update on STATUS_ACESS_VIOLATION:

I have been able to mostly avoid this problem now by doing the following. Instead of:

   $TOP=<_path_>
   $OUTPUT=$TOP/output
I use
   $TOP=<_path_>
   $OUTPUT=<_short_path_>
The problem seems to lie with the length of the $OUTPUT path so by setting it individually to something really short such as c:\out the problem is reduced significantly.
 

A Working Setup

  • cygwin.bat
Line: 116 to 130
 .
Changed:
<
<
  • build-phoneME.sh
>
>

Building

  • A build-phoneME.sh to build phoneME Feature MR2 with CLDC + MIDP, no javacall, and no debugging:
 
export TOP=c:/cygwin/home/work/phoneME_feature_MR2
Line: 138 to 154
 MIDP_OUTPUT_DIR=$OUTPUT/midp
Changed:
<
<

Building

>
>
  • A build-phoneME.sh to build phoneME Feature MR2 with CLDC + MIDP, with javacall, and debugging enabled:

export TOP=c:/cygwin/home/work/phoneME_feature_MR2
export OUTPUT=$TOP/output
export LOG=$TOP/log.txt
# make PCSL
cd $TOP/pcsl
make ENABLE_PCSL=true PCSL_PLATFORM=win32_i386_vc PCSL_OUTPUT_DIR=$OUTPUT/pcsl 
# make CLDC
cd $TOP/cldc/build/win32_i386
make JDK_DIR=c:/j2sdk1.4.2_13 ENABLE_PCSL=true \
JVMWorkSpace=$TOP/cldc JVMBuildSpace=$OUTPUT/cldc \
USE_VS2005=true PCSL_OUTPUT_DIR=$OUTPUT/pcsl 
# make MIDP
cd $TOP/midp/build/win32
make JDK_DIR=c:/j2sdk1.4.2_13 TOOLS_DIR=$TOP/tools \
CLDC_DIST_DIR=$OUTPUT/cldc/win32_i386/dist \
USE_VS2005=true PCSL_OUTPUT_DIR=$OUTPUT/pcsl \
MIDP_OUTPUT_DIR=$OUTPUT/midp
 You can start a complete MIDP build with:
Line: 170 to 206
 After the CLDC build successfully completes, you may need to copy romgen.exe.manifest from $JVMBuildSpace/cldc/win32_i386/romgen/app to $JVMBuildSpace/win32_i386/cldc/dist/bin. Otherwise romgen.exe may fail during the MIDP build with a message about a missing DLL.
Changed:
<
<
Update: With the latest source base copying romgen.exe.manifest does not seem to be necessary.
>
>
Update: With the latest source base copying romgen.exe.manifest does not seem to be necessary.
 
Changed:
<
<
Update: The CLDC build failed when I attempted the SJWC JavaCall build. I get the same link error as for MIDP below. I fixed it by adding a line to cldc/build/javacall_i386_vc/javacall_i386_vc.cfg:
>
>
Update: The CLDC build failed when I attempted the SJWC JavaCall build. I get the same link error as for MIDP below. I fixed it by adding a line to cldc/build/javacall_i386_vc/javacall_i386_vc.cfg:
 
LINK_FLAGS+=-nodefaultlib:libcmt.lib
Line: 206 to 242
 
Changed:
<
<
-- Main.terrencebarr - 30 Mar 2007
>
>
Update:

There appears to be an incompatibility in the Windows DLL mechanism for certain system DLLs between Windows 2000 and Windows XP.

  • If you build phoneME Feature as above on a Windows 2000 system the resulting phoneME binary will work fine on another WIndows 2000 system. However, if will likely not work on a Windows XP system because of the way the Windows XP DLL loading mechanism works (at least, that is my current understanding).
  • If you build phoneME Feature on a Windows XP machine the resulting phoneME binary appears to run fine on other WIndows XP systems as well as Windows 2000 systems.

-- Main.terrencebarr - 26 Apr 2007

 

 <<O>>  Difference Topic PhoneMEBuilding (15 - 30 Mar 2007 - Main.terrencebarr)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Line: 196 to 196
 Just go to the $OUTPUT/midp/bin/i386 directory and run runMidlet.exe as described in the Getting Started Guide. It should work fine.
Changed:
<
<

Running the phoneME executable on Windows systems that do not have Microsoft Visual Studio installed

>
>

Running the phoneME executable on a system that does not have Microsoft Visual Studio installed

 Binaries built with Microsoft Visual Studio require dynamic linking of additional libraries which come with Microsoft Visual Studio. On standard Windows installations these libraries may not be present. Here is a blog on the issue:

 <<O>>  Difference Topic PhoneMEBuilding (14 - 30 Mar 2007 - Main.terrencebarr)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Line: 168 to 168
 For CLDC, be sure to set the environment variable USE_VS2005 to true (as done in the build-phoneME.sh above) before starting the build. It takes care of a lot of compiler warnings.
Changed:
<
<
After the CLDC build successfully completes, you may need to copy romgen.exe.manifest from $JVMBuildSpace/cldc/win32_i386/romgen/app to $JVMBuildSpace/win32_i386/cldc/dist/bin. Otherwise romgen.exe will fail during the MIDP build with a message about a missing DLL.
>
>
After the CLDC build successfully completes, you may need to copy romgen.exe.manifest from $JVMBuildSpace/cldc/win32_i386/romgen/app to $JVMBuildSpace/win32_i386/cldc/dist/bin. Otherwise romgen.exe may fail during the MIDP build with a message about a missing DLL.
 
Changed:
<
<
However, with the latest source bases this does not seem to be necessary.
>
>
Update: With the latest source base copying romgen.exe.manifest does not seem to be necessary.
 Update: The CLDC build failed when I attempted the SJWC JavaCall build. I get the same link error as for MIDP below. I fixed it by adding a line to cldc/build/javacall_i386_vc/javacall_i386_vc.cfg:
Line: 192 to 192
 You will get lots of warnings about method deprecation and an unsupported compiler option /GB, but it should stagger through to the end without errors.
Changed:
<
<
--+++ Running the phoneME executable on a system that has Microsoft Visual Studio installed
>
>

Running the phoneME executable on a system that has Microsoft Visual Studio installed

 
Changed:
<
<
Just go to the $OUTPUT/midp directory and run runMidlet.exe as described in the Getting Started Guide. It should work fine.
>
>
Just go to the $OUTPUT/midp/bin/i386 directory and run runMidlet.exe as described in the Getting Started Guide. It should work fine.
 
Changed:
<
<
--+++ Running the phoneME executable on Windows systems that do not have Microsoft Visual Studio installed
>
>

Running the phoneME executable on Windows systems that do not have Microsoft Visual Studio installed

 Binaries built with Microsoft Visual Studio require dynamic linking of additional libraries which come with Microsoft Visual Studio. On standard Windows installations these libraries may not be present. Here is a blog on the issue:

 <<O>>  Difference Topic PhoneMEBuilding (13 - 30 Mar 2007 - Main.terrencebarr)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Line: 127 to 127
 make ENABLE_PCSL=true PCSL_PLATFORM=win32_i386_vc PCSL_OUTPUT_DIR=$OUTPUT/pcsl # make CLDC cd $TOP/cldc/build/win32_i386
Changed:
<
<
make JDK_DIR=c:/j2sdk1.4.2_13 ENABLE_PCSL=true JVMWorkSpace?=$TOP/cldc JVMBuildSpace?=$OUTPUT/cldc USE_VS2005=true PCSL_OUTPUT_DIR=$OUTPUT/pcsl
>
>
make JDK_DIR=c:/j2sdk1.4.2_13 ENABLE_PCSL=true JVMWorkSpace?=$TOP/cldc JVMBuildSpace?=$OUTPUT/cldc USE_VS2005=true PCSL_OUTPUT_DIR=$OUTPUT/pcsl
 # make MIDP cd $TOP/midp/build/win32
Changed:
<
<
make JDK_DIR=c:/j2sdk1.4.2_13 TOOLS_DIR=$TOP/tools CLDC_DIST_DIR=$OUTPUT/cldc/win32_i386/dist USE_VS2005=true PCSL_OUTPUT_DIR=$OUTPUT/pcsl MIDP_OUTPUT_DIR=$OUTPUT/midp
>
>
make JDK_DIR=c:/j2sdk1.4.2_13 TOOLS_DIR=$TOP/tools CLDC_DIST_DIR=$OUTPUT/cldc/win32_i386/dist USE_VS2005=true PCSL_OUTPUT_DIR=$OUTPUT/pcsl MIDP_OUTPUT_DIR=$OUTPUT/midp
 
Changed:
<
<

Running the build

>
>

Building

 You can start a complete MIDP build with:
Line: 141 to 146
  sh ./build-phoneME.sh
Changed:
<
<
However, if you have not yet updated the build configuration files as described below the build will fail. After fixing up the configuration files the build should run all the way through and result in a completely built phoneME stack located in the $OUTPUT/midp directory.
>
>
However, if you have not yet updated the build configuration files as described below the build will fail. After fixing up the configuration files the build should run all the way through and result in a completely built phoneME stack located in the $OUTPUT/midp directory.
 
Changed:
<
<

Building PCSL

>
>

Fixing PCSL

 Edit pcsl/makefiles/share/vc.gmk
Line: 159 to 164
 The PCSL build should run fine now.
Changed:
<
<

Building CLDC

>
>

Fixing CLDC

 For CLDC, be sure to set the environment variable USE_VS2005 to true (as done in the build-phoneME.sh above) before starting the build. It takes care of a lot of compiler warnings.
Line: 175 to 180
 Note: Towards the end of the CLDC build there are still a lot of warning messages around compiler and linker options, such as /GB, /DEBUGTYPE, and multiple defined symbols regarding LIBCMT. The build should complete successfully despite these warnings.
Changed:
<
<

Building MIDP

>
>

Fixing MIDP

 The MIDP link will not work unless you add a flag. Do this by adding the following line to midp/build/win32/Platform.gmk:

 <<O>>  Difference Topic PhoneMEBuilding (12 - 30 Mar 2007 - Main.terrencebarr)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Line: 77 to 77
 
make
*
Changed:
<
<
This seems to be cause by some bug in cyg4me with handling paths. In particular, the sh.exe program crashes and the build fails. The workaround is to shorten or lengthen the path of your phoneME Feature source tree root. Try moving the source tree to some other directory, delete the build output directory, and try re-running the build. This bug can be very frustrating and it might take several tries to avoid it.
>
>
This seems to be cause by some bug in cyg4me with handling paths. In particular, the sh.exe program crashes and the build fails. The workaround is to shorten or lengthen the path of your phoneME Feature source tree root. Try the following: delete the build output directory, move the source tree to some other directory, and re-run the build. This bug can be very frustrating and it might take several tries to avoid it.
 

A Working Setup

Changed:
<
<
  • cygwin.bat
>
>
  • cygwin.bat
 
@echo off
Line: 91 to 91
 bash --login -i
Changed:
<
<
  • .bash_profile
>
>
  • .bash_profile
 
export JDK_DIR=/cygdrive/c/j2sdk1.4.2_13
PATH=$JDK_DIR/bin:$PATH:.
Changed:
<
<
  • Resulting cygwin bash shell $PATH
>
>
  • Resulting bash shell $PATH
 
/cygdrive/c/j2sdk1.4.2_13/bin:
Line: 112 to 112
 /cygdrive/c/WINNT/Microsoft.NET/Framework/v2.0.50727: /cygdrive/c/Program Files/Microsoft Visual Studio 8/VC/VCPackages: /cygdrive/c/cyg4me/bin:/cygdrive/c/WINNT/system32:/cygdrive/c/WINNT:
Changed:
<
<
/cygdrive/c/WINNT/System32/Wbem:.
>
>
/cygdrive/c/WINNT/System32/Wbem: .
 
Changed:
<
<
  • build-phoneME.sh
>
>
  • build-phoneME.sh
 
export TOP=c:/cygwin/home/work/phoneME_feature_MR2

 <<O>>  Difference Topic PhoneMEBuilding (11 - 30 Mar 2007 - Main.terrencebarr)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Line: 65 to 65
 
  • Be very careful with paths within cyg4me and shells you run within cyg4me. There seems to be various flaky behavior around paths, e.g. _path_ vs. c:/cygwin/_path_ vs. \cygwin\_path_ vs. /cygdrive/c/_path_ should all be the same but depending on the stage of the build and the tools used they seem to be evaluated differently by different tools resulting in puzzling build failures. A source of much fiddling and irritation. Make sure you enter all paths as described below.
  • Also, don't use shell environment variables except for a variable for the top of your source tree. Pass all variables to make on the command line directly.
Changed:
<
<
  • Your executable path in cyg4me bash should look like this: j2sdk1.4.2_13/bin, followed by cyg4me/bin, followed by the stuff defined by Visual C++ vsvargs32.bat.
  • Make sure j2sdk1.4.2_13/bin is in your excutable path and check the correct version by running "java -version" from the comand line. Also, pass in JDK_DIR seperately on the make command line. Dropping either will result in failures.
  • Finally, sometimes the phoneME Windows build will fail with a STATUS_ACCESS_VIOLATION something like this:
>
>
  • Your executable path in cyg4me bash should look like this: j2sdk1.4.2_13/bin, followed by cyg4me/bin, followed by the stuff defined by Visual C++ vsvargs32.bat
  • Make sure j2sdk1.4.2_13/bin is in your excutable path and check the correct version by running java -version from the comand line. Also, pass in JDK_DIR seperately on the make command line. Dropping either will result in failures.
  • Finally, sometimes the phoneME Windows build will fail with a STATUS_ACCESS_VIOLATION something like this:
 
         4 [main] sh 1560 handle_exceptions: Exception: 

 <<O>>  Difference Topic PhoneMEBuilding (10 - 30 Mar 2007 - Main.terrencebarr)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Line: 42 to 42
 You have two choices of Microsoft Visual Studio:
Changed:
<
<
  • Visual C++ Express (no cost) and install the missing ml.exe MASM from here MASM tool
>
>
  • Visual Studio C++ Express (no cost) and install the missing ml.exe MASM from here MASM tool
 
  • Or use Visual Studio 2005 Professional or above

NOTE: Visual Studio Standard does not include the ml.exe MASM program and I have not found any way to add it (the MASM for Visual C++ Express refuses installation onto Visual Studio Standard and manually copying ml.exe doesn't work)

Changed:
<
<
The compiler in Visual Studio 2005 has significant differences from the one the phoneME Feature engineering team is currently using. As explained above these difference require several small modifications to the build configuration files:
>
>
The compiler in Visual Studio 2005 has backward-incompatible changes from the one the phoneME Feature engineering team has been using. As explained above these difference require several small modifications to the build configuration files:
 
  • Standard library functions like strcpy() are now deprecated in favor of versions that accept array lengths and check for array overruns.
  • Executables are now generated in a new way so that an executable has an associated manifest that describes its DLL dependencies. This may cause trouble with romgen.exe
Line: 61 to 61
 For use with phoneME Feature the Sun engineering team has created a purpose-built version called cyg4me. It is highly recommended to use cyg4me instead of cygwin (cygwin will seems to work initially but cause you trouble later). Download cyg4me here.

Changed:
<
<
However, even cyg4me has its share of problems which it inherits from cygwin. In particular, it is unreliable and inconsistent in it's handling of paths:
>
>
However, even cyg4me has its share of problems which it inherits from cygwin. In particular, it is unreliable and inconsistent in it's handling of paths:
 
Changed:
<
<
  • Be very careful with paths within cyg4me and shells your run within cyg4me. There seems to be various flaky behavior around paths, e.g. "_path_" vs. "c:/cygwin/_path_" vs. "\cygwin\_path_" vs. "/cygdrive/c/_path_" should all be the same but depending on the stage of the build and the tools used they seem to be evaluated differently by different tools! A source of much fiddling and irritation. Make sure you enter all paths as described below other wise you will end up with mysterious build failures.
>
>
  • Be very careful with paths within cyg4me and shells you run within cyg4me. There seems to be various flaky behavior around paths, e.g. _path_ vs. c:/cygwin/_path_ vs. \cygwin\_path_ vs. /cygdrive/c/_path_ should all be the same but depending on the stage of the build and the tools used they seem to be evaluated differently by different tools resulting in puzzling build failures. A source of much fiddling and irritation. Make sure you enter all paths as described below.
 
  • Also, don't use shell environment variables except for a variable for the top of your source tree. Pass all variables to make on the command line directly.
  • Your executable path in cyg4me bash should look like this: j2sdk1.4.2_13/bin, followed by cyg4me/bin, followed by the stuff defined by Visual C++ vsvargs32.bat.
  • Make sure j2sdk1.4.2_13/bin is in your excutable path and check the correct version by running "java -version" from the comand line. Also, pass in JDK_DIR seperately on the make command line. Dropping either will result in failures.

 <<O>>  Difference Topic PhoneMEBuilding (9 - 30 Mar 2007 - Main.terrencebarr)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Line: 36 to 36
 Unfortunately, Microsoft has made backwards-incompatible changes to the C/C++ compiler and linker so that the attempt to build the phoneME Feature sources "out-of-the-box" will fail. The phoneME sources and build system have not yet been updated fully to support Visual Studio 2005 so you will need to make a few small modifications to some build configuration files to build successfully.
Changed:
<
<
Also, the phoneME build system requires various UNIX utilities such as make and sh. Therefore, a package that provides these UNIX utilities on Windows must be used. cygwin is an open source project that provides such UNIX utilities. However, cygwin has it's share of bugs and is somewhat tricky to deal with so we'll describe possible problems and workarounds here as well.
>
>
Also, the phoneME build system requires various UNIX utilities such as make and sh. Therefore, a package that provides these UNIX utilities on Windows must be used. cygwin is an open source project that provides such UNIX utilities. However, cygwin has it's share of bugs and is somewhat tricky to deal with so we'll describe possible problems and workarounds here as well.
 

Microsoft Visual Studio 2005 Issues


 <<O>>  Difference Topic PhoneMEBuilding (8 - 30 Mar 2007 - Main.terrencebarr)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Line: 12 to 12
 
Changed:
<
<
In particular, please review the Getting Started Guide:
>
>
In particular, a thorough explanation of the steps required to build phoneME feature are located in the Getting Started Guide:
 
Line: 26 to 26
 as well as
Changed:
<
<
  • The MR2 b13 build available via the subversion repository (latest available version as of 28 Mar 2007)
>
>
 

Building on Windows

Line: 132 to 132
 make JDK_DIR=c:/j2sdk1.4.2_13 TOOLS_DIR=$TOP/tools CLDC_DIST_DIR=$OUTPUT/cldc/win32_i386/dist USE_VS2005=true PCSL_OUTPUT_DIR=$OUTPUT/pcsl MIDP_OUTPUT_DIR=$OUTPUT/midp
Changed:
<
<

Building PCSL

>
>

Running the build

 
Changed:
<
<
Edit pcsl/makefiles/share/vc.gmk.
>
>
You can start a complete MIDP build with:
 
Changed:
<
<
In lines 46-50, change the compiler flags definition. Add the flags _CRT_SECURE_NO_DEPRECATE and _CRT_NONSTDC_NO_DEPRECATE and change the treat-warnings-as-errors level from /W3 to /W2. This is what mine looks like when I'm done:
>
>
   sh ./build-phoneME.sh

However, if you have not yet updated the build configuration files as described below the build will fail. After fixing up the configuration files the build should run all the way through and result in a completely built phoneME stack located in the $OUTPUT/midp directory.

Building PCSL

Edit pcsl/makefiles/share/vc.gmk

In lines 46-50, change the compiler flags definition. Add the flags _CRT_SECURE_NO_DEPRECATE and _CRT_NONSTDC_NO_DEPRECATE and change the treat-warnings-as-errors level from /W3 to /W2. It should now look something like this:

 
ifeq ($(USE_DEBUG), true)
Line: 148 to 158
 The PCSL build should run fine now.
Changed:
<
<

Building CLDC

>
>

Building CLDC

 
Changed:
<
<
For CLDC, set the environment variable USE_VS2005 to true before starting the build. It takes care of a lot of compiler warnings.
>
>
For CLDC, be sure to set the environment variable USE_VS2005 to true (as done in the build-phoneME.sh above) before starting the build. It takes care of a lot of compiler warnings.
 
Changed:
<
<
After the CLDC build successfully completes, make sure to copy romgen.exe.manifest from $JVMBuildSpace/cldc/win32_i386/romgen/app to $JVMBuildSpace/win32_i386/cldc/dist/bin. Otherwise romgen.exe will fail during the MIDP build with a message about a missing DLL.
>
>
After the CLDC build successfully completes, you may need to copy romgen.exe.manifest from $JVMBuildSpace/cldc/win32_i386/romgen/app to $JVMBuildSpace/win32_i386/cldc/dist/bin. Otherwise romgen.exe will fail during the MIDP build with a message about a missing DLL.
 
Changed:
<
<
Update to the above: I have not found it necessary to copy romgen.exe.manifest. YMMV
>
>
However, with the latest source bases this does not seem to be necessary.
 Update: The CLDC build failed when I attempted the SJWC JavaCall build. I get the same link error as for MIDP below. I fixed it by adding a line to cldc/build/javacall_i386_vc/javacall_i386_vc.cfg:
Line: 162 to 172
 LINK_FLAGS+=-nodefaultlib:libcmt.lib
Changed:
<
<
Note: Towards the end of the CLDC build there are still a lot of warning messages around compiler and linker options, such as /GB, /DEBUGTYPE, and multiple defined symbols regarding LIBCMT
>
>
Note: Towards the end of the CLDC build there are still a lot of warning messages around compiler and linker options, such as /GB, /DEBUGTYPE, and multiple defined symbols regarding LIBCMT. The build should complete successfully despite these warnings.
 
Changed:
<
<

Building MIDP

>
>

Building MIDP

 The MIDP link will not work unless you add a flag. Do this by adding the following line to midp/build/win32/Platform.gmk:
Line: 172 to 182
 LD_FLAGS+=-nodefaultlib:libcmt.lib
Changed:
<
<
After this, the MIDP (SJWC) build should proceed successfully.
>
>
After this, the MIDP build should proceed successfully.
  You will get lots of warnings about method deprecation and an unsupported compiler option /GB, but it should stagger through to the end without errors.
Changed:
<
<
--++ Running the phoneME executable on other Windows systems
>
>
--+++ Running the phoneME executable on a system that has Microsoft Visual Studio installed

Just go to the $OUTPUT/midp directory and run runMidlet.exe as described in the Getting Started Guide. It should work fine.

--+++ Running the phoneME executable on Windows systems that do not have Microsoft Visual Studio installed

Binaries built with Microsoft Visual Studio require dynamic linking of additional libraries which come with Microsoft Visual Studio. On standard Windows installations these libraries may not be present. Here is a blog on the issue:

One solution is to download and install on the target Windows machine the Microsoft Visual Studio redestributable library package:

 
Changed:
<
<
Running C++ application built by VC++ Express on another computer Visual C++ 2005 Redistributable Package
>
>
-- Main.terrencebarr - 30 Mar 2007
 

 <<O>>  Difference Topic PhoneMEBuilding (7 - 30 Mar 2007 - Main.terrencebarr)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Line: 115 to 115
 /cygdrive/c/WINNT/System32/Wbem:.
Changed:
<
<
  • build-cldc.sh
>
>
  • build-phoneME.sh
 
export TOP=c:/cygwin/home/work/phoneME_feature_MR2
export OUTPUT=$TOP/output
export LOG=$TOP/log.txt
Added:
>
>
# make PCSL cd $TOP/pcsl make ENABLE_PCSL=true PCSL_PLATFORM=win32_i386_vc PCSL_OUTPUT_DIR=$OUTPUT/pcsl # make CLDC
 cd $TOP/cldc/build/win32_i386
Changed:
<
<
make JDK_DIR=c:/j2sdk1.4.2_13 ENABLE_PCSL=true JVMWorkSpace?=$TOP/cldc JVMBuildSpace?=$OUTPUT/cldc USE_VS2005=true PCSL_OUTPUT_DIR=$OUTPUT/pcsl
>
>
make JDK_DIR=c:/j2sdk1.4.2_13 ENABLE_PCSL=true JVMWorkSpace?=$TOP/cldc JVMBuildSpace?=$OUTPUT/cldc USE_VS2005=true PCSL_OUTPUT_DIR=$OUTPUT/pcsl # make MIDP cd $TOP/midp/build/win32 make JDK_DIR=c:/j2sdk1.4.2_13 TOOLS_DIR=$TOP/tools CLDC_DIST_DIR=$OUTPUT/cldc/win32_i386/dist USE_VS2005=true PCSL_OUTPUT_DIR=$OUTPUT/pcsl MIDP_OUTPUT_DIR=$OUTPUT/midp
 

Building PCSL


 <<O>>  Difference Topic PhoneMEBuilding (6 - 30 Mar 2007 - Main.terrencebarr)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Line: 12 to 12
 
Changed:
<
<
In particular, a lot of essential information is contained here:
>
>
In particular, please review the Getting Started Guide:
 
Line: 32 to 32
 In addition to building on Linux phoneME Feature can also be built on Windows. Both Windows 2000 Professional SP4 as well as Windows XP have been successfully used.
Changed:
<
<
Much more important is the tool chain used. The Windows build requires the use of Microsoft tools. The build system has been used predominantely with Microsoft Visual C/C++ 6.0 and works fine with it. Unfortunately, Visual C/C++ 6.0 is no longer available. It has been replaced by Visual Studio 2005 and Visual Studio 2005 Express (which identify the tools version as 8.0).
>
>
An important aspect is the tool chain used. The Windows build currently assumes the use of Microsoft tools. The build system has been used predominantely with Microsoft Visual C/C++ 6.0 and works fine with it. Unfortunately, Visual C/C++ 6.0 is no longer available. It has been replaced by Visual Studio 2005 and Visual Studio 2005 Express, both of which are based on version 8.0 of the C/C++ tool chain.
 Unfortunately, Microsoft has made backwards-incompatible changes to the C/C++ compiler and linker so that the attempt to build the phoneME Feature sources "out-of-the-box" will fail. The phoneME sources and build system have not yet been updated fully to support Visual Studio 2005 so you will need to make a few small modifications to some build configuration files to build successfully.
Line: 40 to 40
 

Microsoft Visual Studio 2005 Issues

Changed:
<
<
You have two choices:
>
>
You have two choices of Microsoft Visual Studio:
 
Changed:
<
<
* Use either Visual C++ Express (no cost) and install the missing ml.exe MASM from here http://www.microsoft.com/downloads/details.aspx?familyid=7A1C9DA0-0510-44A2-B042-7EF370530C64&displaylang=en
>
>
* Visual C++ Express (no cost) and install the missing ml.exe MASM from here MASM tool
 
  • Or use Visual Studio 2005 Professional or above
Changed:
<
<
NOTE: Visual Studio Standard does not include the ml.exe MASM program and I have not found any way to add it (the MASM for Visual C++ refuses installation onto Visual Studio Standard and manually copying ml.exe doesn't work)
>
>
NOTE: Visual Studio Standard does not include the ml.exe MASM program and I have not found any way to add it (the MASM for Visual C++ Express refuses installation onto Visual Studio Standard and manually copying ml.exe doesn't work)
 The compiler in Visual Studio 2005 has significant differences from the one the phoneME Feature engineering team is currently using. As explained above these difference require several small modifications to the build configuration files:

  • Standard library functions like strcpy() are now deprecated in favor of versions that accept array lengths and check for array overruns.
Changed:
<
<
  • Executables are now generated in a new way so that an executable has an associated manifest that describes its DLL dependencies (I think). This causes a little trouble with romgen.exe, as you'll see.
>
>
  • Executables are now generated in a new way so that an executable has an associated manifest that describes its DLL dependencies. This may cause trouble with romgen.exe
 
  • A number of compiler options are now deprecated or have changed, such as: /GB and /DEBUGTYPE
  • Also, it seems the linker now includes standard libraries so when CLDC or MIDP provide alternate definitions of symbols the linker fails with conflicting symbols. Standard libraries now must be explicitly excluded with the /nodefaultlib linker option.
Line: 59 to 59
 cygwin is a Linux-like environment for Windows. It consists of two parts: A DLL (cygwin1.dll) which acts as a Linux API emulation layer providing substantial Linux API functionality as well as a collection of tools which provide Linux look and feel.
Changed:
<
<
For use with phoneME Feature the Sun engineering team has created a purpose-built version called cyg4me. It is highly recommended to use cyg4me as cygwin
>
>
For use with phoneME Feature the Sun engineering team has created a purpose-built version called cyg4me. It is highly recommended to use cyg4me instead of cygwin (cygwin will seems to work initially but cause you trouble later). Download cyg4me here.
 
Changed:
<
<
Do not use cygwin but use the purpose-built version cyg4me. cygwin will seems to work initially but cause you trouble later. Don't waste your time. Use cyg4me at ftp://ftp.sunfreeware.com/pub/freeware/contributions/cygwin
>
>
However, even cyg4me has its share of problems which it inherits from cygwin. In particular, it is unreliable and inconsistent in it's handling of paths:
 
Changed:
<
<
However, even cyg4me has its share of problems which it inherits from cygwin. In particular, it is very flaky with paths:

  • Be very careful with paths within cyg4me and shells your run within cyg4me. There seems to be various flaky behavior around paths, e.g. "_path_" vs. "c:/cygwin/_path_" vs. "\cygwin\_path_" vs. "/cygdrive/c/_path_" should all be the same but depending on the stage of the build and the tools used they seem to be evaluated differently by different tools!. A source of endless fiddling and irritation. Make sure you enter all paths as described other wise you will end up with mysterious build failures.
>
>
  • Be very careful with paths within cyg4me and shells your run within cyg4me. There seems to be various flaky behavior around paths, e.g. "_path_" vs. "c:/cygwin/_path_" vs. "\cygwin\_path_" vs. "/cygdrive/c/_path_" should all be the same but depending on the stage of the build and the tools used they seem to be evaluated differently by different tools! A source of much fiddling and irritation. Make sure you enter all paths as described below other wise you will end up with mysterious build failures.
 
  • Also, don't use shell environment variables except for a variable for the top of your source tree. Pass all variables to make on the command line directly.
  • Your executable path in cyg4me bash should look like this: j2sdk1.4.2_13/bin, followed by cyg4me/bin, followed by the stuff defined by Visual C++ vsvargs32.bat.
  • Make sure j2sdk1.4.2_13/bin is in your excutable path and check the correct version by running "java -version" from the comand line. Also, pass in JDK_DIR seperately on the make command line. Dropping either will result in failures.
Changed:
<
<
  • Finally, sometimes the build will fail with a STATUS_ACCESS_VIOLATION:
>
>
  • Finally, sometimes the phoneME Windows build will fail with a STATUS_ACCESS_VIOLATION something like this:
 
         4 [main] sh 1560 handle_exceptions: Exception: 
Line: 79 to 77
 
make
*
Changed:
<
<
This seems to be cause by some bug in cygwin/cyg4me with handling paths. The sh.exe program crashes and the build fails. The workaround is to shorten or lengthen the path of your phoneME Feature source tree root. Try moving the source tree to some other directory, delete the build output directory, and try re-running the build. This bug can be very frustrating and it might take several tries to avoid it.
>
>
This seems to be cause by some bug in cyg4me with handling paths. In particular, the sh.exe program crashes and the build fails. The workaround is to shorten or lengthen the path of your phoneME Feature source tree root. Try moving the source tree to some other directory, delete the build output directory, and try re-running the build. This bug can be very frustrating and it might take several tries to avoid it.
 
Changed:
<
<

A Working Setup

>
>

A Working Setup

 
  • cygwin.bat

 <<O>>  Difference Topic PhoneMEBuilding (5 - 29 Mar 2007 - Main.terrencebarr)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Line: 48 to 48
 NOTE: Visual Studio Standard does not include the ml.exe MASM program and I have not found any way to add it (the MASM for Visual C++ refuses installation onto Visual Studio Standard and manually copying ml.exe doesn't work)
Changed:
<
<
The compiler in Visual Studio 2005 has significant differences from the one the phoneME Feature engineering team is currently using.
>
>
The compiler in Visual Studio 2005 has significant differences from the one the phoneME Feature engineering team is currently using. As explained above these difference require several small modifications to the build configuration files:
 
  • Standard library functions like strcpy() are now deprecated in favor of versions that accept array lengths and check for array overruns.
  • Executables are now generated in a new way so that an executable has an associated manifest that describes its DLL dependencies (I think). This causes a little trouble with romgen.exe, as you'll see.
  • A number of compiler options are now deprecated or have changed, such as: /GB and /DEBUGTYPE
  • Also, it seems the linker now includes standard libraries so when CLDC or MIDP provide alternate definitions of symbols the linker fails with conflicting symbols. Standard libraries now must be explicitly excluded with the /nodefaultlib linker option.
Changed:
<
<

UNIX tools:

>
>

UNIX tools (cygwin and cyg4me):

cygwin is a Linux-like environment for Windows. It consists of two parts: A DLL (cygwin1.dll) which acts as a Linux API emulation layer providing substantial Linux API functionality as well as a collection of tools which provide Linux look and feel.

For use with phoneME Feature the Sun engineering team has created a purpose-built version called cyg4me. It is highly recommended to use cyg4me as cygwin

 Do not use cygwin but use the purpose-built version cyg4me. cygwin will seems to work initially but cause you trouble later. Don't waste your time. Use cyg4me at ftp://ftp.sunfreeware.com/pub/freeware/contributions/cygwin

Line: 174 to 178
 --++ Running the phoneME executable on other Windows systems
Added:
>
>
Running C++ application built by VC++ Express on another computer
 Visual C++ 2005 Redistributable Package

 <<O>>  Difference Topic PhoneMEBuilding (4 - 29 Mar 2007 - Main.terrencebarr)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Line: 6 to 6
 

Introduction

Changed:
<
<
This wiki topic is a place to collect up-to-date information on how to build phoneME Feature. It assumes that you have already reviewed the following phoneME documentation and pages:
>
>
This wiki topic is a place to collect up-to-date information on how to build phoneME Feature. It assumes that you are already familiar with following phoneME documentation and pages:
 
Changed:
<
<
>
>
 

In particular, a lot of essential information is contained here:

Changed:
<
<
>
>
 This wiki topic here is meant as additional information to complement the Getting Started Guide and to add late-breaking information, tips, and workarounds when building phoneME Feature.
Line: 24 to 24
 
Changed:
<
<
as well as the MR2 b13 build available via the subversion repository (latest available version as of 28 Mar 2007)
>
>
as well as

  • The MR2 b13 build available via the subversion repository (latest available version as of 28 Mar 2007)
 

Building on Windows

Changed:
<
<
Here are my notes on using Microsoft Visual Studio 2005 on Windows XP to build phoneME Feature MR2.
>
>
In addition to building on Linux phoneME Feature can also be built on Windows. Both Windows 2000 Professional SP4 as well as Windows XP have been successfully used.

Much more important is the tool chain used. The Windows build requires the use of Microsoft tools. The build system has been used predominantely with Microsoft Visual C/C++ 6.0 and works fine with it. Unfortunately, Visual C/C++ 6.0 is no longer available. It has been replaced by Visual Studio 2005 and Visual Studio 2005 Express (which identify the tools version as 8.0).

Unfortunately, Microsoft has made backwards-incompatible changes to the C/C++ compiler and linker so that the attempt to build the phoneME Feature sources "out-of-the-box" will fail. The phoneME sources and build system have not yet been updated fully to support Visual Studio 2005 so you will need to make a few small modifications to some build configuration files to build successfully.

Also, the phoneME build system requires various UNIX utilities such as make and sh. Therefore, a package that provides these UNIX utilities on Windows must be used. cygwin is an open source project that provides such UNIX utilities. However, cygwin has it's share of bugs and is somewhat tricky to deal with so we'll describe possible problems and workarounds here as well.

Microsoft Visual Studio 2005 Issues

You have two choices:

* Use either Visual C++ Express (no cost) and install the missing ml.exe MASM from here http://www.microsoft.com/downloads/details.aspx?familyid=7A1C9DA0-0510-44A2-B042-7EF370530C64&displaylang=en

 
Changed:
<
<
The compiler in Visual Studio 2005 has significant differences from the one the engineering team is currently using. In particular, standard library functions like strcpy() are now deprecated in favor of versions that accept array lengths and check for array overruns.
>
>
  • Or use Visual Studio 2005 Professional or above
 
Changed:
<
<
In addition, executables are now generated in a new way so that an executable has an associated manifest that describes its DLL dependencies (I think). This causes a little trouble with romgen.exe, as you'll see.
>
>
NOTE: Visual Studio Standard does not include the ml.exe MASM program and I have not found any way to add it (the MASM for Visual C++ refuses installation onto Visual Studio Standard and manually copying ml.exe doesn't work)
 
Changed:
<
<

Update on compiler and linker options:

>
>
The compiler in Visual Studio 2005 has significant differences from the one the phoneME Feature engineering team is currently using.
 
Added:
>
>
  • Standard library functions like strcpy() are now deprecated in favor of versions that accept array lengths and check for array overruns.
  • Executables are now generated in a new way so that an executable has an associated manifest that describes its DLL dependencies (I think). This causes a little trouble with romgen.exe, as you'll see.
 
  • A number of compiler options are now deprecated or have changed, such as: /GB and /DEBUGTYPE
  • Also, it seems the linker now includes standard libraries so when CLDC or MIDP provide alternate definitions of symbols the linker fails with conflicting symbols. Standard libraries now must be explicitly excluded with the /nodefaultlib linker option.
Changed:
<
<

Update on tools:

>
>

UNIX tools:

 
Changed:
<
<
>
>
Do not use cygwin but use the purpose-built version cyg4me. cygwin will seems to work initially but cause you trouble later. Don't waste your time. Use cyg4me at ftp://ftp.sunfreeware.com/pub/freeware/contributions/cygwin
 
Changed:
<
<

Update on paths:

>
>
However, even cyg4me has its share of problems which it inherits from cygwin. In particular, it is very flaky with paths:
 
  • Be very careful with paths within cyg4me and shells your run within cyg4me. There seems to be various flaky behavior around paths, e.g. "_path_" vs. "c:/cygwin/_path_" vs. "\cygwin\_path_" vs. "/cygdrive/c/_path_" should all be the same but depending on the stage of the build and the tools used they seem to be evaluated differently by different tools!. A source of endless fiddling and irritation. Make sure you enter all paths as described other wise you will end up with mysterious build failures.
  • Also, don't use shell environment variables except for a variable for the top of your source tree. Pass all variables to make on the command line directly.
  • Your executable path in cyg4me bash should look like this: j2sdk1.4.2_13/bin, followed by cyg4me/bin, followed by the stuff defined by Visual C++ vsvargs32.bat.
  • Make sure j2sdk1.4.2_13/bin is in your excutable path and check the correct version by running "java -version" from the comand line. Also, pass in JDK_DIR seperately on the make command line. Dropping either will result in failures.
Added:
>
>
  • Finally, sometimes the build will fail with a STATUS_ACCESS_VIOLATION:

         4 [main] sh 1560 handle_exceptions: Exception: 
STATUS_ACCESS_VIOLATION
       653 [main] sh 1560 open_stackdumpfile: Dumping stack trace to 
sh.exe.stackdump
   make: *** 

This seems to be cause by some bug in cygwin/cyg4me with handling paths. The sh.exe program crashes and the build fails. The workaround is to shorten or lengthen the path of your phoneME Feature source tree root. Try moving the source tree to some other directory, delete the build output directory, and try re-running the build. This bug can be very frustrating and it might take several tries to avoid it.

 

A Working Setup

Line: 149 to 172
 After this, the MIDP (SJWC) build should proceed successfully. You will get lots of warnings about method deprecation and an unsupported compiler option /GB, but it should stagger through to the end without errors.
Added:
>
>
--++ Running the phoneME executable on other Windows systems

Visual C++ 2005 Redistributable Package


 <<O>>  Difference Topic PhoneMEBuilding (3 - 28 Mar 2007 - Main.terrencebarr)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Added:
>
>
Creation date: 28 Mar 2007

Introduction

This wiki topic is a place to collect up-to-date information on how to build phoneME Feature. It assumes that you have already reviewed the following phoneME documentation and pages:

In particular, a lot of essential information is contained here:

This wiki topic here is meant as additional information to complement the Getting Started Guide and to add late-breaking information, tips, and workarounds when building phoneME Feature.

Tested phoneME Feature Versions

Currently, these instructions here have been verified using the MR2 b04 build available here:

as well as the MR2 b13 build available via the subversion repository (latest available version as of 28 Mar 2007)

Building on Windows

 Here are my notes on using Microsoft Visual Studio 2005 on Windows XP to build phoneME Feature MR2.

The compiler in Visual Studio 2005 has significant differences from the one the engineering team is currently using. In particular, standard library functions like strcpy() are now deprecated in favor of versions that accept array lengths and check for array overruns.


 <<O>>  Difference Topic PhoneMEBuilding (2 - 28 Mar 2007 - Main.terrencebarr)
Line: 1 to 1
 
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

Deleted:
<
<
-- JonathanKnudsen? - 04 Jan 2007
 Here are my notes on using Microsoft Visual Studio 2005 on Windows XP to build phoneME Feature MR2.

The compiler in Visual Studio 2005 has significant differences from the one the engineering team is currently using. In particular, standard library functions like strcpy() are now deprecated in favor of versions that accept array lengths and check for array overruns.

In addition, executables are now generated in a new way so that an executable has an associated manifest that describes its DLL dependencies (I think). This causes a little trouble with romgen.exe, as you'll see.

Deleted:
<
<
-- TerrenceBarr? - 16 Feb 2007
 

Update on compiler and linker options:

  • A number of compiler options are now deprecated or have changed, such as: /GB and /DEBUGTYPE
  • Also, it seems the linker now includes standard libraries so when CLDC or MIDP provide alternate definitions of symbols the linker fails with conflicting symbols. Standard libraries now must be explicitly excluded with the /nodefaultlib linker option.
Deleted:
<
<
-- TerrenceBarr? - 16 Feb 2007
 

Update on tools:

  • For my build I was using Windows 2000 Professional with SP4. The OS seems to be no problem.
Line: 108 to 102
 After the CLDC build successfully completes, make sure to copy romgen.exe.manifest from $JVMBuildSpace/cldc/win32_i386/romgen/app to $JVMBuildSpace/win32_i386/cldc/dist/bin. Otherwise romgen.exe will fail during the MIDP build with a message about a missing DLL.
Deleted:
<
<
-- TerrenceBarr? - 16 Feb 2007
 Update to the above: I have not found it necessary to copy romgen.exe.manifest. YMMV

Update: The CLDC build failed when I attempted the SJWC JavaCall build. I get the same link error as for MIDP below. I fixed it by adding a line to cldc/build/javacall_i386_vc/javacall_i386_vc.cfg:

Line: 118 to 110
 LINK_FLAGS+=-nodefaultlib:libcmt.lib
Deleted:
<
<
-- TerrenceBarr? - 16 Feb 2007
 Note: Towards the end of the CLDC build there are still a lot of warning messages around compiler and linker options, such as /GB, /DEBUGTYPE, and multiple defined symbols regarding LIBCMT

Building MIDP

Line: 133 to 123
 After this, the MIDP (SJWC) build should proceed successfully. You will get lots of warnings about method deprecation and an unsupported compiler option /GB, but it should stagger through to the end without errors.
Deleted:
<
<
-- Main.terrencebarr - 28 Mar 2007

 <<O>>  Difference Topic PhoneMEBuilding (1 - 28 Mar 2007 - Main.terrencebarr)
Line: 1 to 1
Added:
>
>
META TOPICPARENT name="PhoneMEFeature"

Building phoneME Feature

-- JonathanKnudsen? - 04 Jan 2007

Here are my notes on using Microsoft Visual Studio 2005 on Windows XP to build phoneME Feature MR2.

The compiler in Visual Studio 2005 has significant differences from the one the engineering team is currently using. In particular, standard library functions like strcpy() are now deprecated in favor of versions that accept array lengths and check for array overruns.

In addition, executables are now generated in a new way so that an executable has an associated manifest that describes its DLL dependencies (I think). This causes a little trouble with romgen.exe, as you'll see.

-- TerrenceBarr? - 16 Feb 2007

Update on compiler and linker options:

  • A number of compiler options are now deprecated or have changed, such as: /GB and /DEBUGTYPE
  • Also, it seems the linker now includes standard libraries so when CLDC or MIDP provide alternate definitions of symbols the linker fails with conflicting symbols. Standard libraries now must be explicitly excluded with the /nodefaultlib linker option.

-- TerrenceBarr? - 16 Feb 2007

Update on tools:

Update on paths:

  • Be very careful with paths within cyg4me and shells your run within cyg4me. There seems to be various flaky behavior around paths, e.g. "_path_" vs. "c:/cygwin/_path_" vs. "\cygwin\_path_" vs. "/cygdrive/c/_path_" should all be the same but depending on the stage of the build and the tools used they seem to be evaluated differently by different tools!. A source of endless fiddling and irritation. Make sure you enter all paths as described other wise you will end up with mysterious build failures.
  • Also, don't use shell environment variables except for a variable for the top of your source tree. Pass all variables to make on the command line directly.
  • Your executable path in cyg4me bash should look like this: j2sdk1.4.2_13/bin, followed by cyg4me/bin, followed by the stuff defined by Visual C++ vsvargs32.bat.
  • Make sure j2sdk1.4.2_13/bin is in your excutable path and check the correct version by running "java -version" from the comand line. Also, pass in JDK_DIR seperately on the make command line. Dropping either will result in failures.

A Working Setup

  • cygwin.bat

@echo off
C:
call "/Program Files/Microsoft Visual Studio 8/Common7/Tools/vsvars32.bat"
set PATH=c:\cyg4me\bin;%PATH%
bash --login -i

  • .bash_profile

export JDK_DIR=/cygdrive/c/j2sdk1.4.2_13
PATH=$JDK_DIR/bin:$PATH:.

  • Resulting cygwin bash shell $PATH

/cygdrive/c/j2sdk1.4.2_13/bin:
/cygdrive/c/cyg4me/bin:
/cygdrive/c/Program Files/Microsoft Visual Studio 8/Common7/IDE:
/cygdrive/c/Program Files/Microsoft Visual Studio 8/VC/BIN:
/cygdrive/c/Program Files/Microsoft Visual Studio 8/Common7/Tools:
/cygdrive/c/Program Files/Microsoft Visual Studio 8/Common7/Tools/bin:
/cygdrive/c/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/bin:
/cygdrive/c/Program Files/Microsoft Visual Studio 8/SDK/v2.0/bin:
/cygdrive/c/WINNT/Microsoft.NET/Framework/v2.0.50727:
/cygdrive/c/Program Files/Microsoft Visual Studio 8/VC/VCPackages:
/cygdrive/c/cyg4me/bin:/cygdrive/c/WINNT/system32:/cygdrive/c/WINNT:
/cygdrive/c/WINNT/System32/Wbem:.

  • build-cldc.sh

export TOP=c:/cygwin/home/work/phoneME_feature_MR2
export OUTPUT=$TOP/output
export LOG=$TOP/log.txt
cd $TOP/cldc/build/win32_i386
make \
JDK_DIR=c:/j2sdk1.4.2_13 \
ENABLE_PCSL=true \
JVMWorkSpace=$TOP/cldc \
JVMBuildSpace=$OUTPUT/cldc \
USE_VS2005=true \
PCSL_OUTPUT_DIR=$OUTPUT/pcsl

Building PCSL

Edit pcsl/makefiles/share/vc.gmk.

In lines 46-50, change the compiler flags definition. Add the flags _CRT_SECURE_NO_DEPRECATE and _CRT_NONSTDC_NO_DEPRECATE and change the treat-warnings-as-errors level from /W3 to /W2. This is what mine looks like when I'm done:

ifeq ($(USE_DEBUG), true)
CFLAGS= /WX /c /W2 -Zi -Od -MDd /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
else
CFLAGS= /WX /c /W2 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
endif

The PCSL build should run fine now.

Building CLDC

For CLDC, set the environment variable USE_VS2005 to true before starting the build. It takes care of a lot of compiler warnings.

After the CLDC build successfully completes, make sure to copy romgen.exe.manifest from $JVMBuildSpace/cldc/win32_i386/romgen/app to $JVMBuildSpace/win32_i386/cldc/dist/bin. Otherwise romgen.exe will fail during the MIDP build with a message about a missing DLL.

-- TerrenceBarr? - 16 Feb 2007

Update to the above: I have not found it necessary to copy romgen.exe.manifest. YMMV

Update: The CLDC build failed when I attempted the SJWC JavaCall build. I get the same link error as for MIDP below. I fixed it by adding a line to cldc/build/javacall_i386_vc/javacall_i386_vc.cfg:

LINK_FLAGS+=-nodefaultlib:libcmt.lib

-- TerrenceBarr? - 16 Feb 2007

Note: Towards the end of the CLDC build there are still a lot of warning messages around compiler and linker options, such as /GB, /DEBUGTYPE, and multiple defined symbols regarding LIBCMT

Building MIDP

The MIDP link will not work unless you add a flag. Do this by adding the following line to midp/build/win32/Platform.gmk:

LD_FLAGS+=-nodefaultlib:libcmt.lib

After this, the MIDP (SJWC) build should proceed successfully. You will get lots of warnings about method deprecation and an unsupported compiler option /GB, but it should stagger through to the end without errors.

-- Main.terrencebarr - 28 Mar 2007


Topic PhoneMEBuilding . { View | Diffs r33 < r32 < r31 < r30 | More }
 XML java.net RSS