summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2011-08-19 18:29:07 -0500
committerNorbert Thiebaud <nthiebaud@gmail.com>2011-08-19 18:29:07 -0500
commitd64bbd6bf8d41604e3f14f911f2169f4295e4d99 (patch)
treed937d231126f8f7edea0734be6c2ce8f2f4e9347 /configure.in
parent3c880648fb99b0f7d276dd2ef1eaf99127a85c46 (diff)
detect gmake 3.81 and limit to -j1 unless num-cpu is explicitly set
Diffstat (limited to 'configure.in')
-rwxr-xr-xconfigure.in30
1 files changed, 27 insertions, 3 deletions
diff --git a/configure.in b/configure.in
index cbd835c7e2eb..536ca8ba5e27 100755
--- a/configure.in
+++ b/configure.in
@@ -2443,8 +2443,12 @@ fi
AC_MSG_CHECKING([the GNU make version])
_make_version=`$GNUMAKE --version | grep GNU | grep -v GPL | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`;
_make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
-if test "$_make_longver" -ge "038100" ; then
+if test "$_make_longver" -ge "038200" ; then
AC_MSG_RESULT([$GNUMAKE $_make_version])
+
+elif test "$_make_longver" -ge "038100" ; then
+ AC_MSG_RESULT([$GNUMAKE $_make_version])
+ no_parallelism_make="YES"
else
AC_MSG_ERROR([failed ($GNUMAKE version >= 3.81 needed])
fi
@@ -9080,7 +9084,7 @@ AC_MSG_RESULT([$BUILD_MAX_JOBS])
AC_SUBST(BUILD_MAX_JOBS)
# =====================================================================
-# determine the parallelism for tail_build
+# determine the parallelism for gnu make
# =====================================================================
AC_MSG_CHECKING([for maximum parallelism for gmake])
if test $BUILD_MAX_JOBS -gt $BUILD_NCPUS ; then
@@ -9088,8 +9092,28 @@ if test $BUILD_MAX_JOBS -gt $BUILD_NCPUS ; then
else
GMAKE_PARALLELISM="$BUILD_NCPUS"
fi
-AC_MSG_RESULT([$GMAKE_PARALLELISM])
+GMAKE_MODULE_PARALLELISM="$BUILD_NCPUS"
+if test "$no_parallelism_make" = "YES" ; then
+ if test -z "$with_num_cpus"; then
+ GMAKE_PARALLELISM="1";
+ if test $GMAKE_MODULE_PARALLELISM -gt 1 ; then
+ AC_MSG_WARN([gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this.])
+ if test -z "$with_num_cpus"; then
+ echo "gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this." >> warn
+ fi
+ GMAKE_MODULE_PARALLELISM="1"
+ fi
+ else
+ GMAKE_PARALLELISM="$BUILD_NCPUS";
+ echo "make 3.81 is prone to crashes with parallelism > 1. Since --with-num-cpu was explicitely given, it is honored, but do not complain when make segfault on you." >> warn
+ fi
+fi
+
+# GMAKE_PARALLELISM is used in tail_build
+# GMAKE_MODULE_PARALLELISM is used when building individual gbuildified module
+AC_MSG_RESULT([per module:$GMAKE_MODULE_PARALLELISM, for tail_build:$GMAKE_PARALLELISM])
AC_SUBST(GMAKE_PARALLELISM)
+AC_SUBST(GMAKE_MODULE_PARALLELISM)
dnl ===================================================================
dnl Setting up the environment.