harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Ellison <t.p.elli...@gmail.com>
Subject Re: compiling bootJVM with MSVC
Date Fri, 04 Nov 2005 10:07:14 GMT
Enrico Migliore wrote:
> 
>> Enrico,
>>
>> Did Tim's comment help?  Did this resolve it?
>> Have you had any other porting issues in either
>> compilation or configuration?  I would like for us to
>> keep up with these sorts of issues because it would
>> be great if we could support MSVC as one of the
>> development _and_ target type environments
>> for bootJVM.
>>
>> Are you by chance familiar with doing InstallShield
>> scripts?  This would give us an alternative for Windows
>> platforms for doing configuration and installation.
>> Please let everyone know what all you find as you
>> work with the MSVC environment so that that source
>> can be adjusted for portability when all the issues
>> are resolved.  Just by the way, I'm still working on
>> the final bit of basic functionality of the JVM runtime
>> engine and should have something available soon.
>> Thanks for your help and interest.
>>
>> Dan Lydick
>>
>>
>>  
>>
> Hi Dan,
> 
> I'm trying to compille bootJVM with MSVC 6.0.
> 
> Tim's. suggestion (long long = __int64) works fine.

We are using the MSVC compiler on Windows, and gcc on Linux.  Here are a
few lines swiped from our jni.h that may help :

typedef unsigned char jboolean;
/* jbyte is platform specific */
typedef unsigned short jchar;
typedef short jshort;
/* jint is platform specific */
/* jlong is platform specific */
typedef float jfloat;
typedef double jdouble;

and the platform-specific types are defined elsewhere like this :

#if defined(WIN32)||(defined(_WIN32))

typedef signed char jbyte;
typedef int jint;
typedef __int64 jlong;

#else

typedef signed char jbyte;
typedef long long jlong;
typedef int jint;

#endif /* WIN32 */


(ok, so the jbyte and jint are not really different if you restrict to
Windows and Linux IA32<g>)

> I didn't translate the configuration and build scripts into .bat files
> for Windows, I just
> ran the scripts in Cygwin, in order to have the source tree available
> and made a
> "console application" in MSVC.

Do you see that as a long-term solution?  It would require developers to
have both cygwin and MSVC on their machines.

> I'm not much familiar with InstallShield scripts and honestly I'd prefer
> to dedicate
> my spare time to work on the source code side (C is my "daily bread").

FWIW I spent literally a couple of hours a while ago playing with NSIS
and was impressed by how easily it creates a good Windows installer.
The license is liberal.
	http://nsis.sourceforge.net/
Likely there are other good installers too.

> Right now I got some problems which I'm planning to solve during the
> weekend,
> here are two examples:
> 
> --------------------------------------------------------------------------------------
> 
> rvoid argv_init(int argc, char **argv, char **envp)
> {
>    rchar *chkjh;
>    chkjh =  (rchar *) rnull;
>    rchar *chkcp;     <--- MSVC flags this as a compilation error
> 
> ..\jvm\src\argv.c(127) : error C2275: 'rchar' : illegal use of this type
> as an expression
> --------------------------------------------------------------------------------------
> 
> 
> --------------------------------------------------------------------------------------
> 
> typedef struct
> {
>    u1 tag;
>    u2 string_index;
> 
>    struct LOCAL_String_binding
>    {
>                                                   <-- MSVC doesn't like
> an empty struct
>    } LOCAL_String_binding;
>                                            } CONSTANT_String_info;
> 
> ..\jvm\src\classfile.h(1031) : error C2059: syntax error : '}'
> 
> I have to add "int foo;" in order to proceed
> --------------------------------------------------------------------------------------
> 
> 
> 
> Certainly, the code will have to be slightly adjusted for portability.
> 
> Let me proceed and after the weekend I'll write a report.
> 
> 
> ciao,
> Enrico
> 
> 
> 

-- 

Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.

Mime
View raw message