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. May 10, 2019
    • Alex Willmer's avatar
      Use byte literals in examples and unit tests · 59ba68ef
      Alex Willmer authored
      In Python 2.x an unprefixed string literal produces a byte string.
      In Python 3.x an unprefixed string literal produces a textual string.
      
      To produce a byte string in both a b prefix is needed, e.g. b'foo'.
      Since I believe Hammer works predominantly with byte strings I have used
      b prefixes throughout.
      59ba68ef
    • Alex Willmer's avatar
      Use PyBytes_* Python CAPI functions · 8b4b8ddc
      Alex Willmer authored
      This removes any doubts about what type of string is in use.
      8b4b8ddc
    • Alex Willmer's avatar
      Allow Python interpreter to be specified during build · c8239094
      Alex Willmer authored
      This allows the library to be built and tested with a non-default
      version of CPython, e.g.
      
      scons bindings=python python=python3.6
      scons bindings=python python=python3.6 testpython
      c8239094
    • Alex Willmer's avatar
      Fix uses of retired builtins and builtin methods · 287f71d5
      Alex Willmer authored
      In Python 3.x
      
      - int and long types are unified. The unified type is called int.
      - the text string type (unicode) is renamed to str.
      - the byte string type (str) is renamed to bytes.
      - chr returns a text string (i.e. str)
      - xrange is renamed to range.
      - dict.has_key() is removed
      -
      287f71d5
    • Alex Willmer's avatar
      Enable absolute imports, true division, & print() · 0f3cadcc
      Alex Willmer authored
      These have no effect in Python 3.x, they are the default. Enabling them
      in Python 2.x, enabling them in Python 2.x allows single source
      compatiblity.
      0f3cadcc
  4. Dec 07, 2016
  5. Dec 06, 2016
  6. Nov 06, 2016
  7. Oct 25, 2016
  8. Sep 11, 2016
  9. Sep 09, 2016
  10. Aug 12, 2016
  11. Aug 10, 2016
  12. May 22, 2016
    • nicolas's avatar
      Note for later about windows port · 39e101df
      nicolas authored
      39e101df
    • nicolas's avatar
      Replace all double quotes with single quotes · 88420038
      nicolas authored
      To homogenize the file and allow keys/strings to be searched easily.
      88420038
    • nicolas's avatar
      Port scons build files for Windows users · 69d3e702
      nicolas authored
      We disable:
      - the tests (which require glib) although they can be
        reactivated with the `--tests` command line flag
      - shared library (lack of export symbol declarations
        means that although it can be built, no symbol is
        exported and therefore it can't be used)
      
      The `install` target installs the library and headers
      under the `build` folder, because it's a traditional practice
      to move libraries to a central location on Windows, unless
      you are using cygwin. In which case pass `prefix` to the
      command line.
      
      We adapt tools\windows\build_examples.bat to take the library
      that is built using scons or using tools\windows\build.bat
      69d3e702
  13. Feb 25, 2016
  14. Jan 31, 2016
    • Nicolas Léveillé's avatar
      Finish porting hammer's library to windows · 9a7752b9
      Nicolas Léveillé authored
      We port registry by importing the (public domain) openbsd implementation
      of the tfind/tsearch POSIX binary tree search functions.
      
      These are only necessary when building on non-posix platforms
      9a7752b9
    • Nicolas Léveillé's avatar
      Remove warning about tail "potentially uninitialized" · 206f5044
      Nicolas Léveillé authored
      MSVC was complaining that the `tail` variable was potentially
      uninitialized in the while branch. Since the while loop is actually
      coupled to the if (head != NULL) that initializes the tail variable,
      we move them together, which makes the warning disappear.
      206f5044
  15. Dec 27, 2015
  16. Dec 20, 2015
  17. Dec 04, 2015
  18. Dec 02, 2015
  19. Dec 01, 2015
  20. Nov 30, 2015
Loading