From 702aaf311d4adab97203fb7eee9856249459a968 Mon Sep 17 00:00:00 2001
From: Markus Blatt <markus@dr-blatt.de>
Date: Tue, 7 Jan 2014 11:40:40 +0100
Subject: [PATCH] [autotools,release] Install autoconf macros to
 $(datadir)/dune/aclocal

Previously, the macros were installed to $(datadir)/aclocal. As we have
some macros in DUNE that are also installed for some Linux distributions
this caused conflicts in package managers. With this patch we install
them to $(datadir)/dune/aclocal to resolve this issue outlined in flyspray
task 1409
https://dune-project.org/flyspray/index.php?do=details&task_id=1409
---
 bin/dunecontrol   | 11 +++++------
 bin/duneproject   |  4 ++--
 m4/CMakeLists.txt |  2 +-
 m4/Makefile.am    |  2 +-
 4 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/bin/dunecontrol b/bin/dunecontrol
index 4e5631413..513ef5b0f 100755
--- a/bin/dunecontrol
+++ b/bin/dunecontrol
@@ -581,12 +581,11 @@ run_default_configure () {
       fi
       if test x$module = x$m; then continue; fi # skip myself
       name=$(eval "echo \$NAME_$m")
-      if test -d "$path/m4"; then
-          ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $path/m4"
-      fi
-      if test -d "$path/share/aclocal"; then
-          ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $path/share/aclocal"
-      fi
+      for dir in $path/m4 $path/share/dune/aclocal $path/share/aclocal; do
+        if test -d "$dir"; then
+            ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $dir"
+        fi
+      done
       if test -d "$path/$BUILDDIR"; then
         PARAMS="$PARAMS \"--with-$name=$path/$BUILDDIR\""
       else
diff --git a/bin/duneproject b/bin/duneproject
index e1bd0ed07..2a00c8422 100755
--- a/bin/duneproject
+++ b/bin/duneproject
@@ -680,7 +680,7 @@ echo "- $PROJECT/m4/Makefile.am"
 cat> "$PROJECT/m4/Makefile.am" << CC_DELIM
 M4FILES = $MODULE.m4
 
-aclocaldir = \$(datadir)/aclocal
+aclocaldir = \$(datadir)/dune/aclocal
 aclocal_DATA = \$(M4FILES)
 
 EXTRA_DIST = \$(M4FILES) CMakeLists.txt
@@ -692,7 +692,7 @@ CC_DELIM
 echo "- $PROJECT/m4/CMakeLists.txt"
 cat> "$PROJECT/m4/CMakeLists.txt" << CC_DELIM
 
-install(PROGRAMS $MODULE.m4 DESTINATION share/aclocal)
+install(PROGRAMS $MODULE.m4 DESTINATION share/dune/aclocal)
 
 CC_DELIM
 
diff --git a/m4/CMakeLists.txt b/m4/CMakeLists.txt
index 671879f35..827c243a8 100644
--- a/m4/CMakeLists.txt
+++ b/m4/CMakeLists.txt
@@ -47,5 +47,5 @@ install(PROGRAMS
         shared_ptr.m4
         umfpack.m4
         xdr.m4
-	DESTINATION share/aclocal
+	DESTINATION share/dune/aclocal
 )
diff --git a/m4/Makefile.am b/m4/Makefile.am
index 259581fe4..62d78d4a1 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -52,7 +52,7 @@ ALLM4S = 					\
         umfpack.m4                              \
 	xdr.m4
 
-aclocaldir = $(datadir)/aclocal
+aclocaldir = $(datadir)/dune/aclocal
 aclocal_DATA = $(ALLM4S)
 
 EXTRA_DIST = CMakeLists.txt $(ALLM4S)
-- 
GitLab