summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2015-01-14 08:03:56 -0600
committerNorbert Thiebaud <nthiebaud@gmail.com>2015-01-14 08:03:56 -0600
commit186e577630b649999fc20f8a856b1dfa1f118684 (patch)
tree42ca717333fd23f64c3048ea914186443ac8a35c
parent088d47921c083f67e8fe1e1d8361014b32cbd292 (diff)
detect Make 4.0 and use -O on make invocation if it is the case
-rw-r--r--tb/tb_internals.sh9
-rw-r--r--tb/tb_phases.sh8
2 files changed, 13 insertions, 4 deletions
diff --git a/tb/tb_internals.sh b/tb/tb_internals.sh
index 028e99a..11aef67 100644
--- a/tb/tb_internals.sh
+++ b/tb/tb_internals.sh
@@ -201,6 +201,10 @@ determine_make()
if [ -n "$MAKE" ] ; then
$MAKE --version 2> /dev/null | grep -q GNU
if test $? -eq 0; then
+ $MAKE --version 2> /dev/null | grep -q GNU | grep -q '4\.'
+ if test $? -eq 0; then
+ tb_MAKE_EXTRA_OPT="-O"
+ fi
return
else
MAKE=
@@ -216,6 +220,11 @@ determine_make()
done
if [ -z "$MAKE" ] ; then
die "Could not find a Gnu Make"
+ else
+ $MAKE --version 2> /dev/null | grep -q GNU | grep -q '4\.'
+ if test $? -eq 0; then
+ tb_MAKE_EXTRA_OPT="-O"
+ fi
fi
}
diff --git a/tb/tb_phases.sh b/tb/tb_phases.sh
index 20e4409..e224ad5 100644
--- a/tb/tb_phases.sh
+++ b/tb/tb_phases.sh
@@ -71,7 +71,7 @@ pre_clean()
canonical_do_clean()
{
if [ "${R}" = "0" ] ; then
- if ! ${TB_NICE} ${TB_WATCHDOG} ${MAKE?} MAKE_RESTARTS=1 -sr clean > "tb_${P?}_clean.log" 2>&1 ; then
+ if ! ${TB_NICE} ${TB_WATCHDOG} ${MAKE?} MAKE_RESTARTS=1 -sr $tb_MAKE_EXTRA_OPT clean > "tb_${P?}_clean.log" 2>&1 ; then
tb_REPORT_LOG="tb_${P?}_clean.log"
tb_REPORT_MSGS="cleaning up failed - error is:"
R=1
@@ -97,7 +97,7 @@ local optdir=""
if [ "${R}" = "0" ] ; then
# we for MAKE_RESTARTS=1 because 1/ we know thta Makefile is up to date
# and 2/ the 'restart' mechanism in make is messed-up by the fact that we trap SIGINT
- if ! ${TB_NICE} ${TB_WATCHDOG} ${MAKE?} MAKE_RESTARTS=1 -sr > "tb_${P?}_build.log" 2>&1 ; then
+ if ! ${TB_NICE} ${TB_WATCHDOG} ${MAKE?} MAKE_RESTARTS=1 -sr $tb_MAKE_EXTRA_OPT > "tb_${P?}_build.log" 2>&1 ; then
tb_REPORT_LOG="tb_${P?}_build.log"
tb_REPORT_MSGS="build failed - error is:"
[ $V ] && echo "make failed :"
@@ -106,7 +106,7 @@ local optdir=""
else
# if we want to populate bibisect we need to 'install'
if [ "${TB_TYPE?}" = "tb" -a ${TB_BIBISECT} != "0" ] ; then
- if ! ${TB_NICE} ${TB_WATCHDOG} ${MAKE?} MAKE_RESTARTS=1 -sr install-tb >>"tb_${P?}_build.log" 2>&1 ; then
+ if ! ${TB_NICE} ${TB_WATCHDOG} ${MAKE?} MAKE_RESTARTS=1 -sr $tb_MAKE_EXTRA_OPT install-tb >>"tb_${P?}_build.log" 2>&1 ; then
tb_REPORT_LOG="tb_${P}_build.log"
tb_REPORT_MSGS="build failed - error is:"
R=1
@@ -153,7 +153,7 @@ canonical_do_test()
{
if [ "${R}" = "0" ] ; then
if [ "${TB_DO_TESTS}" = "1" ] ; then
- if ! ${TB_NICE} ${TB_WATCHDOG} ${MAKE?} MAKE_RESTARTS=1 -sr check > "tb_${P?}_tests.log" 2>&1 ; then
+ if ! ${TB_NICE} ${TB_WATCHDOG} ${MAKE?} MAKE_RESTARTS=1 -sr $tb_MAKE_EXTRA_OPT check > "tb_${P?}_tests.log" 2>&1 ; then
tb_REPORT_LOG="tb_${P?}_tests.log"
tb_REPORT_MSGS="check failed - error is:"
R=1