From 2d84bdae78ab92a396e6d877cc58d40ecf5f2a49 Mon Sep 17 00:00:00 2001
From: Christian Engwer <christi@dune-project.org>
Date: Fri, 11 Dec 2009 14:08:13 +0000
Subject: [PATCH] move libtool-1.5 compatibility stuff to a seperate m4 file

[[Imported from SVN: r5771]]
---
 m4/dune_all.m4      |  9 +++------
 m4/libtoolcompat.m4 | 14 ++++++++++++++
 2 files changed, 17 insertions(+), 6 deletions(-)
 create mode 100644 m4/libtoolcompat.m4

diff --git a/m4/dune_all.m4 b/m4/dune_all.m4
index eb2100a17..5b9ecf48e 100644
--- a/m4/dune_all.m4
+++ b/m4/dune_all.m4
@@ -19,20 +19,17 @@ AC_DEFUN([DUNE_CHECK_ALL],[
   AS_IF([test "x$enabledist" = "xyes"],[
     AM_CONDITIONAL(DUNEWEB, false)])
 
-  dnl check the compilers
+  # check the compilers (before using libtool !!!)
   AC_REQUIRE([PKG_PROG_PKG_CONFIG])
   AC_REQUIRE([AC_PROG_CC])
   AC_REQUIRE([AC_PROG_CPP])
   AC_REQUIRE([AC_PROG_CXX])
   AC_REQUIRE([AC_PROG_CXXCPP])
   AC_REQUIRE([AC_PROG_F77])
+  AC_REQUIRE([LT_COMPAT])
+  # we need libtool
   AC_REQUIRE([AC_PROG_LIBTOOL])
   # don't build shared libs per default, this is way better for debugging...
-  m4_ifdef([LT_INIT], [],
-  [
-    AC_DEFUN([LT_OUTPUT])
-    AC_DEFUN([LT_INIT], [AC_DISABLE_SHARED])
-  ])
   LT_INIT([disable-shared])
 
   dnl check dependencies of this module
diff --git a/m4/libtoolcompat.m4 b/m4/libtoolcompat.m4
new file mode 100644
index 000000000..89b015970
--- /dev/null
+++ b/m4/libtoolcompat.m4
@@ -0,0 +1,14 @@
+dnl Compatibility m4 to make dune work with
+dnl libtool 1.5 and libtool 2.x
+
+AC_DEFUN([LT_COMPAT],[
+  # LT_COMPAT
+  m4_ifdef([LT_INIT],[],
+  [ 
+    # call AC_DISABLE_SHARED
+    AC_DISABLE_SHARED
+    # fake LT_INIT and LT_OUTPUT
+    AC_DEFUN([LT_INIT])
+    AC_DEFUN([LT_OUTPUT])
+  ])
+])
-- 
GitLab