diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-09-17 22:27:06 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-09-17 22:28:35 +0200 |
commit | 7fff462959e50ee36b5410f3bf859af9f3e63c0d (patch) | |
tree | 50fe210bea8403d33742ca2aaceef36029ca7c7b | |
parent | 02d811071cf65aefddac5c3c2a0759d3b673e9a7 (diff) |
check make 3.81 for bug 20033 and only disable parallelism if needed
-rwxr-xr-x | configure.in | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/configure.in b/configure.in index 6ea36b4bcd00..75c0385bcb38 100755 --- a/configure.in +++ b/configure.in @@ -2540,7 +2540,41 @@ if test "$_make_longver" -ge "038200" ; then elif test "$_make_longver" -ge "038100" ; then AC_MSG_RESULT([$GNUMAKE $_make_version]) - no_parallelism_make="YES" + AC_MSG_CHECKING([for GNU make bug 20033]) + TESTGMAKEBUG20033=`mktemp -d` + cat > $TESTGMAKEBUG20033/Makefile << EOF +A := \$(wildcard *.a) + +.PHONY: all +all: \$(A:.a=.b) + @echo survived bug20033. + +.PHONY: setup +setup: + @touch 1.a 2.a 3.a 4.a 5.a 6.a + +define d1 +@echo lala \$(1) +@sleep 1 +endef + +define d2 +@echo tyty \$(1) +@sleep 1 +endef + +%.b : %.a + \$(eval CHECKSUM := \$(word 1,\$(shell cat \$^ | sha1sum))) \$(if \$(wildcard \$(CACHEDIR)/\$(CHECKSUM)),\ + \$(call d1,\$(CHECKSUM)),\ + \$(call d2,\$(CHECKSUM))) +EOF + if test -z "`(cd $TESTGMAKEBUG20033 && $GNUMAKE setup && $GNUMAKE -j)|grep survived`"; then + no_parallelism_make="YES" + AC_MSG_RESULT([yes, disable parallelism]) + else + AC_MSG_RESULT([no, keep parallelism enabled]) + fi + rm -rf $TESTGMAKEBUG20033 else AC_MSG_ERROR([failed ($GNUMAKE version >= 3.81 needed]) fi |