* Natively compiled eclipse c++ dependency patch
@ 2003-08-02 9:36 Mark Wielaard
2003-08-02 16:05 ` Tom Tromey
0 siblings, 1 reply; 4+ messages in thread
From: Mark Wielaard @ 2003-08-02 9:36 UTC (permalink / raw)
To: eclipse
[-- Attachment #1: Type: text/plain, Size: 511 bytes --]
Hi,
This is really awesome! Really fast and snappy.
Great work guys!
While trying to build from source I noticed that although there is no
build dependencies on g++ there is one c++ file in the build. Since it
is a simple JNI implementation it can be easily rewritten to use just
plain C.
Attached is a patch for the build.xml file and the update.cpp file (you
will have to also rename the patched update.cpp file to update.c). Apply
inside the plugins/org.eclipse.update.core.linux/src/ dir.
Cheers,
Mark
[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 3529 bytes --]
--- build.xml.orig 2003-08-02 09:55:08.000000000 +0200
+++ build.xml 2003-08-02 09:55:39.000000000 +0200
@@ -58,8 +58,8 @@
<arg value="-I${header-path}"/>
<arg value="-I${header-linux-path}"/>
<srcfile/>
- <fileset dir="${src-path}" includes="*.cpp"/>
- <mapper type="glob" from="*.cpp" to="*.o"/>
+ <fileset dir="${src-path}" includes="*.c"/>
+ <mapper type="glob" from="*.c" to="*.o"/>
</apply>
<move file="${library-file}" todir="${destination}"/>
--- update.cpp 2003-08-02 09:54:56.000000000 +0200
+++ update.c 2003-08-02 10:05:23.000000000 +0200
@@ -32,10 +32,10 @@
jlong result = org_eclipse_update_configuration_LocalSystemInfo_SIZE_UNKNOWN;
// first, obtain the Path from the java.io.File parameter
- cls = jnienv -> GetObjectClass(file);
- id = jnienv -> GetMethodID(cls, "getAbsolutePath", "()Ljava/lang/String;");
- obj = jnienv -> CallObjectMethod(file, id);
- lpDirectoryName = jnienv -> GetStringUTFChars((jstring) obj, 0);
+ cls = (*jnienv) -> GetObjectClass(jnienv, file);
+ id = (*jnienv) -> GetMethodID(jnienv, cls, "getAbsolutePath", "()Ljava/lang/String;");
+ obj = (*jnienv) -> CallObjectMethod(jnienv, file, id);
+ lpDirectoryName = (*jnienv) -> GetStringUTFChars(jnienv, (jstring) obj, 0);
// cast one argument as jlong to have a jlong result
int err = statfs(lpDirectoryName,&buffer);
@@ -67,10 +67,10 @@
const char * lpDirectoryName;
// obtain the String from the parameter
- cls = jnienv -> GetObjectClass(file);
- id = jnienv -> GetMethodID(cls, "getAbsolutePath", "()Ljava/lang/String;");
- obj = jnienv -> CallObjectMethod(file, id);
- lpDirectoryName = jnienv -> GetStringUTFChars((jstring) obj, 0);
+ cls = (*jnienv) -> GetObjectClass(jnienv, file);
+ id = (*jnienv) -> GetMethodID(jnienv, cls, "getAbsolutePath", "()Ljava/lang/String;");
+ obj = (*jnienv) -> CallObjectMethod(jnienv, file, id);
+ lpDirectoryName = (*jnienv) -> GetStringUTFChars(jnienv, (jstring) obj, 0);
jstring result = NULL;
@@ -98,10 +98,10 @@
const char * lpDirectoryName;
// obtain the String from the parameter
- cls = jnienv -> GetObjectClass(file);
- id = jnienv -> GetMethodID(cls, "getAbsolutePath", "()Ljava/lang/String;");
- obj = jnienv -> CallObjectMethod(file, id);
- lpDirectoryName = jnienv -> GetStringUTFChars((jstring) obj, 0);
+ cls = (*jnienv) -> GetObjectClass(jnienv, file);
+ id = (*jnienv) -> GetMethodID(jnienv, cls, "getAbsolutePath", "()Ljava/lang/String;");
+ obj = (*jnienv) -> CallObjectMethod(jnienv, file, id);
+ lpDirectoryName = (*jnienv) -> GetStringUTFChars(jnienv, (jstring) obj, 0);
int result;
@@ -136,17 +136,18 @@
// find mount points
drive = 0;
- stringClass = jnienv -> FindClass("java/lang/String");
- empty = jnienv -> NewStringUTF("");
- //returnArray = jnienv -> NewObjectArray(nDrive, stringClass, empty);
+ stringClass = (*jnienv) -> FindClass(jnienv, "java/lang/String");
+ empty = (*jnienv) -> NewStringUTF(jnienv, "");
+ //returnArray = (*jnienv) -> NewObjectArray(jnienv, nDrive, stringClass, empty);
// for now return null as method is not implemented
returnArray = NULL;
- for (int i = 0; i < drive; i++) {
+ int i;
+ for (i = 0; i < drive; i++) {
// Linux implementation, create String for each mount point
- str = jnienv -> NewStringUTF(driveName);
- jnienv -> SetObjectArrayElement(returnArray, index, str);
+ str = (*jnienv) -> NewStringUTF(jnienv, driveName);
+ (*jnienv) -> SetObjectArrayElement(jnienv, returnArray, index, str);
index++;
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Natively compiled eclipse c++ dependency patch
2003-08-02 9:36 Natively compiled eclipse c++ dependency patch Mark Wielaard
@ 2003-08-02 16:05 ` Tom Tromey
2003-08-09 23:15 ` Mark Wielaard
0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2003-08-02 16:05 UTC (permalink / raw)
To: Mark Wielaard; +Cc: eclipse
>>>>> "Mark" == Mark Wielaard <mark@klomp.org> writes:
Mark> While trying to build from source I noticed that although there is no
Mark> build dependencies on g++ there is one c++ file in the build. Since it
Mark> is a simple JNI implementation it can be easily rewritten to use just
Mark> plain C.
I think this patch that should go upstream, since it only touches
eclipse.org code. Stick it in the eclipse.org bugzilla and tell me
the bug number. I'll vote for it :-)
Tom
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Natively compiled eclipse c++ dependency patch
2003-08-02 16:05 ` Tom Tromey
@ 2003-08-09 23:15 ` Mark Wielaard
2003-08-11 17:25 ` Mark Wielaard
0 siblings, 1 reply; 4+ messages in thread
From: Mark Wielaard @ 2003-08-09 23:15 UTC (permalink / raw)
To: tromey; +Cc: eclipse
Hi,
On Sat, 2003-08-02 at 17:58, Tom Tromey wrote:
> >>>>> "Mark" == Mark Wielaard <mark@klomp.org> writes:
>
> Mark> While trying to build from source I noticed that although there is no
> Mark> build dependencies on g++ there is one c++ file in the build. Since it
> Mark> is a simple JNI implementation it can be easily rewritten to use just
> Mark> plain C.
>
> I think this patch that should go upstream, since it only touches
> eclipse.org code. Stick it in the eclipse.org bugzilla and tell me
> the bug number. I'll vote for it :-)
This is now bug #41361
https://bugs.eclipse.org/bugs/show_bug.cgi?id=41361
As long as this patch is not applied you might want to add a build
dependency on g++-ssa to the native eclipse source package.
Cheers,
Mark
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Natively compiled eclipse c++ dependency patch
2003-08-09 23:15 ` Mark Wielaard
@ 2003-08-11 17:25 ` Mark Wielaard
0 siblings, 0 replies; 4+ messages in thread
From: Mark Wielaard @ 2003-08-11 17:25 UTC (permalink / raw)
To: tromey; +Cc: eclipse
[-- Attachment #1: Type: text/plain, Size: 481 bytes --]
Hi,
On Sun, 2003-08-10 at 01:14, Mark Wielaard wrote:
> On Sat, 2003-08-02 at 17:58, Tom Tromey wrote:
> > I think this patch that should go upstream, since it only touches
> > eclipse.org code. Stick it in the eclipse.org bugzilla and tell me
> > the bug number. I'll vote for it :-)
>
> This is now bug #41361
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=41361
Which got almost immediately applied.
Wow, those eclipse guys are fast with accepting patches.
Cheers,
Mark
[-- Attachment #2: Type: message/rfc822, Size: 176 bytes --]
From:
Subject: No Subject
Date: 11 Aug 2003 19:24:47 +0200
Message-ID: <1060622687.1030.1.camel@elsschot>
[-- Attachment #3: Type: message/rfc822, Size: 2124 bytes --]
From: bugzilla-daemon@eclipse.org
To: mark@klomp.org
Subject: [Bug 41361] C++ dependency in org.eclipse.update.core.linux update JNI functions
Date: Mon, 11 Aug 2003 10:18:26 -0400 (EDT)
Message-ID: <20030811141826.89F013ED1@bugs.eclipse.org>
https://bugs.eclipse.org/bugs/show_bug.cgi?id=41361
birsan@ca.ibm.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
Target Milestone|--- |3.0 M3
------- Additional Comments From birsan@ca.ibm.com 2003-08-11 10:18 -------
Thanks, I checked in the patch.
BTW, the Apply patch does not work well, I had to do it manually (copy/paste).
------- You are receiving this mail because: -------
You reported the bug, or are watching the reporter.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-08-11 17:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-02 9:36 Natively compiled eclipse c++ dependency patch Mark Wielaard
2003-08-02 16:05 ` Tom Tromey
2003-08-09 23:15 ` Mark Wielaard
2003-08-11 17:25 ` Mark Wielaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).