You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Paulex Yang <pa...@gmail.com> on 2006/06/20 08:18:27 UTC

[classlib]native codes layout question(was Re: [classlib][NIO|VMI]JNI 1.4 enhancement on ByteBuffer)

Seems no one objects this proposal:), so I'm going to implement the 
JNI1.4 enhancement in nio module, i.e, provide patch to Harmony-578, 
Because this implementation requires some native codes, so I probably 
need to reintroduce hynio.dll(.so), but I have some questions.(Excuse me 
about my ignorance on the native layout evolution).

At first, seems native codes will be separated into modules(I guess Oli 
is working on?), so should I assume my native codes will be directly put 
into nio modules, or still in native-src/win.IA32/nio directory? because 
I'm used to provide a shell to move/svn add new files in the patch, so 
it will be easier for me to know how others think about it.

And second, the native codes probably need portlib, so the portlib's 
header file must be accessible, say, portsock.h, but now it has been 
moved into luni/src/main/native/blabla, should I include one in my patch 
so that nio module can have a copy? or the header file itself should be 
put some other well known directory(deploy/build/include I guess)?


>


-- 
Paulex Yang
China Software Development Lab
IBM



---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib]native codes layout question(was Re: [classlib][NIO|VMI]JNI 1.4 enhancement on ByteBuffer)

Posted by Paulex Yang <pa...@gmail.com>.
FYI, I've raised Harmony-646 and applied patch for this.

Oliver Deakin wrote:
>
>
> Paulex Yang wrote:
>> Oliver Deakin wrote:
>>> Paulex Yang wrote:
>>>> Seems no one objects this proposal:), so I'm going to implement the 
>>>> JNI1.4 enhancement in nio module, i.e, provide patch to 
>>>> Harmony-578, Because this implementation requires some native 
>>>> codes, so I probably need to reintroduce hynio.dll(.so), but I have 
>>>> some questions.(Excuse me about my ignorance on the native layout 
>>>> evolution).
>>>>
>>>> At first, seems native codes will be separated into modules(I guess 
>>>> Oli is working on?), so should I assume my native codes will be 
>>>> directly put into nio modules, or still in native-src/win.IA32/nio 
>>>> directory? because I'm used to provide a shell to move/svn add new 
>>>> files in the patch, so it will be easier for me to know how others 
>>>> think about it.
>>>
>>> It depends on whether you want to wait for what I'm doing or not :)
>>> If you want to get the code out now, then you can temporarily put it 
>>> under native-src/win.IA32/nio and I will move it later as part of 
>>> the natives modularisation.
>>> However, if you don't mind waiting a day or so I should be able to 
>>> submit my first patch to move the prefs natives. This ought to be 
>>> enough of an example for you to put your native code directly into 
>>> modules/nio/src/main/native.
>>>
>>>>
>>>> And second, the native codes probably need portlib, so the 
>>>> portlib's header file must be accessible, say, portsock.h, but now 
>>>> it has been moved into luni/src/main/native/blabla, should I 
>>>> include one in my patch so that nio module can have a copy? or the 
>>>> header file itself should be put some other well known 
>>>> directory(deploy/build/include I guess)?
>>>
>>> At build time, the "copy.native.includes" target in 
>>> luni/make/build.xml is called - it copies a selection of the header 
>>> files in luni/src/main/native/include that need to be shared between 
>>> modules into the deploy/include directory. This is done with an 
>>> explicit fileset in luni/make/build.xml - if you need to have 
>>> portsock.h added to the list of shared header files, then this is 
>>> the place to make that change. Just add its filename to the list, 
>>> and next time you build it will appear in the deploy/include 
>>> directory. Your nio code should include the headers from the 
>>> deploy/include dir, and *not* directly from the 
>>> luni/src/main/native/include dir.
>> Oli, I tried to modify the luni/make/build.xml, and it successfully 
>> copied the portsock.h, but I found I still cannot build my native 
>> codes. So I looked inside the portsock.h, and found that all its 
>> content is just to include another file: "../port/hysock.h", my 
>> native codes in modules/nio/src/main/native cannot find 
>> "../port/hysock.h" so it fails. I guess the reason why the luni 
>> natives still can build is all LUNI's native codes are still located 
>> in native-src/luni, so they can found the hysock.h in native-src/port.
>>
>> Seems portsock.h is useless and confusable, so I suggest the steps 
>> below to fix this problem:
>> 1. svn delete portsock.h in luni
>> 2. svn move hysock.h from native-src to luni
>> 3. update all reference to portsock.h to hysock.h
>> 4. rebuild
>
> Yes, that sounds reasonable. From what I can see portsock.h is basically
> pointless, since it just includes hysock.h. Your plan to replace
> portsock.h with hysock.h sounds like the right thing to do here.
>
>>
>> If no one objects, I'll raise a separated JIRA and provide patch
>
> Thanks!
>
> Regards,
> Oliver
>
>
>>>
>>> I hope this makes more sense now - if it doesn't, please let me 
>>> know. I am in the process of writing up some documentation for the 
>>> website on the natives layout and where headers should go (and also 
>>> how modules should build against the HDK) - once that is complete it 
>>> should all be a lot clearer.
>>>
>>> Regards,
>>> Oliver
>>>
>>
>>
>


-- 
Paulex Yang
China Software Development Lab
IBM



---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib]native codes layout question(was Re: [classlib][NIO|VMI]JNI 1.4 enhancement on ByteBuffer)

Posted by Oliver Deakin <ol...@googlemail.com>.

Paulex Yang wrote:
> Oliver Deakin wrote:
>> Paulex Yang wrote:
>>> Seems no one objects this proposal:), so I'm going to implement the 
>>> JNI1.4 enhancement in nio module, i.e, provide patch to Harmony-578, 
>>> Because this implementation requires some native codes, so I 
>>> probably need to reintroduce hynio.dll(.so), but I have some 
>>> questions.(Excuse me about my ignorance on the native layout 
>>> evolution).
>>>
>>> At first, seems native codes will be separated into modules(I guess 
>>> Oli is working on?), so should I assume my native codes will be 
>>> directly put into nio modules, or still in native-src/win.IA32/nio 
>>> directory? because I'm used to provide a shell to move/svn add new 
>>> files in the patch, so it will be easier for me to know how others 
>>> think about it.
>>
>> It depends on whether you want to wait for what I'm doing or not :)
>> If you want to get the code out now, then you can temporarily put it 
>> under native-src/win.IA32/nio and I will move it later as part of the 
>> natives modularisation.
>> However, if you don't mind waiting a day or so I should be able to 
>> submit my first patch to move the prefs natives. This ought to be 
>> enough of an example for you to put your native code directly into 
>> modules/nio/src/main/native.
>>
>>>
>>> And second, the native codes probably need portlib, so the portlib's 
>>> header file must be accessible, say, portsock.h, but now it has been 
>>> moved into luni/src/main/native/blabla, should I include one in my 
>>> patch so that nio module can have a copy? or the header file itself 
>>> should be put some other well known directory(deploy/build/include I 
>>> guess)?
>>
>> At build time, the "copy.native.includes" target in 
>> luni/make/build.xml is called - it copies a selection of the header 
>> files in luni/src/main/native/include that need to be shared between 
>> modules into the deploy/include directory. This is done with an 
>> explicit fileset in luni/make/build.xml - if you need to have 
>> portsock.h added to the list of shared header files, then this is the 
>> place to make that change. Just add its filename to the list, and 
>> next time you build it will appear in the deploy/include directory. 
>> Your nio code should include the headers from the deploy/include dir, 
>> and *not* directly from the luni/src/main/native/include dir.
> Oli, I tried to modify the luni/make/build.xml, and it successfully 
> copied the portsock.h, but I found I still cannot build my native 
> codes. So I looked inside the portsock.h, and found that all its 
> content is just to include another file: "../port/hysock.h", my native 
> codes in modules/nio/src/main/native cannot find "../port/hysock.h" so 
> it fails. I guess the reason why the luni natives still can build is 
> all LUNI's native codes are still located in native-src/luni, so they 
> can found the hysock.h in native-src/port.
>
> Seems portsock.h is useless and confusable, so I suggest the steps 
> below to fix this problem:
> 1. svn delete portsock.h in luni
> 2. svn move hysock.h from native-src to luni
> 3. update all reference to portsock.h to hysock.h
> 4. rebuild

Yes, that sounds reasonable. From what I can see portsock.h is basically
pointless, since it just includes hysock.h. Your plan to replace
portsock.h with hysock.h sounds like the right thing to do here.

>
> If no one objects, I'll raise a separated JIRA and provide patch

Thanks!

Regards,
Oliver


>>
>> I hope this makes more sense now - if it doesn't, please let me know. 
>> I am in the process of writing up some documentation for the website 
>> on the natives layout and where headers should go (and also how 
>> modules should build against the HDK) - once that is complete it 
>> should all be a lot clearer.
>>
>> Regards,
>> Oliver
>>
>
>

-- 
Oliver Deakin
IBM United Kingdom Limited


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib]native codes layout question(was Re: [classlib][NIO|VMI]JNI 1.4 enhancement on ByteBuffer)

Posted by Paulex Yang <pa...@gmail.com>.
Oliver Deakin wrote:
> Paulex Yang wrote:
>> Seems no one objects this proposal:), so I'm going to implement the 
>> JNI1.4 enhancement in nio module, i.e, provide patch to Harmony-578, 
>> Because this implementation requires some native codes, so I probably 
>> need to reintroduce hynio.dll(.so), but I have some questions.(Excuse 
>> me about my ignorance on the native layout evolution).
>>
>> At first, seems native codes will be separated into modules(I guess 
>> Oli is working on?), so should I assume my native codes will be 
>> directly put into nio modules, or still in native-src/win.IA32/nio 
>> directory? because I'm used to provide a shell to move/svn add new 
>> files in the patch, so it will be easier for me to know how others 
>> think about it.
>
> It depends on whether you want to wait for what I'm doing or not :)
> If you want to get the code out now, then you can temporarily put it 
> under native-src/win.IA32/nio and I will move it later as part of the 
> natives modularisation.
> However, if you don't mind waiting a day or so I should be able to 
> submit my first patch to move the prefs natives. This ought to be 
> enough of an example for you to put your native code directly into 
> modules/nio/src/main/native.
>
>>
>> And second, the native codes probably need portlib, so the portlib's 
>> header file must be accessible, say, portsock.h, but now it has been 
>> moved into luni/src/main/native/blabla, should I include one in my 
>> patch so that nio module can have a copy? or the header file itself 
>> should be put some other well known directory(deploy/build/include I 
>> guess)?
>
> At build time, the "copy.native.includes" target in 
> luni/make/build.xml is called - it copies a selection of the header 
> files in luni/src/main/native/include that need to be shared between 
> modules into the deploy/include directory. This is done with an 
> explicit fileset in luni/make/build.xml - if you need to have 
> portsock.h added to the list of shared header files, then this is the 
> place to make that change. Just add its filename to the list, and next 
> time you build it will appear in the deploy/include directory. Your 
> nio code should include the headers from the deploy/include dir, and 
> *not* directly from the luni/src/main/native/include dir.
Oli, I tried to modify the luni/make/build.xml, and it successfully 
copied the portsock.h, but I found I still cannot build my native codes. 
So I looked inside the portsock.h, and found that all its content is 
just to include another file: "../port/hysock.h", my native codes in 
modules/nio/src/main/native cannot find "../port/hysock.h" so it fails. 
I guess the reason why the luni natives still can build is all LUNI's 
native codes are still located in native-src/luni, so they can found the 
hysock.h in native-src/port.

Seems portsock.h is useless and confusable, so I suggest the steps below 
to fix this problem:
1. svn delete portsock.h in luni
2. svn move hysock.h from native-src to luni
3. update all reference to portsock.h to hysock.h
4. rebuild

If no one objects, I'll raise a separated JIRA and provide patch
>
> I hope this makes more sense now - if it doesn't, please let me know. 
> I am in the process of writing up some documentation for the website 
> on the natives layout and where headers should go (and also how 
> modules should build against the HDK) - once that is complete it 
> should all be a lot clearer.
>
> Regards,
> Oliver
>


-- 
Paulex Yang
China Software Development Lab
IBM



---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib]native codes layout question(was Re: [classlib][NIO|VMI]JNI 1.4 enhancement on ByteBuffer)

Posted by Oliver Deakin <ol...@googlemail.com>.
Tim Ellison wrote:
> Oliver Deakin wrote:
>   
>> Rebuilding a single component can also be done. For example, to rebuild
>> the hyluni.dll you would:
>> 1. cd to native-src/<platform>/luni
>> 2. set the HY_HDK environment variable to point to a directory where
>> you have a complete prebuilt HDK (which could be the deploy dir if you
>> have previously run a global build).
>>     
>
> Can we have it set to the deploy dir by default?
>   

This is only a temporary step while the natives are still in native-src. 
Once all the native code is
moved into the modules the default will be the deploy directory. In 
fact, if you go to the prefs
module and type in "Ant build.native" it will build the prefs native 
code and place the output
libs into the deploy directory. (ok, that's not strictly true - you need 
to use
"Ant -Dmake.command=nmake build.native" because the modular scripts dont 
pick up this
variable from /make/properties.xml yet, but this will be fixed in the 
future.)


>   
>> 3. Run make/nmake. The hyluni.dll will be built against the libs already
>> in HY_HDK, and the generated dll will be placed into the
>> native-src/<platform>
>> directory, where you can then copy it wherever you want
>>
>> Once the natives are all modularised (so native-src no longer exists) you
>> will be able to just go to the module you want and run "ant build.native"
>> (or some similarly name target) and the natives will be incrementally
>> rebuilt and automatically placed into your target directory.
>>     
>
> This is the mode of working that people should get used to, so that
> if/when we have ./configure steps too they will still build the natives
> the same way (i.e. rather than just typing (n)make).
>   

Agreed

Regards,
Oliver

> Regards,
> Tim
>
>   

-- 
Oliver Deakin
IBM United Kingdom Limited


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib]native codes layout question(was Re: [classlib][NIO|VMI]JNI 1.4 enhancement on ByteBuffer)

Posted by Tim Ellison <t....@gmail.com>.
Oliver Deakin wrote:
> Rebuilding a single component can also be done. For example, to rebuild
> the hyluni.dll you would:
> 1. cd to native-src/<platform>/luni
> 2. set the HY_HDK environment variable to point to a directory where
> you have a complete prebuilt HDK (which could be the deploy dir if you
> have previously run a global build).

Can we have it set to the deploy dir by default?

> 3. Run make/nmake. The hyluni.dll will be built against the libs already
> in HY_HDK, and the generated dll will be placed into the
> native-src/<platform>
> directory, where you can then copy it wherever you want
> 
> Once the natives are all modularised (so native-src no longer exists) you
> will be able to just go to the module you want and run "ant build.native"
> (or some similarly name target) and the natives will be incrementally
> rebuilt and automatically placed into your target directory.

This is the mode of working that people should get used to, so that
if/when we have ./configure steps too they will still build the natives
the same way (i.e. rather than just typing (n)make).

Regards,
Tim

-- 

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

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib]native codes layout question(was Re: [classlib][NIO|VMI]JNI 1.4 enhancement on ByteBuffer)

Posted by Oliver Deakin <ol...@googlemail.com>.
Hi Jimmy,

LvJimmy,Jing wrote:
> Hi Oliver:
>
> I've seen the modularisation on native, that's great! :) But I have a
> question here.
> As I work on native before, I usually build the whole native code once,
> and then make seperate modules alone, e.g., luni, or nio. It was easy to
> enter directory luni and force build by "make" and create a new DLL/so
> file.
> In this way it is easy to write codes and debug. However after
> modularisation nowadays, as there are envionment variables in the
> makefile,
> which are defined in the build.xml, I have no idea but build whole native
> with ant, even after changing a single line.
> So I turn to help for if there's an easy way to build single module
> alone? Thanks!

If you want to rebuild all the natives in one go, you can still (currently)
go to the native-src directory and run ant. This will rebuild all the native
components.

Rebuilding a single component can also be done. For example, to rebuild
the hyluni.dll you would:
1. cd to native-src/<platform>/luni
2. set the HY_HDK environment variable to point to a directory where
you have a complete prebuilt HDK (which could be the deploy dir if you
have previously run a global build).
3. Run make/nmake. The hyluni.dll will be built against the libs already
in HY_HDK, and the generated dll will be placed into the
native-src/<platform>
directory, where you can then copy it wherever you want

Once the natives are all modularised (so native-src no longer exists) you
will be able to just go to the module you want and run "ant build.native"
(or some similarly name target) and the natives will be incrementally
rebuilt and automatically placed into your target directory.

Hope this helps,
Oliver

>
> at 06-6-20,Oliver Deakin <ol...@googlemail.com> wrote:
>>
>> Paulex Yang wrote:
>> > Seems no one objects this proposal:), so I'm going to implement the
>> > JNI1.4 enhancement in nio module, i.e, provide patch to Harmony-578,
>> > Because this implementation requires some native codes, so I probably
>> > need to reintroduce hynio.dll(.so), but I have some questions.(Excuse
>> > me about my ignorance on the native layout evolution).
>> >
>> > At first, seems native codes will be separated into modules(I guess
>> > Oli is working on?), so should I assume my native codes will be
>> > directly put into nio modules, or still in native-src/win.IA32/nio
>> > directory? because I'm used to provide a shell to move/svn add new
>> > files in the patch, so it will be easier for me to know how others
>> > think about it.
>>
>> It depends on whether you want to wait for what I'm doing or not :)
>> If you want to get the code out now, then you can temporarily put it
>> under native-src/win.IA32/nio and I will move it later as part of the
>> natives modularisation.
>> However, if you don't mind waiting a day or so I should be able to
>> submit my first patch to move the prefs natives. This ought to be enough
>> of an example for you to put your native code directly into
>> modules/nio/src/main/native.
>>
>> >
>> > And second, the native codes probably need portlib, so the portlib's
>> > header file must be accessible, say, portsock.h, but now it has been
>> > moved into luni/src/main/native/blabla, should I include one in my
>> > patch so that nio module can have a copy? or the header file itself
>> > should be put some other well known directory(deploy/build/include I
>> > guess)?
>>
>> At build time, the "copy.native.includes" target in luni/make/build.xml
>> is called - it copies a selection of the header files in
>> luni/src/main/native/include that need to be shared between modules into
>> the deploy/include directory. This is done with an explicit fileset in
>> luni/make/build.xml - if you need to have portsock.h added to the list
>> of shared header files, then this is the place to make that change. Just
>> add its filename to the list, and next time you build it will appear in
>> the deploy/include directory. Your nio code should include the headers
>> from the deploy/include dir, and *not* directly from the
>> luni/src/main/native/include dir.
>>
>> I hope this makes more sense now - if it doesn't, please let me know. I
>> am in the process of writing up some documentation for the website on
>> the natives layout and where headers should go (and also how modules
>> should build against the HDK) - once that is complete it should all be a
>> lot clearer.
>>
>> Regards,
>> Oliver
>>
>> -- 
>> Oliver Deakin
>> IBM United Kingdom Limited
>>
>>
>> ---------------------------------------------------------------------
>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
>> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>>
>>
>
>

-- 
Oliver Deakin
IBM United Kingdom Limited


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib]native codes layout question(was Re: [classlib][NIO|VMI]JNI 1.4 enhancement on ByteBuffer)

Posted by LvJimmy,Jing <fi...@gmail.com>.
Hi Oliver:

    I've seen the modularisation on native, that's great! :) But I have a
question here.
    As I work on native before, I usually build the whole native code once,
and then make seperate modules alone, e.g., luni, or nio. It was easy to
enter directory luni and force build by "make" and create a new DLL/so file.
In this way it is easy to write codes and debug. However after
modularisation nowadays, as there are envionment variables in the makefile,
which are defined in the build.xml, I have no idea but build whole native
with ant, even after changing a single line.
    So I turn to help for if there's an easy way to build single module
alone? Thanks!

at 06-6-20,Oliver Deakin <ol...@googlemail.com> wrote:
>
> Paulex Yang wrote:
> > Seems no one objects this proposal:), so I'm going to implement the
> > JNI1.4 enhancement in nio module, i.e, provide patch to Harmony-578,
> > Because this implementation requires some native codes, so I probably
> > need to reintroduce hynio.dll(.so), but I have some questions.(Excuse
> > me about my ignorance on the native layout evolution).
> >
> > At first, seems native codes will be separated into modules(I guess
> > Oli is working on?), so should I assume my native codes will be
> > directly put into nio modules, or still in native-src/win.IA32/nio
> > directory? because I'm used to provide a shell to move/svn add new
> > files in the patch, so it will be easier for me to know how others
> > think about it.
>
> It depends on whether you want to wait for what I'm doing or not :)
> If you want to get the code out now, then you can temporarily put it
> under native-src/win.IA32/nio and I will move it later as part of the
> natives modularisation.
> However, if you don't mind waiting a day or so I should be able to
> submit my first patch to move the prefs natives. This ought to be enough
> of an example for you to put your native code directly into
> modules/nio/src/main/native.
>
> >
> > And second, the native codes probably need portlib, so the portlib's
> > header file must be accessible, say, portsock.h, but now it has been
> > moved into luni/src/main/native/blabla, should I include one in my
> > patch so that nio module can have a copy? or the header file itself
> > should be put some other well known directory(deploy/build/include I
> > guess)?
>
> At build time, the "copy.native.includes" target in luni/make/build.xml
> is called - it copies a selection of the header files in
> luni/src/main/native/include that need to be shared between modules into
> the deploy/include directory. This is done with an explicit fileset in
> luni/make/build.xml - if you need to have portsock.h added to the list
> of shared header files, then this is the place to make that change. Just
> add its filename to the list, and next time you build it will appear in
> the deploy/include directory. Your nio code should include the headers
> from the deploy/include dir, and *not* directly from the
> luni/src/main/native/include dir.
>
> I hope this makes more sense now - if it doesn't, please let me know. I
> am in the process of writing up some documentation for the website on
> the natives layout and where headers should go (and also how modules
> should build against the HDK) - once that is complete it should all be a
> lot clearer.
>
> Regards,
> Oliver
>
> --
> Oliver Deakin
> IBM United Kingdom Limited
>
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>


-- 

Best Regards!

Jimmy, Jing Lv
China Software Development Lab, IBM

Re: [classlib]native codes layout question(was Re: [classlib][NIO|VMI]JNI 1.4 enhancement on ByteBuffer)

Posted by Paulex Yang <pa...@gmail.com>.
Oliver Deakin wrote:
> Paulex Yang wrote:
>> Seems no one objects this proposal:), so I'm going to implement the 
>> JNI1.4 enhancement in nio module, i.e, provide patch to Harmony-578, 
>> Because this implementation requires some native codes, so I probably 
>> need to reintroduce hynio.dll(.so), but I have some questions.(Excuse 
>> me about my ignorance on the native layout evolution).
>>
>> At first, seems native codes will be separated into modules(I guess 
>> Oli is working on?), so should I assume my native codes will be 
>> directly put into nio modules, or still in native-src/win.IA32/nio 
>> directory? because I'm used to provide a shell to move/svn add new 
>> files in the patch, so it will be easier for me to know how others 
>> think about it.
>
> It depends on whether you want to wait for what I'm doing or not :)
> If you want to get the code out now, then you can temporarily put it 
> under native-src/win.IA32/nio and I will move it later as part of the 
> natives modularisation.
> However, if you don't mind waiting a day or so I should be able to 
> submit my first patch to move the prefs natives. This ought to be 
> enough of an example for you to put your native code directly into 
> modules/nio/src/main/native.
>
I see, I can wait for your reference move:), it doesn't make sense to 
let you move them again later.
>>
>> And second, the native codes probably need portlib, so the portlib's 
>> header file must be accessible, say, portsock.h, but now it has been 
>> moved into luni/src/main/native/blabla, should I include one in my 
>> patch so that nio module can have a copy? or the header file itself 
>> should be put some other well known directory(deploy/build/include I 
>> guess)?
>
> At build time, the "copy.native.includes" target in 
> luni/make/build.xml is called - it copies a selection of the header 
> files in luni/src/main/native/include that need to be shared between 
> modules into the deploy/include directory. This is done with an 
> explicit fileset in luni/make/build.xml - if you need to have 
> portsock.h added to the list of shared header files, then this is the 
> place to make that change. Just add its filename to the list, and next 
> time you build it will appear in the deploy/include directory. Your 
> nio code should include the headers from the deploy/include dir, and 
> *not* directly from the luni/src/main/native/include dir.
>
Got it, I will try. Thank you very much, Oli!
> I hope this makes more sense now - if it doesn't, please let me know. 
> I am in the process of writing up some documentation for the website 
> on the natives layout and where headers should go (and also how 
> modules should build against the HDK) - once that is complete it 
> should all be a lot clearer.
>
> Regards,
> Oliver
>


-- 
Paulex Yang
China Software Development Lab
IBM



---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib]native codes layout question(was Re: [classlib][NIO|VMI]JNI 1.4 enhancement on ByteBuffer)

Posted by Oliver Deakin <ol...@googlemail.com>.
Paulex Yang wrote:
> Seems no one objects this proposal:), so I'm going to implement the 
> JNI1.4 enhancement in nio module, i.e, provide patch to Harmony-578, 
> Because this implementation requires some native codes, so I probably 
> need to reintroduce hynio.dll(.so), but I have some questions.(Excuse 
> me about my ignorance on the native layout evolution).
>
> At first, seems native codes will be separated into modules(I guess 
> Oli is working on?), so should I assume my native codes will be 
> directly put into nio modules, or still in native-src/win.IA32/nio 
> directory? because I'm used to provide a shell to move/svn add new 
> files in the patch, so it will be easier for me to know how others 
> think about it.

It depends on whether you want to wait for what I'm doing or not :)
If you want to get the code out now, then you can temporarily put it 
under native-src/win.IA32/nio and I will move it later as part of the 
natives modularisation.
However, if you don't mind waiting a day or so I should be able to 
submit my first patch to move the prefs natives. This ought to be enough 
of an example for you to put your native code directly into 
modules/nio/src/main/native.

>
> And second, the native codes probably need portlib, so the portlib's 
> header file must be accessible, say, portsock.h, but now it has been 
> moved into luni/src/main/native/blabla, should I include one in my 
> patch so that nio module can have a copy? or the header file itself 
> should be put some other well known directory(deploy/build/include I 
> guess)?

At build time, the "copy.native.includes" target in luni/make/build.xml 
is called - it copies a selection of the header files in 
luni/src/main/native/include that need to be shared between modules into 
the deploy/include directory. This is done with an explicit fileset in 
luni/make/build.xml - if you need to have portsock.h added to the list 
of shared header files, then this is the place to make that change. Just 
add its filename to the list, and next time you build it will appear in 
the deploy/include directory. Your nio code should include the headers 
from the deploy/include dir, and *not* directly from the 
luni/src/main/native/include dir.

I hope this makes more sense now - if it doesn't, please let me know. I 
am in the process of writing up some documentation for the website on 
the natives layout and where headers should go (and also how modules 
should build against the HDK) - once that is complete it should all be a 
lot clearer.

Regards,
Oliver

-- 
Oliver Deakin
IBM United Kingdom Limited


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org