root/libswish3/trunk/configure.ac

Revision 2090, 1.7 kB (checked in by karpet, 2 months ago)

xapian example

Line 
1 AC_INIT([libswish3], [0.1.0],
2         [Peter Karman <peter@peknet.com>],
3         [libswish3])
4 AM_INIT_AUTOMAKE
5 AM_CONFIG_HEADER(src/acconfig.h)
6 AC_PROG_CC
7 AC_PROG_INSTALL
8 AC_CONFIG_FILES([
9                 Makefile
10                 src/Makefile
11                 src/libswish3/Makefile
12                 src/xapian/Makefile
13                 doc/Makefile
14                 libswish3.pc
15                 libswish3-config
16                 ])
17                
18 dnl libxml2 required to build
19
20 LIBXML_REQUIRED_VERSION=2.6.0
21 XML2_CONFIG_PATH=$PATH
22 AC_PATH_PROG(XML2_CONFIG, xml2-config,"no", $XML2_CONFIG_PATH)               
23 if test "$XML2_CONFIG" = "no"; then
24     withval="no"
25 else
26     withval=`$XML2_CONFIG --prefix`
27 fi
28
29 if test "$withval" = "no"; then
30     AC_MSG_RESULT([libxml2 required])
31 else
32
33     AC_SUBST(LIBXML_REQUIRED_VERSION)
34     AC_MSG_CHECKING(for libxml2 libraries >= $LIBXML_REQUIRED_VERSION)
35
36     AC_DEFUN([VERSION_TO_NUMBER],
37     [`$1 | sed -e 's/libxml //' | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`])
38
39     vers=VERSION_TO_NUMBER($XML2_CONFIG --version)
40     XML2_VERSION=`$XML2_CONFIG --version`
41
42     if test "$vers" -ge VERSION_TO_NUMBER(echo $LIBXML_REQUIRED_VERSION);then
43         AC_MSG_RESULT(found version $XML2_VERSION)
44     else
45         AC_MSG_ERROR(You need at least libxml2 $LIBXML_REQUIRED_VERSION for this version of libswish3)
46     fi
47
48
49     AC_DEFINE(HAVE_LIBXML2,[],[Libxml2 support included])
50
51 fi
52
53 dnl Check pod2man for creating man pages
54 AC_CHECK_PROG([POD2MAN], [pod2man], [pod2man], [false])
55 if test "$POD2MAN" = "false"; then
56     dnl disable building of man pages?
57     AC_MSG_WARN([pod2man was not found - needed for building man pages])
58 fi
59
60                
61 AC_PROG_LIBTOOL
62 AC_PROG_MAKE_SET
63 AC_OUTPUT
Note: See TracBrowser for help on using the browser.