]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
testrun.sh: Implement --tool=strace, --tool=valgrind
authorFlorian Weimer <fweimer@redhat.com>
Wed, 4 Jul 2018 13:27:24 +0000 (15:27 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Wed, 4 Jul 2018 13:30:45 +0000 (15:30 +0200)
$(file …) appears to be the only convenient way to create files
with newlines and make substitution variables.  This needs make 4.0
(released in 2013), so update the requirement to match.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
ChangeLog
INSTALL
Makefile
NEWS
configure
configure.ac
manual/install.texi

index c17caff776a6779089ff60d820957410a90b367a..a8b15be55ff2f9e84361c6c489a97834024bce2c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2018-07-04  Florian Weimer  <fweimer@redhat.com>
+
+       testrun.sh: Implement --tool=strace, --tool=valgrind
+       * Makefile (testrun-script): Define variable.
+       (testrun.sh): Use variable.
+       * manual/install.texi (Tools for Compilation): make 4.0 or later
+       is required.
+       * configure.ac: Check for make 4.0 or later.
+       * INSTALL: Regenerate.
+       * configure: Likewise.
+
 2018-07-04  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
        [BZ #23233]
diff --git a/INSTALL b/INSTALL
index 0a22aa7d01e6e87b35a93bca7c1656e4196be221..3c656fb7a67e56135f8fa374c2f1cf23b66b2a84 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -426,13 +426,7 @@ Recommended Tools for Compilation
 We recommend installing the following GNU tools before attempting to
 build the GNU C Library:
 
-   * GNU 'make' 3.79 or newer
-
-     You need the latest version of GNU 'make'.  Modifying the GNU C
-     Library to work with other 'make' programs would be so difficult
-     that we recommend you port GNU 'make' instead.  *Really.*  We
-     recommend GNU 'make' version 3.79.  All earlier versions have
-     severe bugs or lack features.
+   * GNU 'make' 4.0 or newer
 
    * GCC 4.9 or newer
 
index bea4e27f8db4981dbd0eb39e06b4f6297cb5179d..d3f25a525a5db3123dddc9db3e80dea8f4931e28 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -128,17 +128,60 @@ ifeq (yes,$(build-shared))
 lib: $(common-objpfx)libc.so $(common-objpfx)linkobj/libc.so
 endif # $(build-shared)
 
+# Used to build testrun.sh.
+define testrun-script
+#!/bin/bash
+builddir=`dirname "$$0"`
+GCONV_PATH="$${builddir}/iconvdata"
+
+usage () {
+  echo "usage: $$0 [--tool=strace] PROGRAM [ARGUMENTS...]" 2>&1
+  echo "       $$0 --tool=valgrind PROGRAM [ARGUMENTS...]" 2>&1
+}
+
+toolname=default
+while test $$# -gt 0 ; do
+  case "$$1" in
+    --tool=*)
+      toolname="$${1:7}"
+      shift
+      ;;
+    --*)
+      usage
+      ;;
+    *)
+      break
+      ;;
+  esac
+done
+
+if test $$# -eq 0 ; then
+  usage
+fi
+
+case "$$toolname" in
+  default)
+    exec $(subst $(common-objdir),"$${builddir}", $(test-program-prefix)) \
+      $${1+"$$@"}
+    ;;
+  strace)
+    exec strace $(patsubst %, -E%, $(run-program-env)) \
+      $(test-via-rtld-prefix) $${1+"$$@"}
+    ;;
+  valgrind)
+    exec env $(run-program-env) valgrind $(test-via-rtld-prefix) $${1+"$$@"}
+    ;;
+  *)
+    usage
+    ;;
+esac
+endef
 
 # This is a handy script for running any dynamically linked program against
 # the current libc build for testing.
 $(common-objpfx)testrun.sh: $(common-objpfx)config.make \
                            $(..)Makeconfig $(..)Makefile
-       (echo '#!/bin/sh'; \
-        echo 'builddir=`dirname "$$0"`'; \
-        echo 'GCONV_PATH="$${builddir}/iconvdata" \'; \
-        echo 'exec $(subst $(common-objdir),"$${builddir}",\
-                           $(test-program-prefix)) $${1+"$$@"}'; \
-       ) > $@T
+       $(file >$@T, $(testrun-script))
        chmod a+x $@T
        mv -f $@T $@
 postclean-generated += testrun.sh
diff --git a/NEWS b/NEWS
index 21b457a0503a26b1edb04ec0a6767b63d578e07c..b1ce067d27cab22f75108ffea4962f713aacf268 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -154,7 +154,7 @@ Deprecated and removed features, and other changes affecting compatibility:
 
 Changes to build and runtime requirements:
 
-  [Add changes to build and runtime requirements here]
+  GNU make 4.0 or later is now required to build glibc.
 
 Security related changes:
 
index ef1830221522b7a5e3496ddd6aa212aec7e0b5b1..eac7f292b4f0d10d992ab0c0608c5fc8c952b71a 100755 (executable)
--- a/configure
+++ b/configure
@@ -4705,7 +4705,7 @@ $as_echo_n "checking version of $MAKE... " >&6; }
   ac_prog_version=`$MAKE --version 2>&1 | sed -n 's/^.*GNU Make[^0-9]*\([0-9][0-9.]*\).*$/\1/p'`
   case $ac_prog_version in
     '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
-    3.79* | 3.[89]* | [4-9].* | [1-9][0-9]*)
+    [4-9].* | [1-9][0-9]*)
        ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
     *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
 
index dc517017f588626a99ac42bb6ae66c6b19c06792..f41ed6decb71ab0eb7bdf904e1948260d9573f2c 100644 (file)
@@ -945,7 +945,7 @@ fi
 AC_CHECK_TOOL_PREFIX
 AC_CHECK_PROG_VER(MAKE, gnumake gmake make, --version,
   [GNU Make[^0-9]*\([0-9][0-9.]*\)],
-  [3.79* | 3.[89]* | [4-9].* | [1-9][0-9]*], critic_missing="$critic_missing make")
+  [[4-9].* | [1-9][0-9]*], critic_missing="$critic_missing make")
 
 AC_CHECK_PROG_VER(MSGFMT, gnumsgfmt gmsgfmt msgfmt, --version,
   [GNU gettext.* \([0-9]*\.[0-9.]*\)],
index 422da1447eb4dc684e377a29e329f904b22dfd09..42e9954199ffc18a40b2e10cedf1a37ded09060a 100644 (file)
@@ -473,13 +473,7 @@ build @theglibc{}:
 
 @itemize @bullet
 @item
-GNU @code{make} 3.79 or newer
-
-You need the latest version of GNU @code{make}.  Modifying @theglibc{}
-to work with other @code{make} programs would be so difficult that
-we recommend you port GNU @code{make} instead.  @strong{Really.}  We
-recommend GNU @code{make} version 3.79.  All earlier versions have severe
-bugs or lack features.
+GNU @code{make} 4.0 or newer
 
 @item
 GCC 4.9 or newer