public inbox for eclipse@sourceware.org
 help / color / mirror / Atom feed
* 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

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).