view more/record-commands.sh @ 1679:f63305aa4961

Reorder library paths in ccwrap (command line -L goes before system -L) and make sure crt1.o is before command line files because some crazy packages *cough*busybox*cough* put main in an *.a static library, which is sensitive to link order.
author Rob Landley <rob@landley.net>
date Thu, 04 Sep 2014 00:27:36 -0500
parents f0315ac24c40
children e4ff2cf4ac62
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)"
blank_tempdir "$WRAPDIR"

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

path_search "$PATH" "*" 'ln -s wrappy "$WRAPDIR/$FILE"' | dotprogress

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