• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

.github/09-Jun-2024-192131

build-aux/09-Jun-2024-320246

doc/09-Jun-2024-22,35918,089

gl/09-Jun-2024-3,6752,260

gnulib/09-Jun-2024-

gnulib-tests/09-Jun-2024-218

lib/09-Jun-2024-8650

m4/09-Jun-2024-497419

man/09-Jun-2024-2,2511,800

po/09-Jun-2024-147143

scripts/09-Jun-2024-1,6071,263

src/09-Jun-2024-92,68066,724

tests/09-Jun-2024-61,44530,730

.gitattributesD09-Jun-2024309 107

.gitignoreD09-Jun-20243.3 KiB218217

.gitmodulesD09-Jun-2024101 43

.mailmapD09-Jun-20241.8 KiB4538

.prev-versionD09-Jun-20244 21

.vg-suppressionsD09-Jun-20241.9 KiB10192

.x-update-copyrightD09-Jun-202470 65

AUTHORSD09-Jun-20243.7 KiB116113

COPYINGD09-Jun-202434.3 KiB675553

HACKINGD09-Jun-202423.3 KiB627477

Makefile.amD09-Jun-20247.9 KiB217142

NEWSD09-Jun-2024238.5 KiB5,8144,151

READMED09-Jun-20246.5 KiB142108

README-hackingD09-Jun-20244.2 KiB11882

README-installD09-Jun-20244.3 KiB11284

README-package-renamed-to-coreutilsD09-Jun-2024544 1410

README-prereqD09-Jun-20241.8 KiB4236

README-releaseD09-Jun-20245 KiB14697

README-valgrindD09-Jun-20241.8 KiB5520

THANKS.inD09-Jun-202437.6 KiB680677

THANKStt.inD09-Jun-2024121 53

TODOD09-Jun-20246.5 KiB160119

bootstrapD09-Jun-202450.5 KiB1,5351,047

bootstrap.confD09-Jun-20247.5 KiB423368

cfg.mkD09-Jun-202436.1 KiB932612

configure.acD09-Jun-202424.5 KiB712631

dist-check.mkD09-Jun-20244.5 KiB134101

init.cfgD09-Jun-202421.6 KiB793688

thanks-genD09-Jun-2024441 178

README

1These are the GNU core utilities.  This package is the union of
2the GNU fileutils, sh-utils, and textutils packages.
3
4Most of these programs have significant advantages over their Unix
5counterparts, such as greater speed, additional options, and fewer
6arbitrary limits.
7
8The programs that can be built with this package are:
9
10  [ arch b2sum base32 base64 basename basenc cat chcon chgrp chmod chown
11  chroot cksum comm coreutils cp csplit cut date dd df dir dircolors dirname
12  du echo env expand expr factor false fmt fold groups head hostid hostname
13  id install join kill link ln logname ls md5sum mkdir mkfifo mknod mktemp
14  mv nice nl nohup nproc numfmt od paste pathchk pinky pr printenv printf ptx
15  pwd readlink realpath rm rmdir runcon seq sha1sum sha224sum sha256sum
16  sha384sum sha512sum shred shuf sleep sort split stat stdbuf stty sum sync
17  tac tail tee test timeout touch tr true truncate tsort tty uname unexpand
18  uniq unlink uptime users vdir wc who whoami yes
19
20See the file NEWS for a list of major changes in the current release.
21
22If you obtained this file as part of a "git clone", then see the
23README-hacking file.  If this file came to you as part of a tar archive,
24then see the file INSTALL for general compilation and installation
25instructions, or README-install for system and coreutils specific instructions.
26
27Like the rest of the GNU system, these programs mostly conform to
28POSIX, with BSD and other extensions.  For closer conformance, or
29conformance to a particular POSIX version, set the POSIXLY_CORRECT
30and the _POSIX2_VERSION environment variables, as described in
31the documentation under "Standards conformance".
32
33The ls, dir, and vdir commands are all separate executables instead of
34one program that checks argv[0] because people often rename these
35programs to things like gls, gnuls, l, etc.  Renaming a program
36file shouldn't affect how it operates, so that people can get the
37behavior they want with whatever name they want.
38
39Special thanks to Paul Eggert, Brian Matthews, Bruce Evans, Karl Berry,
40Kaveh Ghazi, and François Pinard for help with debugging and porting
41these programs.  Many thanks to all of the people who have taken the
42time to submit problem reports and fixes.  All contributed changes are
43attributed in the commit logs.
44
45And thanks to the following people who have provided accounts for
46portability testing on many different types of systems: Bob Proulx,
47Christian Robert, François Pinard, Greg McGary, Harlan Stenn,
48Joel N. Weber, Mark D. Roth, Matt Schalit, Nelson H. F. Beebe,
49Réjean Payette, Sam Tardieu.
50
51Thanks to Michael Stone for inflicting test releases of this package
52on Debian's unstable distribution, and to all the kind folks who used
53that distribution and found and reported bugs.
54
55Note that each man page is now automatically generated from a template
56and from the corresponding --help usage message.  Patches to the template
57files (man/*.x) are welcome.  However, the authoritative documentation
58is in texinfo form in the doc directory.
59
60
61***************
62Feature requests:
63---------------
64
65If you would like to add a new feature, please try to get some sort of
66consensus that it is a worthwhile change.  One way to do that is to send
67mail to coreutils@gnu.org including as much description and justification
68as you can.  Based on the feedback that generates, you may be able to
69convince us that it's worth adding.  Please also consult the list of
70previously discussed but ultimately rejected feature requests at:
71https://www.gnu.org/software/coreutils/rejected_requests.html
72
73
74***************
75Reporting bugs:
76---------------
77
78Send bug reports, questions, comments, etc. to bug-coreutils@gnu.org.
79To suggest a patch, see the files README-hacking and HACKING for tips.
80
81All of these programs except 'test' recognize the '--version' option.
82When reporting bugs, please include in the subject line both the package
83name/version and the name of the program for which you found a problem.
84
85If you have a problem with 'sort', try running 'sort --debug', as it
86can often help find and fix problems without having to wait for an
87answer to a bug report.  If the debug output does not suffice to fix
88the problem on your own, please compress and attach it to the rest of
89your bug report.
90
91IMPORTANT: if you take the time to report a test failure,
92please be sure to include the output of running 'make check'
93in verbose mode for each failing test.  For example,
94if the test that fails is tests/df/df-P.sh, then you would
95run this command:
96
97  make check TESTS=tests/df/df-P.sh VERBOSE=yes SUBDIRS=. >> log 2>&1
98
99For some tests, particularly perl tests, you can get even more detail by adding
100DEBUG=yes. Then include the contents of the file 'log' in your bug report.
101
102
103***************************************
104
105There are many tests, but nowhere near as many as we need.
106Additions and corrections are very welcome.
107
108If you see a problem that you've already reported, feel free to re-report
109it -- it won't bother us to get a reminder.  Besides, the more messages we
110get regarding a particular problem the sooner it'll be fixed -- usually.
111If you sent a complete patch and, after a couple weeks you haven't
112received any acknowledgement, please ping us.  A complete patch includes
113a well-written ChangeLog entry, unified (diff -u format) diffs relative
114to the most recent test release (or, better, relative to the latest
115sources in the public repository), an explanation for why the patch is
116necessary or useful, and if at all possible, enough information to
117reproduce whatever problem prompted it.  Plus, you'll earn lots of
118karma if you include a test case to exercise any bug(s) you fix.
119Here are instructions for checking out the latest development sources:
120
121  https://savannah.gnu.org/git/?group=coreutils
122
123For general documentation on the coding and usage standards
124this distribution follows, see the GNU Coding Standards at:
125https://www.gnu.org/prep/standards/
126
127For any copyright year range specified as YYYY-ZZZZ in this package
128note that the range specifies every single year in that closed interval.
129
130Please see the file COPYING for copying conditions.
131
132========================================================================
133
134Copyright (C) 1998-2023 Free Software Foundation, Inc.
135
136Permission is granted to copy, distribute and/or modify this document
137under the terms of the GNU Free Documentation License, Version 1.3 or
138any later version published by the Free Software Foundation; with no
139Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
140Texts.  A copy of the license is included in the "GNU Free
141Documentation License" file as part of this distribution.
142

README-hacking

1Building from a Git repository				-*- outline -*-
2
3These notes intend to help people working on the checked-out sources.
4These requirements do not apply when building from a distribution tarball.
5If this package has a file HACKING, please also read that file for
6more detailed contribution guidelines.
7
8* Requirements
9
10We've opted to keep only the highest-level sources in the Git repository.
11This eases our maintenance burden (fewer merges etc.), but imposes more
12requirements on anyone wishing to build from the just-checked-out sources.
13(The requirements to build from a release are much less and are just
14the requirements of the standard './configure && make' procedure.)
15Specific development tools and versions will be checked for and listed by
16the bootstrap script.  See README-prereq for specific notes on obtaining
17these prerequisite tools.
18
19Valgrind <https://valgrind.org/> is also highly recommended, if
20Valgrind supports your architecture.  See also README-valgrind
21(if present).
22
23While building from a just-cloned source tree may require installing a
24few prerequisites, later, a plain 'git pull && make' typically suffices.
25
26* First Git checkout
27
28You can get a copy of the source repository like this:
29
30        $ git clone https://git.savannah.gnu.org/git/<packagename>
31        $ cd <packagename>
32
33where '<packagename>' stands for 'coreutils' or whatever other package
34you are building.
35
36To use the most-recent Gnulib (as opposed to the Gnulib version that
37the package last synchronized to), do this next:
38
39        $ git submodule foreach git pull origin master
40        $ git commit -m 'build: update gnulib submodule to latest' gnulib
41
42As an optional step, if you already have a copy of the Gnulib Git
43repository, then you can use it as a reference to reduce download
44time and file system space requirements:
45
46        $ export GNULIB_SRCDIR=/path/to/gnulib
47
48The next step is to get and check other files needed to build,
49which are extracted from other source packages:
50
51        $ ./bootstrap
52
53And there you are!  Just
54
55        $ ./configure --quiet #[--disable-gcc-warnings] [*]
56        $ make
57        $ make check
58
59At this point, there should be no difference between your local copy,
60and the Git master copy:
61
62        $ git diff
63
64should output no difference.
65
66Enjoy!
67
68[*] By default GCC warnings are enabled when building from Git.
69If you get warnings with recent GCC and Glibc with default
70configure-time options, please report the warnings to the bug
71reporting address of this package instead of to bug-gnulib,
72even if the problem seems to originate in a Gnulib-provided file.
73If you get warnings with other configurations, you can run
74'./configure --disable-gcc-warnings' or 'make WERROR_CFLAGS='
75to build quietly or verbosely, respectively.
76-----
77
78* Submitting patches
79
80If you develop a fix or a new feature, please send it to the
81appropriate bug-reporting address as reported by the --help option of
82each program.  One way to do this is to use vc-dwim
83<https://www.gnu.org/software/vc-dwim/>), as follows.
84
85  Run the command "vc-dwim --initialize" from the top-level directory
86  of this package's git-cloned hierarchy.
87
88  Edit the (empty) ChangeLog file that this command creates, creating a
89  properly-formatted entry according to the GNU coding standards
90  <https://www.gnu.org/prep/standards/html_node/Change-Logs.html>.
91
92  Make your changes.
93
94  Run the command "vc-dwim" and make sure its output (the diff of all
95  your changes) looks good.
96
97  Run "vc-dwim --commit".
98
99  Run the command "git format-patch --stdout -1", and email its output
100  in, using the output's subject line.
101
102-----
103
104Copyright (C) 2002-2023 Free Software Foundation, Inc.
105
106This program is free software: you can redistribute it and/or modify
107it under the terms of the GNU General Public License as published by
108the Free Software Foundation, either version 3 of the License, or
109(at your option) any later version.
110
111This program is distributed in the hope that it will be useful,
112but WITHOUT ANY WARRANTY; without even the implied warranty of
113MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
114GNU General Public License for more details.
115
116You should have received a copy of the GNU General Public License
117along with this program.  If not, see <https://www.gnu.org/licenses/>.
118

README-install

1Please see the file INSTALL for generic build and installation instructions.
2This file details coreutils and system specific build instructions.
3
4
5*********************
6Pre-C99 build failure
7---------------------
8
9In 2009 we added this requirement:
10To build the coreutils from source, you must have a C99-conforming
11compiler, due to the use of declarations after non-declaration statements
12in several files in src/.  There is code in configure to find and, if
13possible, enable an appropriate compiler.  However, if configure doesn't
14find a C99 compiler, it continues nonetheless, and your build will fail.
15There used to be a "c99-to-c89.diff" patch you could apply to convert
16to code that even an old pre-c99 compiler can handle, but it was too
17tedious to maintain, so has been removed.
18
19
20***********************
21HPUX 11.x build failure
22-----------------------
23
24A known problem exists when compiling on HPUX on both hppa and ia64
25in 64-bit mode (i.e., +DD64) on HP-UX 11.0, 11.11, and 11.23.  This
26is not due to a bug in the package but instead due to a bug in the
27system header file which breaks things in 64-bit mode.  The default
28compilation mode is 32-bit and the software compiles fine using the
29default mode.  To build this software in 64-bit mode you will need
30to fix the system /usr/include/inttypes.h header file.  After
31correcting that file the software also compiles fine in 64-bit mode.
32Here is one possible patch to correct the problem:
33
34--- /usr/include/inttypes.h.orig	Thu May 30 01:00:00 1996
35+++ /usr/include/inttypes.h	Sun Mar 23 00:20:36 2003
36@@ -489 +489 @@
37-#ifndef __STDC_32_MODE__
38+#ifndef __LP64__
39
40
41************************
42OSF/1 4.0d and AIX build failures
43------------------------
44
45If you use /usr/bin/make on these systems, the build will fail due
46to the presence of the "[" target.  OSF/1 make(1) appears to
47treat "[" as some syntax relating to locks, while AIX make(1)
48appears to skip the "[" target.  To work around these issues
49the best solution is to use GNU make.  Otherwise, simply remove
50all mention of "[$(EXEEXT)" from src/Makefile.
51
52
53************************
5432 bit time_t build failures
55------------------------
56
57Although 32-bit builds fail if that forces time_t to be 32 bits, this
58can be fixed by using 64-bit builds.  For example, on AIX where GCC
59defaults to 32 bits, one can use "./configure CC='gcc -maix64' AR='ar
60-X64'"; similarly, on Solaris one can configure with CC='gcc -m64'.
61If all else fails one can configure with --disable-year2038;
62however, this will mishandle timestamps after 2038, and please file
63bug reports for any such situations.
64
65
66*************************************************
67"make check" failure on IRIX 6.5 and Solaris <= 9
68-------------------------------------------------
69
70Using the vendor make program to run "make check" fails on these two systems.
71If you want to run all of the tests there, use GNU make.
72
73
74
75**********************
76Running tests as root:
77----------------------
78
79If you run the tests as root, note that a few of them create files
80and/or run programs as a non-root user, 'nobody' by default.
81If you want to use some other non-root username, specify it via
82the NON_ROOT_USERNAME environment variable.  Depending on the
83permissions with which the working directories have been created,
84using 'nobody' may fail, because that user won't have the required
85read and write access to the build and test directories.
86I find that it is best to unpack and build as a non-privileged
87user, and then to run the following command as that user in order
88to run the privilege-requiring tests:
89
90  sudo env PATH="$PATH" NON_ROOT_USERNAME=$USER make -k check-root
91
92If you can run the tests as root, please do so and report any
93problems.  We get much less test coverage in that mode, and it's
94arguably more important that these tools work well when run by
95root than when run by less privileged users.
96
97
98
99**********************
100autotools considerations:
101----------------------
102
103WARNING:  Now that we use the ./bootstrap script, you should not run
104autoreconf manually.  Doing that will overwrite essential source files
105with older versions, which may make the package unbuildable or introduce
106subtle bugs.
107
108WARNING:  If you modify files like configure.in, m4/*.m4, aclocal.m4,
109or any Makefile.am, then don't be surprised if what gets regenerated no
110longer works.  To make things work, you'll have to be using appropriate
111versions of the tools listed in bootstrap.conf's buildreq string.
112

README-package-renamed-to-coreutils

1On 2002-09-01, the GNU fileutils, textutils, and sh-utils
2packages were merged into one, called the GNU coreutils.
3See https://www.gnu.org/software/coreutils/coreutils.html for a description.
4Here's the FAQ list:
5
6  https://www.gnu.org/software/coreutils/faq/
7
8For information on the mailing lists associated with the
9coreutils package, including archive locations, see these:
10
11  https://lists.gnu.org/mailman/listinfo/coreutils-announce
12  https://lists.gnu.org/mailman/listinfo/bug-coreutils
13  https://lists.gnu.org/mailman/listinfo/coreutils
14

README-prereq

1This gives some notes on obtaining the tools required for development.
2These tools can be used by the 'bootstrap' and 'configure' scripts,
3as well as by 'make'.  They include:
4
5- Autoconf   <https://www.gnu.org/software/autoconf/>
6- Automake   <https://www.gnu.org/software/automake/>
7- Bison      <https://www.gnu.org/software/bison/>
8- Gettext    <https://www.gnu.org/software/gettext/>
9- Git        <https://git-scm.com/>
10- Gperf      <https://www.gnu.org/software/gperf/>
11- Gzip       <https://www.gnu.org/software/gzip/>
12- Help2man   <https://www.gnu.org/software/help2man/>
13- M4         <https://www.gnu.org/software/m4/>
14- Make       <https://www.gnu.org/software/make/>
15- Perl       <https://www.cpan.org/>
16- Tar        <https://www.gnu.org/software/tar/>
17- Texinfo    <https://www.gnu.org/software/texinfo/>
18- Wget       <https://www.gnu.org/software/wget/>
19- XZ Utils   <https://tukaani.org/xz/>
20
21It is generally better to use official packages for your system.
22If a package is not officially available you can build it from source
23and install it into a directory that you can then use to build this
24package.  If some packages are available but are too old, install the
25too-old versions first as they may be needed to build newer versions.
26
27Here is an example of how to build a program from source.  This
28example is for Autoconf; a similar approach should work for the other
29developer prerequisites.  This example assumes Autoconf 2.71; it
30should be OK to use a later version of Autoconf, if available.
31
32  prefix=$HOME/prefix   # (or wherever else you choose)
33  export PATH=$prefix/bin:$PATH
34  wget https://ftp.gnu.org/pub/gnu/autoconf/autoconf-2.71.tar.gz
35  gzip -d <autoconf-2.71.tar.gz | tar xf -
36  cd autoconf-2.71
37  ./configure --prefix=$prefix
38  make install
39
40Once the prerequisites are installed, you can build this package as
41described in README-hacking.
42

README-release

1Here are most of the steps we (maintainers) follow when making a release.
2
3* start from a clean, up-to-date git directory.
4
5    git checkout master; git pull
6
7* Run ./configure && make maintainer-clean
8
9* Ensure that the desired versions of autoconf, automake, bison, etc.
10  are in your PATH.  See the buildreq list in bootstrap.conf for
11  the complete list.
12
13* Ensure that you're on "master" with no uncommitted diffs.
14  This should produce no output: git checkout master; git diff
15
16* Ensure that you've pushed all changes that belong in the release
17  and that the NixOS/Hydra autobuilder is reporting all is well:
18
19      https://hydra.nixos.org/jobset/gnu/coreutils-master
20
21* Run bootstrap one last time.  This downloads any new translations:
22
23    ./bootstrap
24
25FIXME: enable excluded programs like arch? to get their manual pages?
26
27* Check for new file system types by running the following command on
28  a system with the most recent kernel possible (e.g., Fedora rawhide):
29
30    make src/fs-magic-compare
31
32  Or download the latest header first like:
33
34    kgit='https://git.kernel.org/cgit/linux/kernel/git'
35    wget -q $kgit/torvalds/linux.git/plain/include/uapi/linux/magic.h \
36      -O src/fs-latest-magic.h
37
38  If it finds a new file system magic number, add it to src/stat.c.
39  If it is a remote file system tag it as such.
40
41  Note there may be some new file systems magic values not defined
42  in that linux/magic.h file, which can be seen at:
43
44    https://www.livegrep.com/search/linux\
45    ?q=%23define+.*_SUPER_MAGIC+-file%3Amagic\.h
46
47
48* Pre-release testing:
49
50  Run the following on at least one SELinux-enabled (enforcing) and
51  one non-SELinux system:
52
53    n=$(( ($(nproc) + 1) / 2 ))
54    sudo env PATH="$PATH" NON_ROOT_USERNAME=$USER \
55      make -k -j$(nproc) check-root SUBDIRS=. \
56      && make distcheck \
57      && make -j$n check RUN_VERY_EXPENSIVE_TESTS=yes RUN_EXPENSIVE_TESTS=yes
58
59  If testing on systems with a non standard default shell, spurious failures
60  may occur.  Often there are other shells available, and you can select
61  those by using for example, SHELL=bash in the commands above.
62
63  Note that the use of -j$n tells make to use approximately half of the
64  available processing units.  If you use -jN, for larger N, some of the
65  expensive tests are likely to interfere with concurrent performance-measuring
66  or timing-sensitive tests, resulting in spurious failures.
67
68  If "make distcheck" doesn't run "make syntax-check" for you, then run
69  it manually:
70
71    make syntax-check
72
73* To set the date, version number, and release type [stable/alpha/beta] on
74  line 3 of NEWS, commit that, and tag the release; run:
75
76    build-aux/do-release-commit-and-tag X.Y stable
77
78* Run the following to create release tarballs.  Your choice selects the
79  corresponding upload-to destination in the emitted gnupload command.
80  The different destinations are specified in cfg.mk.  See the definitions
81  of gnu_ftp_host-{alpha,beta,stable}.
82
83    # "TYPE" must be stable, beta or alpha
84    make TYPE
85
86* Test the tarball.  copy it to a few odd-ball systems and ensure that
87  it builds and passes all tests.
88
89* While that's happening, write the release announcement that you will
90  soon post.  Start with the template, $HOME/announce-coreutils-X.Y
91  that was just created by that "make" command.
92
93  For generating counts use:
94   oldrel=$(cat .prev-version)
95   printf "There have been %d commits by %d people %s\n" \
96     $(($(git log --oneline v$oldrel.. | wc -l) - 3))    \
97     $(git shortlog v$oldrel.. | grep "^[^ ]" | wc -l)   \
98     "in the [X] weeks since $oldrel"
99
100   git shortlog v$oldrel.. | sed -n 's/:$//p' |
101   sed 's/^/  /' | column -c 70 | expand
102
103Once all the builds and tests have passed,
104
105* Run the gnupload command that was suggested by your "make stable" run above.
106
107* Wait a few minutes (maybe up to 30?) and then use the release URLs to
108  download all tarball/signature pairs and use gpg --verify to ensure
109  that they're all valid.
110
111* Push the NEWS-updating changes and the new tag:
112
113    v=$(cat .prev-version)
114    git push origin master tag v$v
115
116* Announce it on Savannah first, so you can include the preferable
117  savannah.org announcement link in the email message.
118
119  From here:
120    https://savannah.gnu.org/projects/coreutils/
121  click on the "submit news", then write something like the following:
122  (If there is no such button, then enable "News" for the project via
123   the Main -> "Select Features" menu item, or via this link:
124   https://savannah.gnu.org/project/admin/editgroupfeatures.php?group=coreutils)
125
126    Subject: coreutils-X.Y released [stable]
127    +verbatim+
128    ...paste the announcement here...
129    -verbatim-
130
131  Then go here to approve it:
132    https://savannah.gnu.org/news/approve.php?group=coreutils
133
134* Send the announcement email message (signed with the release key)
135
136* Approve the announcement here:
137  https://lists.gnu.org/mailman/admindb/coreutils-announce
138
139* After each non-alpha release, update the on-line manual accessible via
140
141    https://www.gnu.org/software/coreutils/manual/
142
143  by running this:
144
145    build-aux/gnu-web-doc-update --mirror
146

README-valgrind

1#! /bin/bash
2# Convert this package for use with valgrind.
3
4# Copyright (C) 2002-2023 Free Software Foundation, Inc.
5
6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation, either version 3 of the License, or
9# (at your option) any later version.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14# GNU General Public License for more details.
15
16# You should have received a copy of the GNU General Public License
17# along with this program.  If not, see <https://www.gnu.org/licenses/>.
18
19
20
21# Convert Makefile.am files:
22#  find tests -name check.mk | xargs grep -wl PATH |
23#    xargs perl -pi -e 's,src(\$\(PATH_SEPARATOR\)),src/vg$1,'
24# To restore:
25#  find tests -name check.mk | xargs grep -wl PATH |
26#    xargs perl -pi -e 's,src/vg,src,'
27#
28# Create this symlink for suppressions (this is no longer necessary,
29# with Linux kernel 2.6.9 and valgrind-2.2.0):
30# ln -s $PWD/.vg-suppressions /tmp/cu-vg
31
32
33# Create src/vg:
34
35coreutils=$(echo 'spy:;@echo $(all_programs) $(noinst_PROGRAMS)' |
36            (cd src; make -f Makefile -f - spy | tr -s '\n ' '  '))
37mkdir -p src/vg
38pwd=`pwd`
39srcdir=$pwd/src
40_path='export PATH='$srcdir':${PATH#*:}'
41pre='#!/bin/sh\n'"$_path"'\n'
42n=15 # stack trace depth
43log_fd=3 # One can redirect this to file like 3>vg.log
44test -e /tmp/cu-vg && suppressions='--suppressions=/tmp/cu-vg'
45vg="exec /usr/bin/valgrind $suppressions --log-fd=$log_fd \
46--leak-check=yes --track-fds=yes --leak-check=full --num-callers=$n"
47cat <<EOF > src/vg/gen
48for i in $coreutils; do
49  printf "$pre$vg -- \$i"' "\$@"\n' > \$i
50  chmod a+x \$i
51done
52EOF
53cd src/vg
54. ./gen
55