This is the mail archive of the
eclipse@sources.redhat.com
mailing list for the gcj-compiled eclipse project.
Natively compiled eclipse c++ dependency patch
- From: Mark Wielaard <mark at klomp dot org>
- To: eclipse at sources dot redhat dot com
- Date: 02 Aug 2003 11:36:36 +0200
- Subject: Natively compiled eclipse c++ dependency patch
- Organization:
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
--- 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++;
}