1 dnl Process this file with autoconf to produce a configure script.
3 AC_CONFIG_SRCDIR([C/gdome_xslt/gdome_xslt.h])
7 VERSION_INFO=`echo $VERSION | awk -F. '{ printf "%d:%d:%d", $1+$2, $3, $2 }'`
12 [ --with-gmetadom-prefix=PFX prefix dir where gmetadom is installed],
14 with_gmetadom_prefix=yes
15 GMETADOM_PREFIX=$withval
18 with_gmetadom_prefix=no
24 [ --with-gdome-prefix=PFX prefix dir where gdome is installed],
38 AM_CONFIG_HEADER(config.h)
39 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
42 GDOME_CONFIG="gdome-config"
43 GDOME_MIN_VERSION=0.7.0
44 AC_MSG_CHECKING(for Gdome2 libraries >= $GDOME_MIN_VERSION)
45 if test "x$GDOME_PREFIX" != "x"
47 if ${GDOME_PREFIX}/bin/$GDOME_CONFIG --version > /dev/null 2>&1
49 GDOME_CONFIG=${GDOME_PREFIX}/bin/$GDOME_CONFIG
50 elif ! $GDOME_CONFIG --version > /dev/null 2>&1
52 AC_MSG_ERROR(Could not find Gdome2 anywhere (see config.log for details).)
56 vers=`$GDOME_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
57 minvers=`echo $GDOME_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
58 if test "$vers" -ge "$minvers"
60 GDOME_LIBS="`$GDOME_CONFIG --libs`"
61 GDOME_CFLAGS="`$GDOME_CONFIG --cflags`"
64 AC_MSG_ERROR(You need at least Gdome2 $GDOME_MIN_VERSION for this version of $PACKAGE)
67 AC_SUBST(GDOME_CFLAGS)
70 GMETADOM_CONFIG="gmetadom-config"
71 GMETADOM_MIN_VERSION=0.1.4
72 AC_MSG_CHECKING(for GMetaDOM libraries >= $GMETADOM_MIN_VERSION)
73 if test "x$GMETADOM_PREFIX" != "x"
75 if ${GMETADOM_PREFIX}/bin/$GMETADOM_CONFIG --version > /dev/null 2>&1
77 GMETADOM_CONFIG=${GMETADOM_PREFIX}/bin/$GMETADOM_CONFIG
78 elif ! $GMETADOM_CONFIG --version > /dev/null 2>&1
80 AC_MSG_ERROR(Could not find GMetaDOM anywhere (see config.log for details).)
84 vers=`$GMETADOM_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
85 minvers=`echo $GMETADOM_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
86 if test "$vers" -ge "$minvers"
88 GMETADOM_LIBS="`$GMETADOM_CONFIG --module=gdome_cpp_smart --libs`"
89 GMETADOM_CFLAGS="`$GMETADOM_CONFIG --module=gdome_cpp_smart --cflags`"
92 AC_MSG_ERROR(You need at least GMetaDOM $GMETADOM_MIN_VERSION for this version of $PACKAGE)
95 AC_SUBST(GMETADOM_CFLAGS)
96 AC_SUBST(GMETADOM_LIBS)
98 LIBXSLT_CONFIG="xslt-config"
99 LIBXSLT_MIN_VERSION=1.0.16
100 AC_MSG_CHECKING(for libxslt libraries >= $LIBXSLT_MIN_VERSION)
101 if test "x$LIBXSLT_PREFIX" != "x"
103 if ${LIBXSLT_PREFIX}/bin/$LIBXSLT_CONFIG --version > /dev/null 2>&1
105 LIBXSLT_CONFIG=${LIBXSLT_PREFIX}/bin/$LIBXSLT_CONFIG
106 elif ! $LIBXSLT_CONFIG --version > /dev/null 2>&1
108 AC_MSG_ERROR(Could not find libxslt anywhere (see config.log for details).)
112 vers=`$LIBXSLT_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
113 minvers=`echo $LIBXSLT_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
114 if test "$vers" -ge "$minvers"
116 LIBXSLT_LIBS="`$LIBXSLT_CONFIG --libs`"
117 LIBXSLT_CFLAGS="`$LIBXSLT_CONFIG --cflags`"
120 AC_MSG_ERROR(You need at least libxslt $LIBXSLT_MIN_VERSION for this version of $PACKAGE)
123 AC_SUBST(LIBXSLT_CFLAGS)
124 AC_SUBST(LIBXSLT_LIBS)
126 AC_CHECK_PROG(HAVE_OCAMLC, ocamlc, yes, no)
127 if test $HAVE_OCAMLC = "no"; then
128 AC_MSG_ERROR(could not find ocamlc in PATH, please make sure ocaml is installed)
131 OCAMLSTDLIBDIR="`ocamlc -where`"
132 OCAMLSTUBDIR="`ocamlc -where`/stublibs"
134 AC_SUBST(OCAMLSTDLIBDIR)
135 AC_SUBST(OCAMLSTUBDIR)
138 AC_CHECK_PROG(HAVE_OCAMLOPT, ocamlopt, yes, no)
139 if test $HAVE_OCAMLOPT = "no"; then
140 AC_MSG_WARN(ocaml native libraries won't be compiled since ocamlopt was not found)
145 AM_CONDITIONAL(HAVE_OCAMLOPT_COND, test x$HAVE_OCAMLOPT = xyes)
147 AC_CHECK_PROG(HAVE_OCAMLFIND, ocamlfind, yes, no)
148 if test $HAVE_OCAMLFIND = "no"; then
149 AC_MSG_ERROR(could not find ocamlfind in PATH, please make sure findlib is installed)
155 AC_CHECK_PROG(HAVE_OCAMLDEP, ocamldep, yes, no)
156 if test $HAVE_OCAMLDEP = "yes"; then
161 AC_CHECK_PROG(HAVE_OCAMLMKLIB, ocamlmklib, yes, no)
162 if test $HAVE_OCAMLMKLIB = "no"; then
163 AC_MSG_ERROR(could not find ocamlmklib in PATH, please make sure ocamlmklib is installed)
165 OCAMLMKLIB=ocamlmklib
169 AC_MSG_CHECKING(for gdome2 ocaml binding)
170 ocamlfind query gdome2 ||
171 AC_MSG_ERROR(gdome2 not installed (according to findlib))
172 MLGDOME_CFLAGS="`$OCAMLFIND query -i-format gdome2`"
173 AC_SUBST(MLGDOME_CFLAGS)
175 AC_MSG_CHECKING(for the ocaml library dir)
176 OCAML_LIB_DIR=`ocamlc -where`
177 AC_MSG_RESULT($OCAML_LIB_DIR)
179 AC_CHECK_FILE(/usr/include/caml/mlvalues.h,
180 OCAML_INCLUDE_DIR=/usr/include/caml,
181 OCAML_INCLUDE_DIR=$OCAML_LIB_DIR/caml
186 AC_SUBST(OCAML_INCLUDE_DIR)
191 C/gdome_xslt/Makefile
193 C++/gdome_xslt/Makefile
197 ocaml/gdome_xslt/Makefile
198 ocaml/gdome_xslt/META
200 gdome_xslt_cpp_smart-config
201 test_files/Makefile])
202 AC_CONFIG_COMMANDS([default],[[chmod +x gdome_xslt_cpp_smart-config]],[[]])