diff options
author | John Wiegley <johnw@newartisans.com> | 2009-03-09 03:30:23 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-03-09 21:51:02 -0400 |
commit | e0473e207b299858ef9550ed71be125a9db994ac (patch) | |
tree | c465423f60a66fe739b52a713dea700e86e926d5 /tools | |
parent | 6154b9e794942bae557516a358e1bc3d665b60db (diff) | |
download | fork-ledger-e0473e207b299858ef9550ed71be125a9db994ac.tar.gz fork-ledger-e0473e207b299858ef9550ed71be125a9db994ac.tar.bz2 fork-ledger-e0473e207b299858ef9550ed71be125a9db994ac.zip |
Rewrote acprep in Python and improved the build
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/build | 22 | ||||
-rwxr-xr-x | tools/myacprep | 48 | ||||
-rwxr-xr-x | tools/outdir | 12 | ||||
-rwxr-xr-x | tools/pre-commit | 32 | ||||
-rwxr-xr-x | tools/proof | 69 |
5 files changed, 11 insertions, 172 deletions
diff --git a/tools/build b/tools/build deleted file mode 100755 index d2753a11..00000000 --- a/tools/build +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -set -e - -SRCDIR=$(pwd) -OUTPUT=$(tools/outdir) -SWITCHES="" - -if [ -n "$OUTPUT" -a -d "$OUTPUT" ]; then - cd "$OUTPUT" - SWITCHES="--output $OUTPUT" -fi - -if [ ! -f Makefile -o \ - $SRCDIR/Makefile.am -nt Makefile -o \ - $SRCDIR/configure.ac -nt Makefile -o \ - $SRCDIR/acprep -nt Makefile -o \ - $SRCDIR/myacprep -nt Makefile ]; then - (cd $SRCDIR && tools/myacprep "$SWITCHES") -fi - -make "$@" diff --git a/tools/myacprep b/tools/myacprep deleted file mode 100755 index 5f25a5c7..00000000 --- a/tools/myacprep +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh - -OUTPUT=$(tools/outdir) -PRODUCTS=$(dirname "$OUTPUT") -SWITCHES="--pch --warn --devel --debug" - -while [ -n "$1" ]; do - case "$1" in - --local) - SWITCHES="$SWITCHES --local" - shift 1 ;; - --output) - shift 1 - SWITCHES="$SWITCHES --output $1" - shift 1 ;; - --gprof) - SWITCHES="$1 --release --pch" - SWITCHES="$SWITCHES --output $PRODUCTS/ledger-gprof" - shift 1 ;; - --gcov) - SWITCHES="$1 --release --pch" - SWITCHES="$SWITCHES --output $PRODUCTS/ledger-gcov" - shift 1 ;; - --opt) - SWITCHES="$1 --release --pch --warn" - SWITCHES="$SWITCHES --output $PRODUCTS/ledger-opt" - shift 1 ;; - --debug) - SWITCHES="$1 --pch --warn --devel" - SWITCHES="$SWITCHES --output $PRODUCTS/ledger-debug" - shift 1 ;; - --std) - SWITCHES="--release --pch --warn" - SWITCHES="$SWITCHES --output $PRODUCTS/ledger-std" - shift 1 ;; - *) - SWITCHES="$SWITCHES $1" - shift 1 ;; - esac -done - -if [ -n "$OUTPUT" ]; then - if echo "$SWITCHES" | egrep -qv '(output|local)'; then - SWITCHES="$SWITCHES --output $OUTPUT" - fi -fi - -./acprep $SWITCHES diff --git a/tools/outdir b/tools/outdir deleted file mode 100755 index 3c51e354..00000000 --- a/tools/outdir +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -PRODUCTS=$HOME/Products - -SRCDIR=$(pwd) -BASE=$(basename "$SRCDIR") - -OUTPUT="$PRODUCTS/$BASE" - -if [ -d "$OUTPUT" ]; then - echo $OUTPUT -fi diff --git a/tools/pre-commit b/tools/pre-commit index b04b895c..b3bc2e2b 100755 --- a/tools/pre-commit +++ b/tools/pre-commit @@ -1,30 +1,18 @@ #!/bin/sh -"$(tg --hooks-path)"/pre-commit "$@" || exit $? +# Exit with status 1 if any command below fails +set -e +# Exit if it's not a branch we're interested in being thorough about if echo $(git rev-parse --symbolic-full-name HEAD) | grep -q ^refs/heads/t/; then exit 0 fi -if [ $(git rev-parse --symbolic-full-name HEAD) = refs/heads/test ]; then - exit 0 -fi # These are the locations I keep my temporary source and build trees in -OUTPUT=$(tools/outdir) # generates a build directory name such as +PRODUCTS=$(./acprep products) # generates a build directory name such as # ~/Products/ledger -PRODUCTS=$(dirname "$OUTPUT") -BASE=$(basename "$OUTPUT") - -if [ -z "$BASE" ]; then - TMPDIR=$PWD/pre-commit - MIRROR=$PWD/pre-commit-mirror -else - TMPDIR=$PRODUCTS/$BASE-pre-commit - MIRROR=$PRODUCTS/$BASE-pre-commit-mirror -fi - -# Exit with status 1 if any command below fails -set -e +TMPDIR=$PRODUCTS/pre-commit +MIRROR=$PRODUCTS/pre-commit-mirror # Checkout a copy of the current index into MIRROR git checkout-index --prefix=$MIRROR/ -af @@ -50,12 +38,14 @@ cd $TMPDIR # regenerate everything manually. If the user doesn't have acprep, look # for other common autoconf-related script files. if [ ! -f Makefile -o \ - Makefile.am -nt Makefile -o \ - configure.ac -nt Makefile -o \ + Makefile.in -nt Makefile -o \ + configure -nt Makefile -o \ + Makefile.am -nt Makefile.in -o \ + configure.ac -nt configure -o \ \( -f acprep -a acprep -nt Makefile \) ] then if [ -f acprep ]; then - ./acprep --local --warn --pch + ./acprep default --local elif [ -f autogen.sh ]; then sh autogen.sh && ./configure else diff --git a/tools/proof b/tools/proof deleted file mode 100755 index 9cd1dc3f..00000000 --- a/tools/proof +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -set -e - -OUTPUT=$(tools/outdir) -PRODUCTS=$(dirname "$OUTPUT") - -# We know which target pathnames are used here, because they are encoded in -# tools/myacprep when specific build targets are requested (such as gcov). - -function build_and_test() { - NAME=--$1 - - echo %%% Configuring $NAME %%% - if ! tools/myacprep $NAME; then - echo %%% FAILED to configure $NAME %%% - exit 1 - fi - - DIR=$PRODUCTS/ledger-$1 - - echo %%% Cleaning $NAME %%% - if ! (cd $DIR && make clean); then - echo %%% FAILED to clean $NAME %%% - exit 1 - fi - - echo %%% Building $NAME %%% - if ! (cd $DIR && make); then - echo %%% FAILED to build $NAME %%% - exit 1 - fi - - if [ "$NAME" = "--gcov" ]; then - echo %%% Testing $NAME %%% - if ! (cd $DIR && make check); then - echo %%% FAILED to test $NAME %%% - exit 1 - fi - else - echo %%% Testing $NAME %%% - if ! (cd $DIR && make fullcheck); then - echo %%% FAILED to test $NAME %%% - exit 1 - fi - fi -} - -echo %%% Removing old opt %%% -rm -fr $PRODUCTS/ledger-opt -build_and_test opt - -echo %%% Removing old gcov %%% -rm -fr $PRODUCTS/ledger-gcov -build_and_test gcov - -echo %%% Removing old std %%% -rm -fr $PRODUCTS/ledger-std -build_and_test std - -echo %%% Removing old debug %%% -rm -fr $PRODUCTS/ledger-debug -build_and_test debug - -echo %%% Building release-distcheck %%% -if ! (cd $PRODUCTS/ledger-std && make release-distcheck); then - echo %%% FAILED to build release-distcheck %%% - exit 1 -fi |