[Snowball-discuss] Using libstemmer_c with an autotools packages

Vegard Nossum vegard at peltkore.net
Mon Mar 26 10:42:09 BST 2007


Hello,

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.

Instructions:

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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: convert-noinst.sh
Type: application/x-sh
Size: 1570 bytes
Desc: not available
Url : http://lists.tartarus.org/mailman/private/snowball-discuss/attachments/20070326/578da7c5/convert-noinst.sh


More information about the Snowball-discuss mailing list