]> matita.cs.unibo.it Git - helm.git/blob - helm/minidom/configure.in
ocaml 3.09 transition
[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=4
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, no)
41 if test $XML_CONFIG = "no"; then
42         AC_CHECK_PROG(XML_CONFIG, xml-config, xml-config, no)
43 fi
44 AC_SUBST(XML_CONFIG)
45
46 if test $XML_CONFIG = "no"; then
47         AC_MSG_ERROR(could not find configuration script for libxml)
48 fi
49
50 if test $XML_CONFIG = "xml2-config" -a $libxml2 = "auto"; then
51         libxml2="yes"
52 fi
53
54 CFLAGS="$CFLAGS `$XML_CONFIG --cflags`"
55 CXXFLAGS="$CXXFLAGS `$XML_CONFIG --cflags`"
56 LIBS="$LIBS `$XML_CONFIG --libs`"
57
58 dnl if the user gave no explicit libxml2 option, try to guess its value
59 if test $libxml2 = "auto"; then
60         AC_MSG_CHECKING(for libxml version 2)
61         AC_TRY_COMPILE(
62                 [#include <parser.h>],
63                 [
64                         xmlEntity e;
65                         e.etype = e.etype;
66                 ],
67                 [
68                         AC_DEFINE(HAVE_LIBXML2)
69                         AC_MSG_RESULT(maybe)
70                 ],
71                 AC_MSG_RESULT(no)
72         )
73 elif test $libxml2 = "yes"; then
74         AC_DEFINE(HAVE_LIBXML2)
75 fi
76
77 dnl Checks for header files.
78
79 AC_OUTPUT([
80  Makefile
81  minidom.spec
82 ])