From b4d2e505290dd634b1b82eddefb00806ebe98a6b Mon Sep 17 00:00:00 2001 From: Minero Aoki Date: Mon, 15 Sep 2008 18:53:09 +0000 Subject: [PATCH] * install.sh: check if jar and libcbc are built. * install.sh: fix syntax error. git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4035 1b9489fe-b721-0410-924e-b54b9192deb8 --- ChangeLog | 6 ++++++ install.sh | 31 +++++++++++++++++++++---------- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 17031a1..6be4425 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Sep 16 03:53:07 2008 Minero Aoki + + * install.sh: check if jar and libcbc are built. + + * install.sh: fix syntax error. + Tue Sep 16 03:42:43 2008 Minero Aoki * net/loveruby/cflat/compiler/TypeChecker.java: reject statements diff --git a/install.sh b/install.sh index 379176f..cc72121 100755 --- a/install.sh +++ b/install.sh @@ -1,9 +1,26 @@ #!/bin/bash -version=1.0.0 -prefix="${1:-/usr/local/cbc/$version}" +prefix="${1:-/usr/local/cbc}" +BINS="bin/cbc" +LIBS="lib/cbc.jar lib/libcbc.a" -invoke() { +main() +{ + if ! [ -f lib/cbc.jar && -f lib/libcbc.a ] + then + echo "lib/cbc.jar and lib/libcbc.a do not exist. Build it first" 1>&2 + exit 1 + fi + echo "prefix=$prefix" + invoke mkdir -p "$prefix/bin" + invoke cp $BINS "$prefix/bin" + invoke mkdir -p "$prefix/lib" + invoke cp $LIBS "$prefix/lib" + echo "cbc successfully installed as $prefix/bin/cbc" +} + +invoke() +{ echo "$@" if ! "$@" then @@ -12,10 +29,4 @@ invoke() { fi } -echo "version=$version" -echo "prefix=$prefix" -invoke mkdir -p "$prefix/bin" -invoke cp bin/cbc "$prefix/bin -invoke mkdir -p "$prefix/lib" -invoke cp cbc.jar lib/libcbc.o "$prefix/lib" -echo "cbc successfully installed as $prefix/bin/cbc" +main "$@"