Changeset 3043064 for scripts


Ignore:
Timestamp:
May 30, 2009, 2:51:12 PM (12 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
33539f7
Parents:
c50f589
Message:
scripts/locker-build: use --program-suffix instead of EXE

Update our build script to use the new --program-suffix option to set the
installed binary name to "barnowl-$VERSION", instead of setting the
Makefile variable EXE. At the same time, update it to automatically
detect the version from owl.h, instead of taking it as an argument.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • scripts/locker-build

    rde9edab r3043064  
    44# Build script to build BarnOwl for the locker.
    55
    6 # Usage: locker-build [-n] [-o OUTPUT-TGZ] VERSION SOURCE-TARBALL
     6# Usage: locker-build [-n] [-o OUTPUT-TGZ] SOURCE-TARBALL
    77# -n is a dry-run, and drops to a shell in the build directory
    88# -o does the install into a temporary directory and tars it into the
    99#    specified tarball instead.
    1010# SOURCE-TARBALL is a source tarball, created by do-release
    11 # VERSION should be of the form 'barnowl-VERSION'
    12 #
    13 # TODO: Scrape $VERSION from the tarball
    1411
    1512die() {
     
    2522
    2623usage () {
    27     echo "Usage: $0 [-n] [-o OUTPUT-TGZ] VERSION SOURCE-TARBALL"
     24    echo "Usage: $0 [-n] [-o OUTPUT-TGZ] SOURCE-TARBALL"
    2825    exit 2;
    2926}
     
    5249done
    5350
    54 NAME="$1"
    55 SRC_TGZ="$2"
     51SRC_TGZ="$1"
    5652
    57 test -z "$NAME" && usage
    5853test -z "$SRC_TGZ"  && usage
    5954
     
    8075(
    8176    cd "$TMPDIR"/* || die "Unable to cd to $TMPDIR"
     77    VERS=$(perl -ne 'print $1 if m{^#define\s*OWL_VERSION_STRING\s*"([^"]+)"}' owl.h)
     78    test -z "$VERS" && die "Unable to detect barnowl version."
     79
     80    echo "Building BarnOwl version $VERS"
    8281
    8382    BARNOWL="/afs/sipb.mit.edu/project/barnowl/arch/$ATHENA_SYS"
     
    8786        LDFLAGS="-L$BARNOWL/lib -Wl,-R$BARNOWL/lib" \
    8887        ./configure --exec-prefix="/mit/barnowl/arch/$ATHENA_SYS" \
    89         --prefix="/mit/barnowl/builds/$NAME" --mandir=/mit/barnowl/man \
     88        --prefix="/mit/barnowl/builds/barnowl-$VERS" --mandir=/mit/barnowl/man \
     89        --program-suffix="-$VERS" \
    9090        PROTECT_CFLAGS=-fno-stack-protector \
    9191        || die "configure failed"
     
    9898    fi
    9999
    100     $MAKE -j$CPUS EXE=$NAME all || die "make failed"
     100    $MAKE -j$CPUS all || die "make failed"
    101101
    102102    if [ -n "$DRYRUN" ]; then
     
    106106        if [ -n "$OUT_TGZ" ]; then
    107107            mkdir tgz
    108             $MAKE EXE=$NAME DESTDIR=tgz install || die "Install failed"
     108            $MAKE DESTDIR=tgz install || die "Install failed"
    109109        else
    110             $MAKE EXE=$NAME install || die "Install failed"
     110            $MAKE install || die "Install failed"
    111111        fi
    112112    fi
Note: See TracChangeset for help on using the changeset viewer.