Commits

didier deshommes committed 38d7edc Draft

build works

Comments (0)

Files changed (4)

   TRACE("Loading GMP-based BigInteger native library");
   mp_set_memory_functions (NULL, NULL, NULL);
   native_ptr = (*env)->GetFieldID (env, nativeMPI, "native_ptr",
-                                   "LPointer;");
+                                   "Lorg/dfdeshom/math/Pointer;");
   TRACE("Loaded GMP-based BigInteger native library");
 }
 
 
 jni:
 	javac $(JAVA_FLAGS) org/dfdeshom/math/GMP.java
-	javah -d include org.dfdeshom.math.GMP
+	javah -jni -d include org.dfdeshom.math.GMP 
 
 libgmpjava:GMP.c libjcl
-	gcc $(Includes) GMP.c -o libnativegmp.so $(LIBS) $(CFLAGS)
+	gcc $(Includes)  GMP.c -o libnativegmp.so $(LIBS) $(CFLAGS)
 
 libjcl:jcl.c
-	gcc  $(Includes) -L /usr/lib/  jcl.c -o libjcl.so $(CFLAGS)
+	gcc  $(Includes)  -L /usr/lib/   jcl.c -o libjcl.so $(CFLAGS)
 
 jar: java 
 	jar cvf target/GMP.jar org/dfdeshom/math/GMP.class org/dfdeshom/math/Pointer*.class 
   env = (JNIEnv *) envp;
   if (SIZEOF_VOID_P() == 8)
     {
-  rawDataClass = (*env)->FindClass (env, "Pointer64");
+  rawDataClass = (*env)->FindClass (env, "org/dfdeshom/math/Pointer64");
   if (rawDataClass != NULL)
     rawDataClass = (*env)->NewGlobalRef (env, rawDataClass);
 
 
   if (SIZEOF_VOID_P() == 4)
     {
-  rawDataClass = (*env)->FindClass (env, "Pointer32");
+  rawDataClass = (*env)->FindClass (env, "org/dfdeshom/math/Pointer32");
   if (rawDataClass != NULL)
     rawDataClass = (*env)->NewGlobalRef (env, rawDataClass);
 

org/dfdeshom/math/GMP.java

  * Implement BigInteger using GMP
  */
 package org.dfdeshom.math;
+import org.dfdeshom.math.Pointer;
 
 public final class GMP extends Number implements Comparable<GMP>
 {
 
   static
   {
-      //System.setProperty( "java.library.path", "~/code/gmp-java" );
       System.loadLibrary("nativegmp");
       natInitializeLibrary();
   }
 
+  
   public static final GMP ZERO = new GMP(0);
 
   public GMP()
   private native void natSetBit(int n, boolean setIt, Pointer r);
   private native void natNot(Pointer r);
 
+
 }