* build-aux/trimesh.m4: New.
* configure.ac: Invoke OLN_WITH_TRIMESH.
(WITH_TRIMESH): New conditional.
* external/Makefile.am (SUBDIRS) [!WITH_TRIMESH]: Empty.
(SUBDIRS) [WITH_TRIMESH]: Add trimesh.
---
ChangeLog | 10 ++++++++++
build-aux/trimesh.m4 | 18 ++++++++++++++++++
configure.ac | 7 ++++++-
external/Makefile.am | 6 +++++-
4 files changed, 39 insertions(+), 2 deletions(-)
create mode 100644 build-aux/trimesh.m4
diff --git a/ChangeLog b/ChangeLog
index 3b3abe3..b9e7166 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2009-02-03 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Make the building of the bundled Trimesh library optional.
+
+ * build-aux/trimesh.m4: New.
+ * configure.ac: Invoke OLN_WITH_TRIMESH.
+ (WITH_TRIMESH): New conditional.
+ * external/Makefile.am (SUBDIRS) [!WITH_TRIMESH]: Empty.
+ (SUBDIRS) [WITH_TRIMESH]: Add trimesh.
+
2009-02-03 Guillaume Lazzara <z(a)lrde.epita.fr>
* configure.ac: Configure milena/tests/convert/impl.
diff --git a/build-aux/trimesh.m4 b/build-aux/trimesh.m4
new file mode 100644
index 0000000..11d8ca6
--- /dev/null
+++ b/build-aux/trimesh.m4
@@ -0,0 +1,18 @@
+# -*- Autoconf -*-
+
+# OLN_WITH_TRIMESH(WITH, WITHOUT)
+# -------------------------------
+# Should we build Trimesh or not.
+AC_DEFUN([OLN_WITH_TRIMESH],
+[AC_ARG_WITH([trimesh],
+ [AS_HELP_STRING([--with-trimesh],
+ [build the Trimesh library])],
+ [],
+ [with_trimesh=no])
+
+case $with_trimesh in
+ yes) $1;;
+ no ) $2;;
+ *) AC_MSG_ERROR([incorrect with_trimesh value: $with_trimesh]);;
+esac
+])
diff --git a/configure.ac b/configure.ac
index d54fb41..64de029 100644
--- a/configure.ac
+++ b/configure.ac
@@ -108,7 +108,11 @@ AM_CONDITIONAL([DARWIN], [echo "$host_os" | grep
'^darwin'])
# (Bundled) trimesh2 library.
-AC_CONFIG_SUBDIRS([external/trimesh])
+OLN_WITH_TRIMESH
+if test x$with_trimesh = xyes; then
+ AC_CONFIG_SUBDIRS([external/trimesh])
+fi
+AM_CONDITIONAL([WITH_TRIMESH], [test x$with_trimesh = xyes])
# FreeImage library.
OLN_WITH_FREEIMAGEPLUS
@@ -260,6 +264,7 @@ AC_CONFIG_FILES([
## Applications. ##
## -------------- ##
+# FIXME: Don't build applications depending on Trimesh if Trimesh is not built.
# Ask for the creation of applications' Makefiles.
# FIXME: Should it be achieved through oln.m4 macros, as we did in Olena 0.11?
# FIXME: ENABLE IT
diff --git a/external/Makefile.am b/external/Makefile.am
index 52bd3ff..e01abab 100644
--- a/external/Makefile.am
+++ b/external/Makefile.am
@@ -1,3 +1,7 @@
## Process this file through Automake to produce Makefile.in -*- Makefile -*-
-SUBDIRS = trimesh
+SUBDIRS =
+
+if WITH_TRIMESH
+ SUBDIRS += trimesh
+endif WITH_TRIMESH
--
1.6.1.2