From: Mark Wielaard <mark@klomp.org>
To: eclipse@sources.redhat.com
Subject: Natively compiled eclipse c++ dependency patch
Date: Sat, 02 Aug 2003 09:36:00 -0000 [thread overview]
Message-ID: <1059816996.11511.31.camel@elsschot.wildebeest.org> (raw)
[-- 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++;
}
next reply other threads:[~2003-08-02 9:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-02 9:36 Mark Wielaard [this message]
2003-08-02 16:05 ` Tom Tromey
2003-08-09 23:15 ` Mark Wielaard
2003-08-11 17:25 ` Mark Wielaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1059816996.11511.31.camel@elsschot.wildebeest.org \
--to=mark@klomp.org \
--cc=eclipse@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).