aboutsummaryrefslogtreecommitdiffstats
path: root/aclocal.m4
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2009-07-02 18:19:10 -0400
committerTheodore Ts'o <tytso@mit.edu>2009-07-02 18:19:10 -0400
commitbcb915b0d0018e19c7e67beeb32d212fd4bb0b85 (patch)
tree5db25c600b81126f7b458f39b236c3d25a64dfcf /aclocal.m4
parent3a4d9869d47c462c84688b0f8b15df5ab6f93381 (diff)
downloadandroid_external_e2fsprogs-bcb915b0d0018e19c7e67beeb32d212fd4bb0b85.tar.gz
android_external_e2fsprogs-bcb915b0d0018e19c7e67beeb32d212fd4bb0b85.tar.bz2
android_external_e2fsprogs-bcb915b0d0018e19c7e67beeb32d212fd4bb0b85.zip
Enhance build system so that "make V=1" works like the Linux Kernel
If gmake is available, the developer can use "make V=1" instead of using a configure-time switch, --enable-verbose-makecmds, to see all of the commands executed by the Makefile. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m481
1 files changed, 81 insertions, 0 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 3c32c839..6fd4652c 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -2694,3 +2694,84 @@ if test -n "$PKG_CONFIG"; then
fi[]dnl
])# PKG_PROG_PKG_CONFIG
+# ===========================================================================
+# http://www.nongnu.org/autoconf-archive/check_gnu_make.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# CHECK_GNU_MAKE()
+#
+# DESCRIPTION
+#
+# This macro searches for a GNU version of make. If a match is found, the
+# makefile variable `ifGNUmake' is set to the empty string, otherwise it
+# is set to "#". This is useful for including a special features in a
+# Makefile, which cannot be handled by other versions of make. The
+# variable _cv_gnu_make_command is set to the command to invoke GNU make
+# if it exists, the empty string otherwise.
+#
+# Here is an example of its use:
+#
+# Makefile.in might contain:
+#
+# # A failsafe way of putting a dependency rule into a makefile
+# $(DEPEND):
+# $(CC) -MM $(srcdir)/*.c > $(DEPEND)
+#
+# @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
+# @ifGNUmake@ include $(DEPEND)
+# @ifGNUmake@ endif
+#
+# Then configure.in would normally contain:
+#
+# CHECK_GNU_MAKE()
+# AC_OUTPUT(Makefile)
+#
+# Then perhaps to cause gnu make to override any other make, we could do
+# something like this (note that GNU make always looks for GNUmakefile
+# first):
+#
+# if ! test x$_cv_gnu_make_command = x ; then
+# mv Makefile GNUmakefile
+# echo .DEFAULT: > Makefile ;
+# echo \ $_cv_gnu_make_command \$@ >> Makefile;
+# fi
+#
+# Then, if any (well almost any) other make is called, and GNU make also
+# exists, then the other make wraps the GNU make.
+#
+# LICENSE
+#
+# Copyright (c) 2008 John Darrington <j.darrington@elvis.murdoch.edu.au>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+#
+# Note: Modified by Ted Ts'o to add @ifNotGNUMake@
+
+AC_DEFUN(
+ [CHECK_GNU_MAKE], [ AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
+ _cv_gnu_make_command='' ;
+dnl Search all the common names for GNU make
+ for a in "$MAKE" make gmake gnumake ; do
+ if test -z "$a" ; then continue ; fi ;
+ if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ) ; then
+ _cv_gnu_make_command=$a ;
+ break;
+ fi
+ done ;
+ ) ;
+dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise
+ if test "x$_cv_gnu_make_command" != "x" ; then
+ ifGNUmake='' ;
+ ifNotGNUmake='#' ;
+ else
+ ifGNUmake='#' ;
+ ifNotGNUmake='' ;
+ AC_MSG_RESULT("Not found");
+ fi
+ AC_SUBST(ifGNUmake)
+ AC_SUBST(ifNotGNUmake)
+] )