3 : ${prefix:=/usr/local}
4 : ${includedir:=$prefix/include}
5 : ${libdir:=$prefix/lib}
8 HEADER
=BlocksRuntime
/Block.h
14 if [ -z "$dryrun" ]; then eval "$*"; fi
17 if ! myid
="$(id -u)"; then
18 echo "Cannot run id, aborting!"
21 if [ ! -r $HEADER ]; then
22 echo "Cannot find $HEADER, aborting!"
25 if [ ! -r $LIB ]; then
26 echo "Cannot find $LIB, did you run buildlib or buildlib-osx?"
30 if [ "$1" = '-n' ] ||
[ "$1" = '--dry-run' ]; then
34 if [ "$#" != 0 ]; then
35 echo "Usage: [prefix=prefixdir] $0 [-n | --dry-run]"
39 if [ -n "$DESTDIR" ]; then
40 echo "Destination Root(\$DESTDIR): $DESTDIR (default is \"\")"
42 echo "Install Prefix(\$prefix): $prefix (default is /usr/local)"
43 echo "Include Directory(\$includedir): $includedir (default is \$prefix/include)"
44 echo "Library Directory(\$libdir): $libdir (default is \$prefix/lib)"
45 echo "(use prefix=prefixdir $0 [or similar] to change)"
48 if [ -z "$DESTDIR" -a -z "$dryrun" -a "$myid" != 0 ]; then
49 echo "Must be root to install, use sudo $0"
50 echo "(Or try using the --dry-run option)"
53 docmd
"install -d "$DESTDIR"$includedir "$DESTDIR"$libdir"
54 docmd
"install -m 644 $HEADER "$DESTDIR"$includedir/"
55 docmd
"install -m 644 $LIB "$DESTDIR"$libdir/"