]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/gdome_xslt/configure.ac
* missed some files
[helm.git] / helm / DEVEL / gdome_xslt / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT
3 AC_CONFIG_SRCDIR([C/gdome_xslt/gdome_xslt.h])
4
5 PACKAGE=gdome2-xslt
6 VERSION=0.0.3
7 VERSION_INFO=`echo $VERSION | awk -F. '{ printf "%d:%d:%d", $1+$2, $3, $2 }'`
8 AC_SUBST(VERSION_INFO)
9
10 AC_PROG_CC
11 AC_PROG_CXX
12 AC_PROG_INSTALL
13
14 AC_CONFIG_HEADER([config.h])
15 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
16 AM_PROG_LIBTOOL
17
18 GDOME_CONFIG="gdome-config"
19 GDOME_MIN_VERSION=0.7.0
20 AC_MSG_CHECKING(for Gdome2 libraries >= $GDOME_MIN_VERSION) 
21 if test "x$GDOME_PREFIX" != "x"
22 then
23         if ${GDOME_PREFIX}/bin/$GDOME_CONFIG --version > /dev/null 2>&1
24         then
25                 GDOME_CONFIG=${GDOME_PREFIX}/bin/$GDOME_CONFIG
26         elif ! $GDOME_CONFIG --version > /dev/null 2>&1
27         then
28                 AC_MSG_ERROR(Could not find Gdome2 anywhere (see config.log for details).)
29         fi
30 fi
31
32 vers=`$GDOME_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
33 minvers=`echo $GDOME_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
34 if test "$vers" -ge "$minvers"
35 then
36         GDOME_LIBS="`$GDOME_CONFIG --libs`"
37         GDOME_CFLAGS="`$GDOME_CONFIG --cflags`"
38         AC_MSG_RESULT(found)
39 else
40         AC_MSG_ERROR(You need at least Gdome2 $GDOME_MIN_VERSION for this version of $PACKAGE)
41 fi
42
43 AC_SUBST(GDOME_CFLAGS)
44 AC_SUBST(GDOME_LIBS)
45
46 GMETADOM_CONFIG="gmetadom-config"
47 GMETADOM_MIN_VERSION=0.1.4
48 AC_MSG_CHECKING(for GMetaDOM libraries >= $GMETADOM_MIN_VERSION) 
49 if test "x$GMETADOM_PREFIX" != "x"
50 then
51         if ${GMETADOM_PREFIX}/bin/$GMETADOM_CONFIG --version > /dev/null 2>&1
52         then
53                 GMETADOM_CONFIG=${GMETADOM_PREFIX}/bin/$GMETADOM_CONFIG
54         elif ! $GMETADOM_CONFIG --version > /dev/null 2>&1
55         then
56                 AC_MSG_ERROR(Could not find GMetaDOM anywhere (see config.log for details).)
57         fi
58 fi
59
60 vers=`$GMETADOM_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
61 minvers=`echo $GMETADOM_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
62 if test "$vers" -ge "$minvers"
63 then
64         GMETADOM_LIBS="`$GMETADOM_CONFIG --module=gdome_cpp_smart --libs`"
65         GMETADOM_CFLAGS="`$GMETADOM_CONFIG --module=gdome_cpp_smart --cflags`"
66         AC_MSG_RESULT(found)
67 else
68         AC_MSG_ERROR(You need at least GMetaDOM $GMETADOM_MIN_VERSION for this version of $PACKAGE)
69 fi
70
71 AC_SUBST(GMETADOM_CFLAGS)
72 AC_SUBST(GMETADOM_LIBS)
73
74 LIBXSLT_CONFIG="xslt-config"
75 LIBXSLT_MIN_VERSION=1.0.16
76 AC_MSG_CHECKING(for libxslt libraries >= $LIBXSLT_MIN_VERSION) 
77 if test "x$LIBXSLT_PREFIX" != "x"
78 then
79         if ${LIBXSLT_PREFIX}/bin/$LIBXSLT_CONFIG --version > /dev/null 2>&1
80         then
81                 LIBXSLT_CONFIG=${LIBXSLT_PREFIX}/bin/$LIBXSLT_CONFIG
82         elif ! $LIBXSLT_CONFIG --version > /dev/null 2>&1
83         then
84                 AC_MSG_ERROR(Could not find libxslt anywhere (see config.log for details).)
85         fi
86 fi
87
88 vers=`$LIBXSLT_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
89 minvers=`echo $LIBXSLT_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
90 if test "$vers" -ge "$minvers"
91 then
92         LIBXSLT_LIBS="`$LIBXSLT_CONFIG --libs`"
93         LIBXSLT_CFLAGS="`$LIBXSLT_CONFIG --cflags`"
94         AC_MSG_RESULT(found)
95 else
96         AC_MSG_ERROR(You need at least libxslt $LIBXSLT_MIN_VERSION for this version of $PACKAGE)
97 fi
98
99 AC_SUBST(LIBXSLT_CFLAGS)
100 AC_SUBST(LIBXSLT_LIBS)
101
102 AC_CHECK_PROG(HAVE_OCAMLC, ocamlc, yes, no)
103 if test $HAVE_OCAMLC = "no"; then
104   AC_MSG_ERROR(could not find ocamlc in PATH, please make sure ocaml is installed)
105 fi
106
107 AC_CHECK_PROG(HAVE_OCAMLFIND, ocamlfind, yes, no)
108 if test $HAVE_OCAMLFIND = "no"; then
109   AC_MSG_ERROR(could not find ocamlfind in PATH, please make sure findlib is installed)
110 fi
111
112 AC_MSG_CHECKING(for gdome2 ocaml binding)
113 ocamlfind query gdome2 ||
114   AC_MSG_ERROR(gdome2 not installed (according to findlib))
115
116 AC_MSG_CHECKING(for the ocaml library dir)
117 OCAML_LIB_DIR=`ocamlc -where`
118 AC_MSG_RESULT($OCAML_LIB_DIR)
119
120 AC_CHECK_FILE(/usr/include/caml/mlvalues.h,
121         OCAML_INCLUDE_DIR=/usr/include/caml,
122         OCAML_INCLUDE_DIR=$OCAML_LIB_DIR/caml
123 )
124
125 AC_SUBST(PACKAGE)
126 AC_SUBST(VERSION)
127 AC_SUBST(OCAML_INCLUDE_DIR)
128
129 AC_CONFIG_FILES([
130   Makefile
131   C/Makefile
132   C/gdome_xslt/Makefile
133   C/test/Makefile
134   C++/gdome_xslt/Makefile
135   C++/test/Makefile
136   C++/Makefile
137   C++/gdome_xslt_cpp_smart-config
138   ocaml/Makefile
139   ocaml/gdome_xslt/Makefile
140   ocaml/test/Makefile
141   test_files/Makefile
142   debian/Makefile])
143 AC_CONFIG_COMMANDS([default],[[chmod +x C++/gdome_xslt_cpp_smart-config]],[[]])
144 AC_OUTPUT