Skip to content
Snippets Groups Projects
  1. Nov 21, 2019
    • xentrac's avatar
      Get JNI shared library to build with SCons · 2fd2a1d8
      xentrac authored
      This was a real adventure since I didn’t know anything about SCons, and
      I can’t say that I’m fond of scons after it, but it does seem to work.
      There were two obstacles.
      
      First, the ConfigureJNI module doesn’t successfully configure the JNI on
      my system because it was expecting to find `JAVA_HOME` in .., so I added
      a little code to notice if it’s failing to find a place where `jni.h`
      exists.  (And on my system I did `export
      JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64` before running it, but your
      pathnames will vary.)  There was a hardcoded pathname in SConscript,
      presumably as an interim debugging measure, which I removed.  A
      reasonable default to try on Debian-derived systems such as Ubuntu and
      LinuxMint might be `/usr/lib/jvm/default-java`, but I didn’t implement
      that.
      
      Second, in SConscript, the JNI include directories were being stuck into
      a `javaenv` SCons environment object, which was used to build the Java
      classes providing the Java interfaces to Hammer, but not the C files
      containing the native methods themselves.  Consequently the compiler
      couldn’t find the JDK JNI headers when it tried to compile the C code
      into a shared library.  It might make sense to use `javaenv` to compile
      that shared library, but in case it doesn’t, I cloned the default
      environment with an extra include directory.
      
      I hope this is soon enough to be helpful!
      2fd2a1d8
  2. Nov 19, 2019
  3. Oct 09, 2019
  4. Oct 08, 2019
  5. Oct 07, 2019
  6. May 10, 2019
  7. Jun 27, 2017
  8. Dec 07, 2016
  9. Dec 06, 2016
  10. Nov 06, 2016
  11. Nov 01, 2016
  12. Oct 25, 2016
  13. Sep 11, 2016
  14. Sep 09, 2016
  15. Aug 19, 2016
  16. Aug 12, 2016
Loading