]> matita.cs.unibo.it Git - helm.git/blob - helm/minidom/configure.in
Oooops. I have exchanged the targets of the links to the graphs of
[helm.git] / helm / minidom / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(minidom.c)
3
4 MINIDOM_MAJOR_VERSION=0
5 MINIDOM_MINOR_VERSION=1
6 MINIDOM_MICRO_VERSION=2
7 MINIDOM_VERSION=$MINIDOM_MAJOR_VERSION.$MINIDOM_MINOR_VERSION.$MINIDOM_MICRO_VERSION
8 MINIDOM_VERSION_INFO=`expr $MINIDOM_MAJOR_VERSION + $MINIDOM_MINOR_VERSION`:$MINIDOM_MICRO_VERSION:$MINIDOM_MINOR_VERSION
9
10 AC_SUBST(MINIDOM_VERSION)
11 AC_SUBST(MINIDOM_VERSION_INFO)
12
13 AC_ARG_WITH(
14         libxml2,
15         [  --with-libxml2[=ARG]    compile with libxml 2.x library [default=auto]],
16         libxml2=$withval,
17         libxml2="auto"
18 )
19
20 AM_INIT_AUTOMAKE(minidom, $MINIDOM_VERSION)
21 AM_CONFIG_HEADER(config.h)
22 AM_PROG_LIBTOOL
23
24 dnl Checks for programs.
25 AC_PROG_CC
26 AC_LANG_C
27 AC_PROG_RANLIB
28
29 dnl Checks for libraries.
30 AC_CHECK_LIB(glib, g_malloc,
31         [
32                 CFLAGS="$CFLAGS `glib-config --cflags`"
33                 CXXFLAGS="$CXXFLAGS `glib-config --cflags`"
34                 LIBS="$LIBS `glib-config --libs`"
35         ],
36         AC_MSG_ERROR(cound not find glib),
37         `glib-config --libs`
38 )
39
40 AC_CHECK_PROG(XML_CONFIG, xml2-config, xml2-config)
41 AC_CHECK_PROG(XML_CONFIG, xml-config, xml-config, no)
42 AC_SUBST(XML_CONFIG)
43
44 if test $XML_CONFIG = "no"; then
45         AC_MSG_ERROR(could not find configuration script for libxml)
46 fi
47
48 if test $XML_CONFIG = xml2-config -a libxml2 = "auto"; then
49         libxml2="yes"
50 fi
51
52 CFLAGS="$CFLAGS `$XML_CONFIG --cflags`"
53 CXXFLAGS="$CXXFLAGS `$XML_CONFIG --cflags`"
54 LIBS="$LIBS `$XML_CONFIG --libs`"
55
56 dnl if the user gave no explicit libxml2 option, try to guess its value
57 if test $libxml2 = "auto"; then
58         AC_MSG_CHECKING(for libxml version 2)
59         AC_TRY_COMPILE(
60                 [#include <parser.h>],
61                 [
62                         xmlEntity e;
63                         e.etype = e.etype;
64                 ],
65                 [
66                         AC_DEFINE(HAVE_LIBXML2)
67                         AC_MSG_RESULT(maybe)
68                 ],
69                 AC_MSG_RESULT(no)
70         )
71 elif test $libxml2 = "yes"; then
72         AC_DEFINE(HAVE_LIBXML2)
73 fi
74
75 dnl Checks for header files.
76
77 AC_OUTPUT([
78  Makefile
79  minidom.spec
80 ])