Permalink
Browse files

Updated documentation

  • Loading branch information...
1 parent 0af4e32 commit e97b8054b358bea984d740958c2163edfda994b6 @dren-dk committed Mar 19, 2012
Showing with 52 additions and 15 deletions.
  1. +25 −0 readme-darwin-64bit.txt
  2. +27 −15 readme.txt
View
@@ -0,0 +1,25 @@
+The OSX 64 bit hunspell library was compiled by Andrzej Zydron azydron at xml-intl dot com, this is the message he sent:
+
+------------------------------
+
+I have just built a 64 bit version of Hunspell for Mac OS 10.5. I had to do this because Java 1.6 under Leopard is compiled as a 64 bit executable and would not load the standard 32 bit build of hunspell. I had to configure using the following:
+
+CFLAGS='-arch x86_64 -g -O2' CXXFLAGS='-arch x86_64 -g -O2' CPPFLAGS='-arch x86_64 -g -O2' LDFLAGS='-arch x86_64' ./configure --with-gnu-ld
+
+and then I had to edit 'libtool' to add -arch x86_64 to all instances of '"\$CC -dynamiclib ' as per the following diff:
+
+> diff libtool{,~}
+214c214
+< archive_cmds="\$CC -arch x86_64 -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring \$single_module~dsymutil \$lib || :"
+---
+> archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring \$single_module~dsymutil \$lib || :"
+6966,6967c6966,6967
+< archive_cmds="\$CC -dynamiclib -arch x86_64 \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring \$single_module~dsymutil \$lib || :"
+< archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib -arch x86_64 \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring \$single_module \${wl}-exported_symbols_list,\$output_objdir/\${libname}-symbols.expsym~dsymutil \$lib || :"
+---
+> archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring \$single_module~dsymutil \$lib || :"
+> archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring \$single_module \${wl}-exported_symbols_list,\$output_objdir/\${libname}-symbols.expsym~dsymutil \$lib || :"
+>
+
+I am not sure if the '--with-gnu-ld' was absolutely necessary, but it works. Please feel free to publish this info if it will help others.
+
View
@@ -4,22 +4,32 @@ This package contains the JNA based Java bindings for the Hunspell, see:
https://github.com/twall/jna and http://hunspell.sourceforge.net/ for details
on how these work.
+This java wrapper lives at:
+https://github.com/dren-dk/HunspellJNA
+
See this page for dictionaries:
http://wiki.services.openoffice.org/wiki/Dictionaries
* Building the native binaries
-Before building the java API you must build some native binaries to include
+Before using the java API you must build some native binaries to include
in the jar, to make things easy I've included the binaries from the platforms
that I care about in native-lib.
The binaries in native-lib were built on the various platforms using the
native-build.pl script, the source for the native libs is in native-src and
consists of an unmodified hunspell source tar ball and any needed diffs.
-You will need to install cygwin to build on windows as all the common
-utilities seem to missing from that platform.
+I've included a script called native-build.pl which might help to build
+on at least Linux and 32 bit OSX/windows, for 64 bit OSX/windows you
+can take it as a hint of what to do.
+
+Compiling libhunspell for 64 bit OSX is a pain, see readme-darwin-64bit.txt
+for the changes that are needed to make it work.
+
+Compiling libhunspell for 64 bit windows means having to change the vc project
+to compile for the x64 platform.
* Building the Java API
@@ -31,13 +41,14 @@ could want (aside from jna.jar which can be found on the JNA page or in lib)
* Building the Java API for use via webstart
-If you plan on using hunspell.jar from a web application run: "ant webstart".
+If you plan on using hunspell.jar from a webstart application run:
+"ant webstart".
This will produce two native jar files per supported platform (one for JNA
and one for hunspell) as well as pure java jna-jws.jar and hunspell-jws.jar
in build/jar.
-Include jna-jws.jar and hunspell-jws.jar in the common resources secion in
+Include jna-jws.jar and hunspell-jws.jar in the common resources section in
normal jar tags, the platform specific binaries must go into platform specific
resource sections as nativelib entries.
@@ -50,8 +61,8 @@ osx and linux (it worked fine on windows), there are two workarounds:
1) Use plain <jar/> tags in stead of <nativelib/> this will cause both JNA and
hunspell to search the classpath for the needed binaries and they will then
extract the binaries and load them as usual.
- This approach might leak a binary each run on windows because of mandatory
- the mandatory file locking used on that platform, though.
+ This approach might leak a binary each run on windows because of
+ the mandatory file locking used on that platform.
2) Consolidate all your nativelib files for each platform into one.
This looks slightly less pretty, but it works and is slightly faster during
@@ -61,8 +72,8 @@ osx and linux (it worked fine on windows), there are two workarounds:
* Output
The output of "ant" is one large jar file containing binaries for all the
-supported platforms, it's about 800k, so it's not very nice for applets and
-webstart, though:
+supported platforms, it's about 800k, so it's not very nice for folks who
+have to download it though:
hunspell.jar : The Java API + all binaries
@@ -98,8 +109,8 @@ if (dict.misspelled("wrod")) {
}
IOW: The application must also supply the two dictionary files (.dic and .aff)
-found in the zip filem unzipped on disk and point at them using the full path
-+ the part fo the file name befor .dic.
+found in the zip file unzipped on disk and point at them using the full path
++ the part of the file name before .dic.
Hunspell.getInstance() caches the loaded hunspell library, so there is no
overhead in calling it more than once.
@@ -120,15 +131,16 @@ disk.
Although this code doesn't contain any, it's very much inspired by the JNA
bindings in OmegaT, so thank you to the OmegaT developers.
+Andrzej Zydron figured out how to build libhunspell for 64 bit OSX.
+
* Misc
-At the moment the package containst a copy of both jna.jar and the latest
-working copy of hunspell (1.1.12-2), as I couldn't get 1.2.2b to work on msvc
-2005.
+At the moment the package contains copies of:
+* jna.jar version 3.4.0
+* Hunspell version 1.3.2
Patches and suggestions are welcome.
Flemming Frandsen (flfr at stibo dot com / ff at nrvissing dot net)
-

0 comments on commit e97b805

Please sign in to comment.