[Snowball-discuss] Using libstemmer_c with an autotools packages

From: Vegard Nossum (vegard@peltkore.net)
Date: Mon Mar 26 2007 - 10:42:09 BST


My project is using the GNU autotools (autoconf/automake) for the build
process. We also use the Snowball stemmer. The Snowball's makefile is not
compatible with GNU autotools, and in order to quickly integrate new
Snowball versions into our project without having to rewrite makefiles and
paths, I have written a script which automatically takes the
libstemmer_c.tgz file and "converts" it to a local library which is easy
to use with projects that use the GNU autotools.


Put convert-noinst.sh and libstemmer_c.tgz (from the Snowball website) in
a common directory. From this directory, run the convert-noinst.sh script.
This will create a lot of additional files; the interesting ones are the
stemmer/ directory and libstemmer-1.0.tar.gz.

The stemmer/ directory can be copied verbatim into an existing project
that is already using GNU autotools. In order to use it, simply add
"stemmer/Makefile" to AC_OUTPUT in your top-level configure.in and add
"stemmer" to SUBDIRS in your top-level Makefile.am (you can see how this
is done in the generated configure.in and Makefile.am files). In stemmer/,
a file called libstemmer.a will be generated. This file must be linked in
with any programs that use the stemmer library (this can be done by adding
libstemmer.a to the <name>_LDADD variable in Makefile.am). You should
probably also add INCLUDE = -I$(top_srcdir) to Makefile.am so that the
stemmer headers can be reached using #include "stemmer/libstemmer.h" in
your source files.

The libstemmer-1.0.tar.gz is a sample package which verifies that the
build process succeeded. It behaves just like a normal autotools package
and can be used for reference and/or example when including the stemmer in
your project.

Kind regards,
Vegard Nossum

This archive was generated by hypermail 2.1.3 : Thu Sep 20 2007 - 12:02:49 BST