From: Adam Dickmeiss Date: Wed, 15 Sep 2004 09:17:25 +0000 (+0000) Subject: Added autoconf utility idzebra.m4 which defines --with-idzebra X-Git-Tag: snippet.version.1~347 X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=commitdiff_plain;h=69d2833ca96efad6777b13a1e52f23a09c749509 Added autoconf utility idzebra.m4 which defines --with-idzebra --- diff --git a/Makefile.am b/Makefile.am index 27762d5..c4dcaef 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,13 +1,17 @@ -## $Id: Makefile.am,v 1.16 2004-08-29 12:31:32 adam Exp $ +## $Id: Makefile.am,v 1.17 2004-09-15 09:17:25 adam Exp $ AUTOMAKE_OPTIONS=foreign SUBDIRS=util bfile dfa dict isams isamb isamc rset data1 \ recctrl tab index test examples include doc +aclocaldir=$(datadir)/aclocal +aclocal_DATA = idzebra.m4 + SPEC_FILE=$(PACKAGE).spec -EXTRA_DIST= README NEWS $(SPEC_FILE) idzebra.spec.in idzebra-config.in +EXTRA_DIST= README NEWS $(SPEC_FILE) idzebra.spec.in \ + idzebra-config.in idzebra.m4 dist-hook: cp $(srcdir)/LICENSE* $(distdir) diff --git a/NEWS b/NEWS index 93615f1..877d037 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +Added autoconf utility idzebra.m4 which defines --with-idzebra . + Added mechanism to ignore leading articles when doing full-field indexing, based on the character map files. See the manual for further discussion. diff --git a/idzebra.m4 b/idzebra.m4 new file mode 100644 index 0000000..bf4ad4c --- /dev/null +++ b/idzebra.m4 @@ -0,0 +1,57 @@ +## $Id: idzebra.m4,v 1.1 2004-09-15 09:17:25 adam Exp $ +## +# Use this m4 function for autoconf if you use ID Zebra in your own +# configure script. + +AC_DEFUN([IDZEBRA_INIT], +[ + AC_SUBST(IDZEBRA_LIBS) + AC_SUBST(IDZEBRA_LALIBS) + AC_SUBST(IDZEBRA_CFLAGS) + AC_SUBST(IDZEBRA_VERSION) + idzebraconfig=NONE + idzebrapath=NONE + AC_ARG_WITH(idzebra, [ --with-idzebra=DIR use idzebra-config in DIR (example /home/idzebra-1.4.0)], [idzebrapath=$withval]) + if test "x$idzebrapath" != "xNONE"; then + idzebraconfig=$idzebrapath/idzebra-config + else + if test "x$srcdir" = "x"; then + idzebrasrcdir=. + else + idzebrasrcdir=$srcdir + fi + for i in ${idzebrasrcdir}/../idzebra* ${idzebrasrcdir}/../idzebra ../idzebra* ../zebra; do + if test -d $i; then + if test -r $i/idzebra-config; then + idzebraconfig=$i/idzebra-config + fi + fi + done + if test "x$idzebraconfig" = "xNONE"; then + AC_PATH_PROG(idzebraconfig, idzebra-config, NONE) + fi + fi + AC_MSG_CHECKING(for idzebra) + if $idzebraconfig --version >/dev/null 2>&1; then + IDZEBRA_LIBS=`$idzebraconfig --libs $1` + IDZEBRA_LALIBS=`$idzebraconfig --lalibs $1` + IDZEBRA_CFLAGS=`$idzebraconfig --cflags $1` + IDZEBRA_VERSION=`$idzebraconfig --version` + AC_MSG_RESULT([$idzebraconfig]) + else + AC_MSG_RESULT(Not found) + IDZEBRA_VERSION=NONE + fi + if test "X$IDZEBRA_VERSION" != "XNONE"; then + AC_MSG_CHECKING([for idzebra version]) + AC_MSG_RESULT([$IDZEBRA_VERSION]) + if test "$2"; then + have_idzebra_version=`echo "$IDZEBRA_VERSION" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'` + req_idzebra_version=`echo "$2" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'` + if test "$have_idzebra_version" -lt "$req_idzebra_version"; then + AC_MSG_ERROR([$IDZEBRA_VERSION. Requires $2 or later]) + fi + fi + fi +]) +