Source

clutter-ocaml / configure.ac

# clutter-ocaml
# Copyright (C) 2008 Reid van Melle
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA

dnl Process this file with autoconf to produce a configure script.

AC_INIT(clutter-ocaml,0.1)
# AC_CONFIG_MACRO_DIR ([m4])
m4_include([pkgconfig.m4])

PKG_PROG_PKG_CONFIG([0.22])

AC_PROG_INSTALL

# Look for gtk2, and cairo using pkg-config
#PKG_CHECK_MODULES([GTK2], [gtk+-2.0 >= 2.12.0])
#PKG_CHECK_MODULES([CAIRO], [cairo >= 1.4.8])
#PKG_CHECK_MODULES([GTHREAD2], [gthread-2.0 >= 2.14.1])
PKG_CHECK_MODULES(CLUTTER, clutter-0.8 >= 0.8)
PKG_CHECK_MODULES(CLUTTER_CAIRO, clutter-cairo-0.8 >= 0.8)

dnl Check for basic OCaml environment & findlib.
AC_PROG_OCAML
AC_PROG_FINDLIB
AC_PROG_CAMLP4O

#if test "x$CAMLP4O" = "x"; then
#   AC_MSG_ERROR([OCAMLP4O is required])
#fi

#if test "x$OCAMLFIND" = "x"; then
#    AC_MSG_ERROR([OCaml findlib is required])
#fi

dnl Use ocamlfind to find the required packages ...

dnl Check for required OCaml packages.
AC_CHECK_OCAML_PKG(bigarray)
if test "x$pkg_bigarray" != "xyes"; then
    AC_MSG_ERROR([Cannot find required OCaml package 'bigarray'])
fi

AC_CHECK_OCAML_PKG(cairo)
if test "x$pkg_cairo" != "xyes"; then
    AC_MSG_ERROR([Cannot find required OCaml package 'cairo'])
fi

AC_CHECK_OCAML_PKG(lablgtk2)
if test "x$pkg_lablgtk2" != "xyes"; then
    AC_MSG_ERROR([Cannot find required OCaml package 'lablgtk2'])
fi

AC_SUBST(pkg_unix)
AC_SUBST(pkg_bigarray)
AC_SUBST(pkg_cairo)
AC_SUBST(pkg_lablgtk2)

dnl Summary.
echo "------------------------------------------------------------"
echo "Thanks for downloading" $PACKAGE_STRING
echo "------------------------------------------------------------"

dnl Produce output files.
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile
	Make.rules
	src/Makefile
	tests/Makefile
	examples/Makefile
	])
AC_OUTPUT