[mm-common] Display post-install notice about ACLOCAL_FLAGS



commit 2ccef97c83ccc2d9c72803e3539790e8a9580236
Author: Daniel Elstner <daniel kitta gmail com>
Date:   Thu Dec 31 14:27:52 2009 +0100

    Display post-install notice about ACLOCAL_FLAGS
    
    * Makefile.am (install-data-hook): If mm-common has been installed in
    a different prefix than the system aclocal, print a message to inform
    the installer that it may be necessary to set ACLOCAL_FLAGS.

 Makefile.am |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index e43cb9d..1f09bde 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -122,7 +122,7 @@ else
 check_updates =
 endif
 
-.PHONY: $(check_updates)
+.PHONY: $(check_updates) postinst-acdir-notice
 
 # Avoid shipping partially downloaded files.
 .DELETE_ON_ERROR:
@@ -142,3 +142,19 @@ skeletonmm.tar.gz: $(skeletonmm_files)
 	$(AM_V_GEN)($(srctar_stdout) $(skeletonmm_files)) | gzip -c >$@
 
 include $(top_srcdir)/build/dist-changelog.am
+
+install-data-hook: $(if $(DESTDIR),,postinst-acdir-notice)
+
+# Inform the installer that M4 macro files installed in a prefix
+# not known to aclocal will not be picked up automatically.
+postinst-acdir-notice:
+	@$(POST_INSTALL)
+	@-acdir=`$${ACLOCAL-aclocal} --print-ac-dir 2>/dev/null || :`; \
+	if test "x$$acdir" = 'x$(aclocal_macrodir)'; then :; else \
+	  echo 'NOTICE:'; echo; \
+	  echo 'The $(PACKAGE_NAME) Autoconf macro files have been installed in a different'; \
+	  echo 'prefix than the system aclocal directory.  In order for the installed'; \
+	  echo 'macros to be found, it may be necessary to add the $(PACKAGE_NAME) include'; \
+	  echo 'path to the ACLOCAL_FLAGS environment variable:'; echo; \
+	  echo "  ACLOCAL_FLAGS='-I $(aclocal_macrodir)'; export ACLOCAL_FLAGS"; \
+	fi



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]