Commit 5a5ceb89 authored by Roland Levillain's avatar Roland Levillain
Browse files

Improve Swilena's configuration.

	* m4/with-swilena.m4: Remove file.
	Supeseded by other tests performed...
	* configure.ac: ...here.
parent 03908bb3
2010-04-09 Roland Levillain <roland@lrde.epita.fr>
Improve Swilena's configuration.
* m4/with-swilena.m4: Remove file.
Supeseded by other tests performed...
* configure.ac: ...here.
2010-04-09 Roland Levillain <roland@lrde.epita.fr>
Require Python >= 2.4 for Swilena.
......
......@@ -111,15 +111,11 @@ fi
# ``--enable-all'' is set and a given feature is disabled (say,
# ``--disable-apps''), then the disable flag has priority.
# FIXME: Due to with-swilena.m4's limitations, we have to explicitly
# enable SWIG. Will be repaired when OLN_WITH_SWILENA is revamped.
AC_ARG_ENABLE([all],
[AS_HELP_STRING([--enable-all],
[enable maintainer mode])],
[
enable_trimesh=yes
with_swig=yes
enable_swilena=yes
dnl<<lrde
enable_scribo=yes
......@@ -184,8 +180,32 @@ AC_CONFIG_SUBDIRS([external/trimesh])
## Swilena. ##
## --------- ##
OLN_WITH_SWILENA([enable_swilena=yes], [])
AM_CONDITIONAL([ENABLE_SWILENA], [test x$enable_swilena = xyes])
AC_ARG_ENABLE([swilena],
[AS_HELP_STRING([--enable-swilena],
[build Swilena Python bindings])])
AS_IF([test "x$enable_swilena" = xyes],
[# Ensure dynamic libraries are enabled.
if test "x$enable_shared" = xno; then
AC_MSG_ERROR([`--enable-swilena' was given, but dynamic libraries are
disabled. Try to invoke configure with `--enable-shared'.])
fi
# Check for SWIG.
AC_PROG_SWIG([1.3.35])
if (eval "$SWIG -version") >/dev/null 2>&1; then :; else
AC_MSG_ERROR([SWIG 1.3.35 is required for Swilena])
fi
# Check for Python.
AM_PATH_PYTHON([2.4], [],
[AC_MSG_ERROR([Python 2.4 is required for Swilena.])])
adl_CHECK_PYTHON
# Check for Python headers.
save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -I$PYTHONINC"
AC_CHECK_HEADERS([Python.h], [],
[AC_MSG_ERROR([`Python.h' is required for Swilena.
Try adding `-I <Python include path>' to `CPPFLAGS'.])])
CPPFLAGS=$save_CPPFLAGS])
AM_CONDITIONAL([ENABLE_SWILENA], [test "x$enable_swilena" = xyes])
AC_CONFIG_FILES([swilena/Makefile
swilena/python/Makefile])
......
# -*- Autoconf -*-
# Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
#
# This file is part of Olena.
#
# Olena is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, version 2 of the License.
#
# Olena 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
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Olena. If not, see <http://www.gnu.org/licenses/>.
# FIXME: Revamp and make it generic, so that it can shared among
# Olena, TC and clspr.
# _OLN_WITH_SWIG(HAS-SWIG, HAS-NOT)
# ---------------------------------
# Check whether SWIG is requested, enabled, or disabled. If
# requested, check that Python is present as needed. If enabled,
# actually enable only if the environment is complete.
AC_DEFUN([_OLN_WITH_SWIG],
# FIXME: `with-swig' used to be set to `auto', but `no' is prefered
# now, as
# 1. users don't necessarily want to build Swilena by default;
# 2. the `auto' flag is not honored by the checks for Python and Ruby.
[AC_ARG_WITH([swig],
[AC_HELP_STRING([--with-swig],
[require SWIG modules (defaults to no)])],
[],
[with_swig=no])
case $with_swig:$enable_shared in
auto:no)
AC_MSG_NOTICE([SWIG use disabled: dynamic libraries disabled])
with_swig=no
;;
esac
if test x$with_swig != xno; then
oln_has_swig=yes
AM_PATH_PYTHON([2.4])
adl_CHECK_PYTHON
# Check for Python and SWIG.
save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -I$PYTHONINC"
AC_CHECK_HEADERS([Python.h],
[python_headers=yes],
[python_headers=no])
if test x$python_headers = xno; then
oln_has_swig=no
if test x$with_swig = xyes; then
AC_MSG_ERROR(
[Python.h is required to build SWIG modules.
Add `-I python_include_path' to `CPPFLAGS'
or `--without-swig' to disable SWIG modules.])
fi
fi
CPPFLAGS=$save_CPPFLAGS
# FIXME: Disabled. Swilena does not support Ruby again (as it used to
# in Olena 0.11). Moreover, the user should be given the choice
# between the front ends (Python, Ruby, etc.); enabling Swilena shall
# not systematically imply compiling the *whole* back ends!
#
# # Check for Ruby.
# AC_CHECK_PROGS([RUBY], [ruby], [$am_aux_dir/missing ruby])
# if test "x$RUBY" = "x$am_aux_dir/missing ruby"; then
# AC_MSG_ERROR([no suitable Ruby interpreter found])
# fi
#
# AC_ARG_VAR([RUBY_CPPFLAGS], [Path to ruby.h])
# AC_ARG_WITH([ruby-includedir], [Include path for ruby.h],
# [RUBY_CPPFLAGS="-I$withval"],
# [RUBY_CPPFLAGS="-I`$RUBY -e 'puts $:.join("\n")' | \
# while read line
# do
# if [[ -f ${line}/ruby.h ]]; then
# echo $line
# fi
# done`"])
# save_CPPFLAGS=$CPPFLAGS
# CPPFLAGS="$CPPFLAGS $RUBY_CPPFLAGS"
# AC_CHECK_HEADERS([ruby.h], [],
# [AC_MSG_ERROR(
# [You need Ruby development files to compile the Ruby interface.])])
# CPPFLAGS=$save_CPPFLAGS
AC_PROG_SWIG([1.3.35])
if (eval "$SWIG -version") >/dev/null 2>&1; then :; else
oln_has_swig=no
fi
case $with_swig:$oln_has_swig in
yes:no)
AC_MSG_ERROR([SWIG 1.3.35 is required.
Use `--without-swig' to disable SWIG modules.]);;
esac
fi
case $oln_has_swig in
yes) $1;;
* ) $2;;
esac
])
# OLN_WITH_SWILENA(WITH, WITHOUT)
# -------------------------------
# Should we build Swilena or not.
AC_DEFUN([OLN_WITH_SWILENA],
[AC_CACHE_CHECK([whether building Swilena],
[oln_cv_with_swilena],
[_OLN_WITH_SWIG([oln_cv_with_swilena=yes],
[oln_cv_with_swilena=no])])
case $oln_cv_with_swilena in
yes) $1;;
no ) $2;;
*) AC_MSG_ERROR([incorrect oln_cv_with_swilena value: $oln_cv_with_swilena]);;
esac
])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment