5 : "${prefix:=/usr/local}"
6 : "${includedir:=$prefix/include}"
7 : "${libdir:=$prefix/lib}"
10 HEADER
=BlocksRuntime
/Block.h
11 LIB
=libBlocksRuntime.a
17 if [ -z "$dryrun" ]; then eval "$*"; fi
20 if ! myid
="$(id -u)"; then
21 echo "Cannot run id, aborting!"
24 if [ ! -r $HEADER ]; then
25 echo "Cannot find $HEADER, aborting!"
29 if [ "$1" = '-n' ] ||
[ "$1" = '--dry-run' ]; then
45 if [ "$#" != 0 ]; then
46 echo "Usage: [prefix=prefixdir] $0 [-n | --dry-run] [-shared | -static]"
49 if [ -n "$shared" ]; then
50 UNAME_S
="$(uname -s 2>/dev/null)" ||
:
53 SHLIB
="${LIB%.a}.dylib"
61 if [ -n "$static" ]; then
62 # ignore a missing shared library
63 [ -e "$SHLIB" ] || SHLIB
=
68 if [ -n "$LIB" ] && [ ! -r "$LIB" ]; then
69 echo "Cannot find $LIB, did you run \`buildlib\` or \`buildlib-osx\`?"
72 if [ -n "$SHLIB" ] && [ ! -r "$SHLIB" ]; then
73 echo "Cannot find $SHLIB, did you run \`buildlib -shared\` or \`buildlib-osx -shared\`?"
78 echo "Destination Root(\$DESTDIR): $DESTDIR (default is \"\")"
79 echo "Install Prefix(\$prefix): $prefix (default is /usr/local)"
80 echo "Include Directory(\$includedir): $includedir (default is \$prefix/include)"
81 echo "Library Directory(\$libdir): $libdir (default is \$prefix/lib)"
82 echo "(use prefix=prefixdir $0 [or similar] to change)"
85 if [ -z "$DESTDIR" -a -z "$dryrun" -a "$myid" != 0 ]; then
86 echo "Must be root to install, use sudo $0"
87 echo "(Or try using the --dry-run option)"
90 docmd
"install -d "$DESTDIR"$includedir "$DESTDIR"$libdir"
91 docmd
"install -m 644 $HEADER "$DESTDIR"$includedir/"
93 docmd
"install -m 644 $LIB "$DESTDIR"$libdir/"
95 docmd
"install -m $SHLIBMODE $SHLIB "$DESTDIR"$libdir/"