Skip to main content

CLDC: generic c configuration: is it possible to build ?

1 reply [Last post]
ole00
Offline
Joined: 2008-10-14
Points: 0

Hi,

I tried to build the most platform independent configuration of the CLDC (based on phoneme r3) so I specified new build configuration like that :

host_os = win32
host_arch = i386
os_family = generic
compiler = gcc
arch = c

MakeDepsMain_generic = WinGammaPlatform
MakeDepsOpts_generic = -resolveVpath true

export ENABLE_C_INTERPRETER := true
export ENABLE_C_INTERPRETER__BY := generic_c.cfg

export ENABLE_INTERPRETER_GENERATOR := false
export ENABLE_INTERPRETER_GENERATOR__BY := generic_c.cfg

export ENABLE_COMPILER := false
export ENABLE_COMPILER__BY := generic_c.cfg

ifndef MERGE_SOURCE_FILES
MERGE_SOURCE_FILES = true
endif

ifndef SOURCE_MERGER_SIZE
SOURCE_MERGER_SIZE = 35
endif

LOOP_GEN_FLAGS = +GenerateGNUCode
ROM_GEN_FLAGS = +GenerateGNUCode

CPP_DEF_FLAGS +=
LINK_FLAGS +=

export ENABLE_TIMER_THREAD = true

unfortunately it doesn't work. It stops when linking ROM generator. I assume it is caused by variable MakeDepsMain_generic which is set to WinGammaPlatform. As I understand this value will change the behaviour of the process of generation of dependency files. In fact the value is the name of the java class that is used when the "buildtool.jar makedep" is called. I tried both WinGammaPlatform and UnixPlatform but unfortunatelly none of them works correctly (dependencies are incorrectly generated so the compilation / linking stopped).

Did anyone try to compile most "stubbed" version of cldc ? I mean the version where all of the code is generic and without platform specific implementation ? If so, what was the configuration file ? Thanks.

Message was edited by: ole00

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ole00
Offline
Joined: 2008-10-14
Points: 0

Well, I investigated more and now I see that it is not possible right now. On my "generic" platform (in fact I tried to compile it under mingw) I have no support for pthreads nor support for timer interrupt so the build failed. I decided to try cygwin_c configuration using cyg4me but unfortunately it lacks g++ compiler so I could not compile anything (what a shame!). So I tried to use cygwin instead of cyg4me and after several hours of struggle I finally made it. Stuff I had to create/modify:
- wrapper binaries for java, javac and jar that changes /cygdrive/x paths into the windows-like paths (x:/).
- modify buildtool/makedep to convert windows-like paths back to /cygdrive/x paths
(specifically i modified Database.writeGrandUnixMakefile())
- compile new preverifier because the supplied one in the cygwin directory is not compatible with cygwin (again, it struggles with paths and complains about non existing classes) ! Fortunatelly preverifier sources are available in the Sun's cldc reference implementation so I was be able to recompile it for cygwin.

That's it. I was really disappointed that configurations for cygwin actually cannot be buit on cygwin without errors...