view more/record-commands.sh @ 1836:6477f27294f8 draft 1.4.5

Announce 1.4.4 and mention #toybox channel on freenode (where devs hang out).
author Rob Landley <rob@landley.net>
date Mon, 11 Jan 2016 17:33:47 -0600
parents 8fc7542bc770
children
line wrap: on
line source

#!/bin/bash

source sources/include.sh || exit 1

# Build a wrapper that records each command line the build runs out of the
# host's $PATH, so we know exactly what commands the build uses.

# (Note: this misses things called via absolute paths, such as the #!/bin/bash
# at the start of shell scripts.)

echo "=== Setting up command recording wrapper"

[ -f "$WRAPDIR/wrappy" ] && PATH="$OLDPATH"
[ -f "$HOSTTOOLS/toybox" ] && PATH="$(hosttools_path)"
NO_CLEANUP= blank_tempdir "$WRAPDIR"

# Populate a directory of symlinks with every command in the $PATH.

echo 'Linking $PATH to '$WRAPDIR
path_search "$PATH" "*" 'ln -s wrappy "$WRAPDIR/$FILE"' 2>/dev/null | dotprogress

# Build the wrapper
$CC -Os "$SOURCES/toys/wrappy.c" -o "$WRAPDIR/wrappy"  || dienow